@types/node 22.8.6 → 22.9.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.
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: Thu, 31 Oct 2024 18:02:52 GMT
11
+ * Last updated: Tue, 05 Nov 2024 01:29:26 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": "22.8.6",
3
+ "version": "22.9.0",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~6.19.8"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "b5e95f7873a1811a61b3409c809ee30655d0268d76d767dbe9efc27cb421459f",
223
+ "typesPublisherContentHash": "9fd729e1c7f77c7e5ce00a1690558c1aa810d60c39e52aefa248f3c6c5fb5e7a",
224
224
  "typeScriptVersion": "4.8"
225
225
  }
@@ -3,8 +3,13 @@
3
3
  * @experimental
4
4
  */
5
5
  declare module "readline/promises" {
6
- import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
7
6
  import { Abortable } from "node:events";
7
+ import {
8
+ CompleterResult,
9
+ Direction,
10
+ Interface as _Interface,
11
+ ReadLineOptions as _ReadLineOptions,
12
+ } from "node:readline";
8
13
  /**
9
14
  * Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a
10
15
  * single `input` `Readable` stream and a single `output` `Writable` stream.
@@ -111,6 +116,13 @@ declare module "readline/promises" {
111
116
  */
112
117
  rollback(): this;
113
118
  }
119
+ type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
120
+ interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
121
+ /**
122
+ * An optional function used for Tab autocompletion.
123
+ */
124
+ completer?: Completer | undefined;
125
+ }
114
126
  /**
115
127
  * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
116
128
  *
@@ -140,7 +152,7 @@ declare module "readline/promises" {
140
152
  function createInterface(
141
153
  input: NodeJS.ReadableStream,
142
154
  output?: NodeJS.WritableStream,
143
- completer?: Completer | AsyncCompleter,
155
+ completer?: Completer,
144
156
  terminal?: boolean,
145
157
  ): Interface;
146
158
  function createInterface(options: ReadLineOptions): Interface;
node/readline.d.ts CHANGED
@@ -314,29 +314,78 @@ declare module "readline" {
314
314
  ) => void;
315
315
  export type CompleterResult = [string[], string];
316
316
  export interface ReadLineOptions {
317
+ /**
318
+ * The [`Readable`](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream to listen to
319
+ */
317
320
  input: NodeJS.ReadableStream;
321
+ /**
322
+ * The [`Writable`](https://nodejs.org/docs/latest-v22.x/api/stream.html#writable-streams) stream to write readline data to.
323
+ */
318
324
  output?: NodeJS.WritableStream | undefined;
325
+ /**
326
+ * An optional function used for Tab autocompletion.
327
+ */
319
328
  completer?: Completer | AsyncCompleter | undefined;
329
+ /**
330
+ * `true` if the `input` and `output` streams should be treated like a TTY,
331
+ * and have ANSI/VT100 escape codes written to it.
332
+ * Default: checking `isTTY` on the `output` stream upon instantiation.
333
+ */
320
334
  terminal?: boolean | undefined;
321
335
  /**
322
- * Initial list of history lines. This option makes sense
323
- * only if `terminal` is set to `true` by the user or by an internal `output`
324
- * check, otherwise the history caching mechanism is not initialized at all.
336
+ * Initial list of history lines.
337
+ * This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
338
+ * otherwise the history caching mechanism is not initialized at all.
325
339
  * @default []
326
340
  */
327
341
  history?: string[] | undefined;
342
+ /**
343
+ * Maximum number of history lines retained.
344
+ * To disable the history set this value to `0`.
345
+ * This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
346
+ * otherwise the history caching mechanism is not initialized at all.
347
+ * @default 30
348
+ */
328
349
  historySize?: number | undefined;
329
- prompt?: string | undefined;
330
- crlfDelay?: number | undefined;
331
350
  /**
332
- * If `true`, when a new input line added
333
- * to the history list duplicates an older one, this removes the older line
334
- * from the list.
351
+ * If `true`, when a new input line added to the history list duplicates an older one,
352
+ * this removes the older line from the list.
335
353
  * @default false
336
354
  */
337
355
  removeHistoryDuplicates?: boolean | undefined;
356
+ /**
357
+ * The prompt string to use.
358
+ * @default "> "
359
+ */
360
+ prompt?: string | undefined;
361
+ /**
362
+ * If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds,
363
+ * both `\r` and `\n` will be treated as separate end-of-line input.
364
+ * `crlfDelay` will be coerced to a number no less than `100`.
365
+ * It can be set to `Infinity`, in which case
366
+ * `\r` followed by `\n` will always be considered a single newline
367
+ * (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v22.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
368
+ * @default 100
369
+ */
370
+ crlfDelay?: number | undefined;
371
+ /**
372
+ * The duration `readline` will wait for a character
373
+ * (when reading an ambiguous key sequence in milliseconds
374
+ * one that can both form a complete key sequence using the input read so far
375
+ * and can take additional input to complete a longer key sequence).
376
+ * @default 500
377
+ */
338
378
  escapeCodeTimeout?: number | undefined;
379
+ /**
380
+ * The number of spaces a tab is equal to (minimum 1).
381
+ * @default 8
382
+ */
339
383
  tabSize?: number | undefined;
