Skip to content

Commit 6d0fd0d

Browse files
🤖 Merge PR DefinitelyTyped#74541 [@types/node]: v24.11.1 by @kshitijanurag
1 parent 543c8b0 commit 6d0fd0d

File tree

7 files changed

+70
-44
lines changed

7 files changed

+70
-44
lines changed

types/node/v24/inspector.generated.d.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,6 +1791,18 @@ declare module "inspector" {
17911791
*/
17921792
headers: Headers;
17931793
}
1794+
interface EnableParameterType {
1795+
/**
1796+
* Buffer size in bytes to use when preserving network payloads (XHRs, etc).
1797+
* @experimental
1798+
*/
1799+
maxTotalBufferSize?: number | undefined;
1800+
/**
1801+
* Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
1802+
* @experimental
1803+
*/
1804+
maxResourceBufferSize?: number | undefined;
1805+
}
17941806
interface GetRequestPostDataParameterType {
17951807
/**
17961808
* Identifier of the network request to get content for.
@@ -2379,6 +2391,7 @@ declare module "inspector" {
23792391
/**
23802392
* Enables network tracking, network events will now be delivered to the client.
23812393
*/
2394+
post(method: "Network.enable", params?: Network.EnableParameterType, callback?: (err: Error | null) => void): void;
23822395
post(method: "Network.enable", callback?: (err: Error | null) => void): void;
23832396
/**
23842397
* Returns post data sent with the request. Returns an error when no data was sent with the request.
@@ -3477,7 +3490,7 @@ declare module "inspector/promises" {
34773490
/**
34783491
* Enables network tracking, network events will now be delivered to the client.
34793492
*/
3480-
post(method: "Network.enable"): Promise<void>;
3493+
post(method: "Network.enable", params?: Network.EnableParameterType): Promise<void>;
34813494
/**
34823495
* Returns post data sent with the request. Returns an error when no data was sent with the request.
34833496
*/

types/node/v24/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/node",
4-
"version": "24.10.9999",
4+
"version": "24.11.9999",
55
"nonNpm": "conflict",
66
"nonNpmDescription": "Node.js",
77
"projects": [

types/node/v24/sqlite.d.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
* import sqlite from 'node:sqlite';
77
* ```
88
*
9-
* This module is only available under the `node:` scheme. The following will not
10-
* work:
11-
*
12-
* ```js
13-
* import sqlite from 'sqlite';
14-
* ```
9+
* This module is only available under the `node:` scheme.
1510
*
1611
* The following example shows the basic usage of the `node:sqlite` module to open
1712
* an in-memory database, write data to the database, and then read the data back.
@@ -413,7 +408,7 @@ declare module "node:sqlite" {
413408
*/
414409
prepare(sql: string): StatementSync;
415410
/**
416-
* Creates a new `SQLTagStore`, which is an LRU (Least Recently Used) cache for
411+
* Creates a new {@link SQLTagStore `SQLTagStore`}, which is an LRU (Least Recently Used) cache for
417412
* storing prepared statements. This allows for the efficient reuse of prepared
418413
* statements by tagging them with a unique identifier.
419414
*
@@ -427,7 +422,7 @@ declare module "node:sqlite" {
427422
* import { DatabaseSync } from 'node:sqlite';
428423
*
429424
* const db = new DatabaseSync(':memory:');
430-
* const sql = db.createSQLTagStore();
425+
* const sql = db.createTagStore();
431426
*
432427
* db.exec('CREATE TABLE users (id INT, name TEXT)');
433428
*
@@ -450,6 +445,7 @@ declare module "node:sqlite" {
450445
* // ]
451446
* ```
452447
* @since v24.9.0
448+
* @param maxSize The maximum number of prepared statements to cache. **Default**: `1000`.
453449
* @returns A new SQL tag store for caching prepared statements.
454450
*/
455451
createTagStore(maxSize?: number): SQLTagStore;
@@ -468,6 +464,8 @@ declare module "node:sqlite" {
468464
* [`sqlite3changeset_apply()`](https://www.sqlite.org/session/sqlite3changeset_apply.html).
469465
*
470466
* ```js
467+
* import { DatabaseSync } from 'node:sqlite';
468+
*
471469
* const sourceDb = new DatabaseSync(':memory:');
472470
* const targetDb = new DatabaseSync(':memory:');
473471
*
@@ -530,14 +528,14 @@ declare module "node:sqlite" {
530528
* This class represents a single LRU (Least Recently Used) cache for storing
531529
* prepared statements.
532530
*
533-
* Instances of this class are created via the database.createSQLTagStore() method,
531+
* Instances of this class are created via the database.createTagStore() method,
534532
* not by using a constructor. The store caches prepared statements based on the
535533
* provided SQL query string. When the same query is seen again, the store
536534
* retrieves the cached statement and safely applies the new values through
537535
* parameter binding, thereby preventing attacks like SQL injection.
538536
*
539537
* The cache has a maxSize that defaults to 1000 statements, but a custom size can
540-
* be provided (e.g., database.createSQLTagStore(100)). All APIs exposed by this
538+
* be provided (e.g., database.createTagStore(100)). All APIs exposed by this
541539
* class execute synchronously.
542540
* @since v24.9.0
543541
*/

types/node/v24/test/vm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ import {
200200
// "contextifiedObject" when creating the context.
201201
export default secret;
202202
`,
203-
{ context: rootModule.context },
203+
{ context: module.context },
204204
);
205205
moduleMap.set(specifier, requestedModule);
206206

types/node/v24/url.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ declare module "url" {
8080
* function getURL(req) {
8181
* const proto = req.headers['x-forwarded-proto'] || 'https';
8282
* const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';
83-
* return new URL(req.url || '/', `${proto}://${host}`);
83+
* return new URL(`${proto}://${host}${req.url || '/'}`);
8484
* }
8585
* ```
8686
*
@@ -90,7 +90,7 @@ declare module "url" {
9090
*
9191
* ```js
9292
* function getURL(req) {
93-
* return new URL(req.url || '/', 'https://example.com');
93+
* return new URL(`https://example.com${req.url || '/'}`);
9494
* }
9595
* ```
9696
* @since v0.1.25

types/node/v24/vm.d.ts

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ declare module "vm" {
748748
* // The "secret" variable refers to the global variable we added to
749749
* // "contextifiedObject" when creating the context.
750750
* export default secret;
751-
* `, { context: referencingModule.context });
752-
* moduleMap.set(specifier, linkedModule);
751+
* `, { context: module.context });
752+
* moduleMap.set(specifier, requestedModule);
753753
* // Resolve the dependencies of the new module as well.
754754
* resolveAndLinkDependencies(requestedModule);
755755
* }
@@ -819,19 +819,34 @@ declare module "vm" {
819819
*/
820820
status: ModuleStatus;
821821
/**
822-
* Evaluate the module.
823-
*
824-
* This must be called after the module has been linked; otherwise it will reject.
825-
* It could be called also when the module has already been evaluated, in which
826-
* case it will either do nothing if the initial evaluation ended in success
827-
* (`module.status` is `'evaluated'`) or it will re-throw the exception that the
828-
* initial evaluation resulted in (`module.status` is `'errored'`).
829-
*
830-
* This method cannot be called while the module is being evaluated
831-
* (`module.status` is `'evaluating'`).
832-
*
833-
* Corresponds to the [Evaluate() concrete method](https://tc39.es/ecma262/#sec-moduleevaluation) field of [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records) s in the
834-
* ECMAScript specification.
822+
* Evaluate the module and its depenendencies. Corresponds to the [Evaluate() concrete method](https://tc39.es/ecma262/#sec-moduleevaluation)
823+
* field of [Cyclic Module Record](https://tc39.es/ecma262/#sec-cyclic-module-records)s in the ECMAScript specification.
824+
*
825+
* If the module is a `vm.SourceTextModule`, `evaluate()` must be called after the module has been instantiated;
826+
* otherwise `evaluate()` will return a rejected promise.
827+
*
828+
* For a `vm.SourceTextModule`, the promise returned by `evaluate()` may be fulfilled either synchronously or asynchronously:
829+
* 1. If the `vm.SourceTextModule` has no top-level `await` in itself or any of its dependencies, the promise will be
830+
* fulfilled synchronously after the module and all its dependencies have been evaluated.
831+
* 1. If the evaluation succeeds, the promise will be _synchronously_ resolved to `undefined`.
832+
* 2. If the evaluation results in an exception, the promise will be _synchronously_ rejected with the exception that causes the evaluation to fail, which is the same as `module.error`.
833+
* 2. If the `vm.SourceTextModule` has top-level `await` in itself or any of its dependencies, the promise will be fulfilled asynchronously after the module and all its dependencies have been evaluated.
834+
* 1. If the evaluation succeeds, the promise will be _asynchronously_ resolved to `undefined`.
835+
* 2. If the evaluation results in an exception, the promise will be _asynchronously_ rejected with the exception that causes the evaluation to fail.
836+
*
837+
* If the module is a `vm.SyntheticModule`, `evaluate()` always returns a promise that fulfills synchronously,
838+
* see the specification of [Evaluate() of a Synthetic Module Record](https://tc39.es/ecma262/#sec-smr-Evaluate):
839+
* 1. If the `evaluateCallback` passed to its constructor throws an exception synchronously, `evaluate()` returns a promise that will be synchronously rejected with that exception.
840+
* 2. If the `evaluateCallback` does not throw an exception, `evaluate()` returns a promise that will be synchronously resolved to `undefined`.
841+
*
842+
* The `evaluateCallback` of a `vm.SyntheticModule` is executed synchronously within the `evaluate()` call, and its return value is discarded. This means if `evaluateCallback` is an asynchronous function, the promise
843+
* returned by `evaluate()` will not reflect its asynchronous behavior, and any rejections from an asynchronous `evaluateCallback` will be lost.
844+
*
845+
* evaluate() could also be called again after the module has already been evaluated, in which case:
846+
* 1. If the initial evaluation ended in success (`module.status` is `'evaluated'`), it will do nothing and return a promise that resolves to `undefined`.
847+
* 2. If the initial evaluation resulted in an exception (`module.status` is `'errored'`), it will re-reject the exception that the initial evaluation resulted in.
848+
*
849+
* This method cannot be called while the module is being evaluated (`module.status` is `'evaluating'`).
835850
* @return Fulfills with `undefined` upon success.
836851
*/
837852
evaluate(options?: ModuleEvaluateOptions): Promise<void>;

types/node/v24/worker_threads.d.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* JavaScript in parallel. To access it:
44
*
55
* ```js
6-
* import worker from 'node:worker_threads';
6+
* import worker_threads from 'node:worker_threads';
77
* ```
88
*
99
* Workers (threads) are useful for performing CPU-intensive JavaScript operations.
@@ -446,8 +446,8 @@ declare module "worker_threads" {
446446
*/
447447
terminate(): Promise<number>;
448448
/**
449-
* This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`,
450-
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
449+
* This method returns a `Promise` that will resolve to an object identical to {@link process.threadCpuUsage()},
450+
* or reject with an [`ERR_WORKER_NOT_RUNNING`](https://nodejs.org/docs/latest-v24.x/api/errors.html#err_worker_not_running) error if the worker is no longer running.
451451
* This methods allows the statistics to be observed from outside the actual thread.
452452
* @since v24.6.0
453453
*/
@@ -556,49 +556,49 @@ declare module "worker_threads" {
556556
* @since v24.2.0
557557
*/
558558
[Symbol.asyncDispose](): Promise<void>;
559-
addListener(event: "error", listener: (err: Error) => void): this;
559+
addListener(event: "error", listener: (err: any) => void): this;
560560
addListener(event: "exit", listener: (exitCode: number) => void): this;
561561
addListener(event: "message", listener: (value: any) => void): this;
562562
addListener(event: "messageerror", listener: (error: Error) => void): this;
563563
addListener(event: "online", listener: () => void): this;
564564
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
565-
emit(event: "error", err: Error): boolean;
565+
emit(event: "error", err: any): boolean;
566566
emit(event: "exit", exitCode: number): boolean;
567567
emit(event: "message", value: any): boolean;
568568
emit(event: "messageerror", error: Error): boolean;
569569
emit(event: "online"): boolean;
570570
emit(event: string | symbol, ...args: any[]): boolean;
571-
on(event: "error", listener: (err: Error) => void): this;
571+
on(event: "error", listener: (err: any) => void): this;
572572
on(event: "exit", listener: (exitCode: number) => void): this;
573573
on(event: "message", listener: (value: any) => void): this;
574574
on(event: "messageerror", listener: (error: Error) => void): this;
575575
on(event: "online", listener: () => void): this;
576576
on(event: string | symbol, listener: (...args: any[]) => void): this;
577-
once(event: "error", listener: (err: Error) => void): this;
577+
once(event: "error", listener: (err: any) => void): this;
578578
once(event: "exit", listener: (exitCode: number) => void): this;
579579
once(event: "message", listener: (value: any) => void): this;
580580
once(event: "messageerror", listener: (error: Error) => void): this;
581581
once(event: "online", listener: () => void): this;
582582
once(event: string | symbol, listener: (...args: any[]) => void): this;
583-
prependListener(event: "error", listener: (err: Error) => void): this;
583+
prependListener(event: "error", listener: (err: any) => void): this;
584584
prependListener(event: "exit", listener: (exitCode: number) => void): this;
585585
prependListener(event: "message", listener: (value: any) => void): this;
586586
prependListener(event: "messageerror", listener: (error: Error) => void): this;
587587
prependListener(event: "online", listener: () => void): this;
588588
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
589-
prependOnceListener(event: "error", listener: (err: Error) => void): this;
589+
prependOnceListener(event: "error", listener: (err: any) => void): this;
590590
prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
591591
prependOnceListener(event: "message", listener: (value: any) => void): this;
592592
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
593593
prependOnceListener(event: "online", listener: () => void): this;
594594
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
595-
removeListener(event: "error", listener: (err: Error) => void): this;
595+
removeListener(event: "error", listener: (err: any) => void): this;
596596
removeListener(event: "exit", listener: (exitCode: number) => void): this;
597597
removeListener(event: "message", listener: (value: any) => void): this;
598598
removeListener(event: "messageerror", listener: (error: Error) => void): this;
599599
removeListener(event: "online", listener: () => void): this;
600600
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
601-
off(event: "error", listener: (err: Error) => void): this;
601+
off(event: "error", listener: (err: any) => void): this;
602602
off(event: "exit", listener: (exitCode: number) => void): this;
603603
off(event: "message", listener: (value: any) => void): this;
604604
off(event: "messageerror", listener: (error: Error) => void): this;
@@ -691,7 +691,7 @@ declare module "worker_threads" {
691691
var locks: LockManager;
692692
/**
693693
* Mark an object as not transferable. If `object` occurs in the transfer list of
694-
* a `port.postMessage()` call, it is ignored.
694+
* a {@link MessagePort.postMessage port.postMessage()} call, it is ignored.
695695
*
696696
* In particular, this makes sense for objects that can be cloned, rather than
697697
* transferred, and which are used by other objects on the sending side.
@@ -813,13 +813,13 @@ declare module "worker_threads" {
813813
*
814814
* if (isMainThread) {
815815
* setEnvironmentData('Hello', 'World!');
816-
* const worker = new Worker(__filename);
816+
* const worker = new Worker(new URL(import.meta.url));
817817
* } else {
818818
* console.log(getEnvironmentData('Hello')); // Prints 'World!'.
819819
* }
820820
* ```
821821
* @since v15.12.0, v14.18.0
822-
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
822+
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map Map} key.
823823
*/
824824
function getEnvironmentData(key: Serializable): Serializable;
825825
/**

0 commit comments

Comments
 (0)