@types/node 25.7.0 → 25.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. node/README.md +1 -1
  2. node/package.json +3 -3
  3. node/sqlite.d.ts +54 -7
  4. node/test.d.ts +46 -4
  5. node/url.d.ts +4 -2
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 11 May 2026 20:06:09 GMT
11
+ * Last updated: Thu, 14 May 2026 16:39:50 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "25.7.0",
3
+ "version": "25.8.0",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -147,9 +147,9 @@
147
147
  },
148
148
  "scripts": {},
149
149
  "dependencies": {
150
- "undici-types": "~7.21.0"
150
+ "undici-types": ">=7.24.0 <7.24.7"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "eddf50137d03f63ae7f6e4766ed9b825cc70a85ef2f7d5c89290fba06040ceed",
153
+ "typesPublisherContentHash": "e3b0c76dfc9cc84424890451a36d8ae1dbc86b0b0e49cc458f2a886fda8e4649",
154
154
  "typeScriptVersion": "5.3"
155
155
  }
node/sqlite.d.ts CHANGED
@@ -87,6 +87,29 @@ declare module "node:sqlite" {
87
87
  * @default true
88
88
  */
89
89
  defensive?: boolean | undefined;
90
+ /**
91
+ * Configuration for various SQLite limits. These limits
92
+ * can be used to prevent excessive resource consumption when handling
93
+ * potentially malicious input. See [Run-Time Limits](https://www.sqlite.org/c3ref/c_limit_attached.html) and [Limit Constants](https://www.sqlite.org/c3ref/limit.html)
94
+ * in the SQLite documentation for details. Default values are determined by
95
+ * SQLite's compile-time defaults and may vary depending on how SQLite was
96
+ * built. The following properties are supported:
97
+ * @since v25.8.0
98
+ */
99
+ limits?: NodeJS.PartialOptions<DatabaseLimits> | undefined;
100
+ }
101
+ interface DatabaseLimits {
102
+ length: number;
103
+ sqlLength: number;
104
+ column: number;
105
+ exprDepth: number;
106
+ compoundSelect: number;
107
+ vdbeOp: number;
108
+ functionArg: number;
109
+ attach: number;
110
+ likePatternLength: number;
111
+ variableNumber: number;
112
+ triggerDepth: number;
90
113
  }