384
+ /**
385
+ * Allows closing the interface using an AbortSignal.
386
+ * Aborting the signal will internally call `close` on the interface.
387
+ */
388
+ signal?: AbortSignal | undefined;
340
389
  }
341
390
  /**
342
391
  * The `readline.createInterface()` method creates a new `readline.Interface` instance.
node/test.d.ts CHANGED
@@ -1796,6 +1796,25 @@ interface TestCoverage {
1796
1796
  count: number;
1797
1797
  }>;
1798
1798
  }>;
1799
+ /**
1800
+ * An object containing whether or not the coverage for
1801
+ * each coverage type.
1802
+ * @since v22.9.0
1803
+ */
1804
+ thresholds: {
1805
+ /**
1806
+ * The function coverage threshold.
1807
+ */
1808
+ function: number;
1809
+ /**
1810
+ * The branch coverage threshold.
1811
+ */
1812
+ branch: number;
1813
+ /**
1814
+ * The line coverage threshold.
1815
+ */
1816
+ line: number;
1817
+ };
1799
1818
  /**
1800
1819
  * An object containing a summary of coverage for all files.
1801
1820
  */
node/timers/promises.d.ts CHANGED
@@ -80,7 +80,7 @@ declare module "timers/promises" {
80
80
  * @experimental
81
81
  * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
82
82
  */
83
- wait: (delay?: number, options?: Pick<TimerOptions, "signal">) => Promise<void>;
83
+ wait: (delay?: number, options?: TimerOptions) => Promise<void>;
84
84
  /**
85
85
  * An experimental API defined by the [Scheduling APIs](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking) draft specification
86
86
  * being developed as a standard Web Platform API.
node/tls.d.ts CHANGED
@@ -809,6 +809,12 @@ declare module "tls" {
809
809
  * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error.
810
810
  */
811
811
  ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined;
812
+ /**
813
+ * Treat intermediate (non-self-signed)
814
+ * certificates in the trust CA certificate list as trusted.
815
+ * @since v22.9.0, v20.18.0
816
+ */
817
+ allowPartialTrustChain?: boolean | undefined;
812
818
  /**
813
819
  * Optionally override the trusted CA certificates. Default is to trust
814
820
  * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
node/util.d.ts CHANGED
@@ -108,6 +108,25 @@ declare module "util" {
108
108
  export interface InspectOptionsStylized extends InspectOptions {
109
109
  stylize(text: string, styleType: Style): string;
110
110
  }
111
+ export interface StacktraceObject {
112
+ /**
113
+ * Returns the name of the function associated with this stack frame.
114
+ */
115
+ functionName: string;
116
+ /**
117
+ * Returns the name of the resource that contains the script for the
118
+ * function for this StackFrame.
119
+ */
120
+ scriptName: string;
121
+ /**
122
+ * Returns the number, 1-based, of the line for the associate function call.
123
+ */
124
+ lineNumber: number;
125
+ /**
126
+ * Returns the 1-based column offset on the line for the associated function call.
127
+ */
128
+ column: number;
129
+ }
111
130
  /**
112
131
  * The `util.format()` method returns a formatted string using the first argument
113
132
  * as a `printf`-like format string which can contain zero or more format
@@ -166,6 +185,52 @@ declare module "util" {
166
185
  * @since v10.0.0
167
186
  */
168
187
  export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
188
+ /**
189
+ * Returns an array of stacktrace objects containing the stack of
190
+ * the caller function.
191
+ *
192
+ * ```js
193
+ * const util = require('node:util');
194
+ *
195
+ * function exampleFunction() {
196
+ * const callSites = util.getCallSite();
197
+ *
198
+ * console.log('Call Sites:');
199
+ * callSites.forEach((callSite, index) => {
200
+ * console.log(`CallSite ${index + 1}:`);
201
+ * console.log(`Function Name: ${callSite.functionName}`);
202
+ * console.log(`Script Name: ${callSite.scriptName}`);
203
+ * console.log(`Line Number: ${callSite.lineNumber}`);
204
+ * console.log(`Column Number: ${callSite.column}`);
205
+ * });
206
+ * // CallSite 1:
207
+ * // Function Name: exampleFunction
208
+ * // Script Name: /home/example.js
209
+ * // Line Number: 5
210
+ * // Column Number: 26
211
+ *
212
+ * // CallSite 2:
213
+ * // Function Name: anotherFunction
214
+ * // Script Name: /home/example.js
215
+ * // Line Number: 22
216
+ * // Column Number: 3
217
+ *
218
+ * // ...
219
+ * }
220
+ *
221
+ * // A function to simulate another stack layer
222
+ * function anotherFunction() {
223
+ * exampleFunction();
224
+ * }
225
+ *
226
+ * anotherFunction();
227
+ * ```
228
+ * @param frames Number of frames returned in the stacktrace.
229
+ * **Default:** `10`. Allowable range is between 1 and 200.
230
+ * @return An array of stacktrace objects
231
+ * @since v22.9.0
232
+ */
233
+ export function getCallSite(frames?: number): StacktraceObject[];
169
234
  /**
170
235
  * Returns the string name for a numeric error code that comes from a Node.js API.
171
236
  * The mapping between error codes and error names is platform-dependent.