91
114
  interface CreateSessionOptions {
92
115
  /**
@@ -311,18 +334,17 @@ declare module "node:sqlite" {
311
334
  * @since v22.13.0
312
335
  * @param name The name of the SQLite function to create.
313
336
  * @param options Optional configuration settings for the function.
314
- * @param func The JavaScript function to call when the SQLite
315
- * function is invoked. The return value of this function should be a valid
316
- * SQLite data type: see
317
- * [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v25.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite).
318
- * The result defaults to `NULL` if the return value is `undefined`.
337
+ * @param fn The JavaScript function to call when the SQLite function is
338
+ * invoked. The return value of this function should be a valid SQLite data type:
339
+ * see [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v25.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite). The result defaults to
340
+ * `NULL` if the return value is `undefined`.
319
341
  */
320
342
  function(
321
343
  name: string,
322
344
  options: FunctionOptions,
323
- func: (...args: SQLOutputValue[]) => SQLInputValue,
345
+ fn: (...args: SQLOutputValue[]) => SQLInputValue,
324
346
  ): void;
325
- function(name: string, func: (...args: SQLOutputValue[]) => SQLInputValue): void;
347
+ function(name: string, fn: (...args: SQLOutputValue[]) => SQLInputValue): void;
326
348
  /**
327
349
  * Sets an authorizer callback that SQLite will invoke whenever it attempts to
328
350
  * access data or modify the database schema through prepared statements.
@@ -392,6 +414,31 @@ declare module "node:sqlite" {
392
414
  * @since v24.0.0
393
415
  */
394
416
  readonly isTransaction: boolean;
417
+ /**
418
+ * An object for getting and setting SQLite database limits at runtime.
419
+ * Each property corresponds to an SQLite limit and can be read or written.
420
+ *
421
+ * ```js
422
+ * const db = new DatabaseSync(':memory:');
423
+ *
424
+ * // Read current limit
425
+ * console.log(db.limits.length);
426
+ *
427
+ * // Set a new limit
428
+ * db.limits.sqlLength = 100000;
429
+ *
430
+ * // Reset a limit to its compile-time maximum
431
+ * db.limits.sqlLength = Infinity;
432
+ * ```
433
+ *
434
+ * Available properties: `length`, `sqlLength`, `column`, `exprDepth`,
435
+ * `compoundSelect`, `vdbeOp`, `functionArg`, `attach`, `likePatternLength`,
436
+ * `variableNumber`, `triggerDepth`.
437
+ *
438
+ * Setting a property to `Infinity` resets the limit to its compile-time maximum value.
439
+ * @since v25.8.0
440
+ */
441
+ readonly limits: DatabaseLimits;
395
442
  /**
396
443
  * Opens the database specified in the `path` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via
397
444
  * the constructor. An exception is thrown if the database is already open.
node/test.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare module "node:test" {
2
- import { AssertMethodNames } from "node:assert";
2
+ import { AssertMethodNames, AssertPredicate } from "node:assert";
3
3
  import { Readable, ReadableEventMap } from "node:stream";
4
4
  import { TestEvent } from "node:test/reporters";
5
5
  import { URL } from "node:url";
@@ -111,7 +111,12 @@ declare module "node:test" {
111
111
  function only(name?: string, fn?: SuiteFn): Promise<void>;
112
112
  function only(options?: TestOptions, fn?: SuiteFn): Promise<void>;
113
113
  function only(fn?: SuiteFn): Promise<void>;
114
- // added in v25.5.0, undocumented
114
+ /**
115
+ * This flips the pass/fail reporting for a specific test or suite: a flagged test
116
+ * case must throw in order to pass, and a flagged test case that does not throw
117
+ * fails.
118
+ * @since v25.5.0
119
+ */
115
120
  function expectFailure(name?: string, options?: TestOptions, fn?: SuiteFn): Promise<void>;
116
121
  function expectFailure(name?: string, fn?: SuiteFn): Promise<void>;
117
122
  function expectFailure(options?: TestOptions, fn?: SuiteFn): Promise<void>;
@@ -992,6 +997,34 @@ declare module "node:test" {
992
997
  * @since v21.7.0, v20.12.0
993
998
  */
994
999
  readonly attempt: number;
1000
+ /**
1001
+ * The unique identifier of the worker running the current test file. This value is
1002
+ * derived from the `NODE_TEST_WORKER_ID` environment variable. When running tests
1003
+ * with `--test-isolation=process` (the default), each test file runs in a separate
1004
+ * child process and is assigned a worker ID from 1 to N, where N is the number of
1005
+ * concurrent workers. When running with `--test-isolation=none`, all tests run in
1006
+ * the same process and the worker ID is always 1. This value is `undefined` when
1007
+ * not running in a test context.
1008
+ *
1009
+ * This property is useful for splitting resources (like database connections or
1010
+ * server ports) across concurrent test files:
1011
+ *
1012
+ * ```js
1013
+ * import { test } from 'node:test';
1014
+ * import { process } from 'node:process';
1015
+ *
1016
+ * test('database operations', async (t) => {
1017
+ * // Worker ID is available via context
1018
+ * console.log(`Running in worker ${t.workerId}`);
1019
+ *
1020
+ * // Or via environment variable (available at import time)
1021
+ * const workerId = process.env.NODE_TEST_WORKER_ID;
1022
+ * // Use workerId to allocate separate resources per worker
1023
+ * });
1024
+ * ```
1025
+ * @since v25.8.0
1026
+ */
1027
+ readonly workerId: number | undefined;
995
1028
  /**
996
1029
  * This function is used to set the number of assertions and subtests that are expected to run
997
1030
  * within the test. If the number of assertions and subtests that run does not match the
@@ -1272,6 +1305,17 @@ declare module "node:test" {
1272
1305
  * @default false
1273
1306
  */
1274
1307
  concurrency?: number | boolean | undefined;
1308
+ /**
1309
+ * If truthy, the test is expected to fail. If a non-empty string is provided, that string is displayed
1310
+ * in the test results as the reason why the test is expected to fail. If a
1311
+ * `RegExp`, `Function`, `Object`, or `Error` is provided directly (without wrapping in `{ match: … }`), the test passes
1312
+ * only if the thrown error matches, following the behavior of
1313
+ * `assert.throws`. To provide both a reason and validation, pass an object
1314
+ * with `label` (string) and `match` (RegExp, Function, Object, or Error).
1315
+ * @since v25.5.0
1316
+ * @default false
1317
+ */
1318
+ expectFailure?: boolean | string | AssertPredicate | undefined;
1275
1319
  /**
1276
1320
  * If truthy, and the test context is configured to run `only` tests, then this test will be
1277
1321
  * run. Otherwise, the test is skipped.
@@ -1310,8 +1354,6 @@ declare module "node:test" {
1310
1354
  * @since v22.2.0
1311
1355
  */
1312
1356
  plan?: number | undefined;
1313
- // added in v25.5.0, undocumented
1314
- expectFailure?: boolean | undefined;
1315
1357
  }
1316
1358
  /**
1317
1359
  * This function creates a hook that runs before executing a suite.
node/url.d.ts CHANGED
@@ -235,7 +235,7 @@ declare module "node:url" {
235
235
  /**
236
236
  * `url.format(urlString)` is shorthand for `url.format(url.parse(urlString))`.
237
237
  *
238
- * Because it invokes the deprecated `url.parse()`, passing a string argument
238
+ * Because it invokes the deprecated `url.parse()` internally, passing a string argument
239
239
  * to `url.format()` is itself deprecated.
240
240
  *
241
241
  * Canonicalizing a URL string can be performed using the WHATWG URL API, by
@@ -265,6 +265,8 @@ declare module "node:url" {
265
265
  * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
266
266
  * ```
267
267
  *
268
+ * Because it invokes the deprecated `url.parse()` internally, `url.resolve()` is itself deprecated.
269
+ *
268
270
  * To achieve the same result using the WHATWG URL API:
269
271
  *
270
272
  * ```js
@@ -283,7 +285,7 @@ declare module "node:url" {
283
285
  * resolve('http://example.com/one', '/two'); // 'http://example.com/two'
284
286
  * ```
285
287
  * @since v0.1.25
286
- * @legacy Use the WHATWG URL API instead.
288
+ * @deprecated Use the WHATWG URL API instead.
287
289
  * @param from The base URL to use if `to` is a relative URL.
288
290
  * @param to The target URL to resolve.
289
291
  */