@types/node 20.16.1 → 20.16.3
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 v20.16/README.md +1 -1
- node v20.16/buffer.d.ts +17 -10
- node v20.16/globals.d.ts +96 -5
- node v20.16/inspector.d.ts +1061 -111
- node v20.16/package.json +2 -2
- node v20.16/process.d.ts +2 -3
- node v20.16/stream/web.d.ts +177 -23
- node v20.16/test.d.ts +21 -12
node v20.16/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "20.16.
|
3
|
+
"version": "20.16.3",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -212,6 +212,6 @@
|
|
212
212
|
"dependencies": {
|
213
213
|
"undici-types": "~6.19.2"
|
214
214
|
},
|
215
|
-
"typesPublisherContentHash": "
|
215
|
+
"typesPublisherContentHash": "0031738d9b4600037faf992f8a3057514a229d4bdf728ed6eb4b4e33cdf5c119",
|
216
216
|
"typeScriptVersion": "4.8"
|
217
217
|
}
|
node v20.16/process.d.ts
CHANGED
@@ -45,9 +45,8 @@ declare module "process" {
|
|
45
45
|
"node:https": typeof import("node:https");
|
46
46
|
"inspector": typeof import("inspector");
|
47
47
|
"node:inspector": typeof import("node:inspector");
|
48
|
-
|
49
|
-
|
50
|
-
// "node:inspector/promises": typeof import("node:inspector/promises");
|
48
|
+
"inspector/promises": typeof import("inspector/promises");
|
49
|
+
"node:inspector/promises": typeof import("node:inspector/promises");
|
51
50
|
"module": typeof import("module");
|
52
51
|
"node:module": typeof import("node:module");
|
53
52
|
"net": typeof import("net");
|
node v20.16/stream/web.d.ts
CHANGED
@@ -1,3 +1,38 @@
|
|
1
|
+
type _ByteLengthQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
|
2
|
+
: import("stream/web").ByteLengthQueuingStrategy;
|
3
|
+
type _CompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
|
4
|
+
: import("stream/web").CompressionStream;
|
5
|
+
type _CountQueuingStrategy = typeof globalThis extends { onmessage: any } ? {}
|
6
|
+
: import("stream/web").CountQueuingStrategy;
|
7
|
+
type _DecompressionStream = typeof globalThis extends { onmessage: any; ReportingObserver: any } ? {}
|
8
|
+
: import("stream/web").DecompressionStream;
|
9
|
+
type _ReadableByteStreamController = typeof globalThis extends { onmessage: any } ? {}
|
10
|
+
: import("stream/web").ReadableByteStreamController;
|
11
|
+
type _ReadableStream<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
12
|
+
: import("stream/web").ReadableStream<R>;
|
13
|
+
type _ReadableStreamBYOBReader = typeof globalThis extends { onmessage: any } ? {}
|
14
|
+
: import("stream/web").ReadableStreamBYOBReader;
|
15
|
+
type _ReadableStreamBYOBRequest = typeof globalThis extends { onmessage: any } ? {}
|
16
|
+
: import("stream/web").ReadableStreamBYOBRequest;
|
17
|
+
type _ReadableStreamDefaultController<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
18
|
+
: import("stream/web").ReadableStreamDefaultController<R>;
|
19
|
+
type _ReadableStreamDefaultReader<R = any> = typeof globalThis extends { onmessage: any } ? {}
|
20
|
+
: import("stream/web").ReadableStreamDefaultReader<R>;
|
21
|
+
type _TextDecoderStream = typeof globalThis extends { onmessage: any } ? {}
|
22
|
+
: import("stream/web").TextDecoderStream;
|
23
|
+
type _TextEncoderStream = typeof globalThis extends { onmessage: any } ? {}
|
24
|
+
: import("stream/web").TextEncoderStream;
|
25
|
+
type _TransformStream<I = any, O = any> = typeof globalThis extends { onmessage: any } ? {}
|
26
|
+
: import("stream/web").TransformStream<I, O>;
|
27
|
+
type _TransformStreamDefaultController<O = any> = typeof globalThis extends { onmessage: any } ? {}
|
28
|
+
: import("stream/web").TransformStreamDefaultController<O>;
|
29
|
+
type _WritableStream<W = any> = typeof globalThis extends { onmessage: any } ? {}
|
30
|
+
: import("stream/web").WritableStream<W>;
|
31
|
+
type _WritableStreamDefaultController = typeof globalThis extends { onmessage: any } ? {}
|
32
|
+
: import("stream/web").WritableStreamDefaultController;
|
33
|
+
type _WritableStreamDefaultWriter<W = any> = typeof globalThis extends { onmessage: any } ? {}
|
34
|
+
: import("stream/web").WritableStreamDefaultWriter<W>;
|
35
|
+
|
1
36
|
declare module "stream/web" {
|
2
37
|
// stub module, pending copy&paste from .d.ts or manual impl
|
3
38
|
// copy from lib.dom.d.ts
|
@@ -65,18 +100,7 @@ declare module "stream/web" {
|
|
65
100
|
readonly closed: Promise<undefined>;
|
66
101
|
cancel(reason?: any): Promise<void>;
|
67
102
|
}
|
68
|
-
interface ReadableStreamDefaultReadValueResult<T> {
|
69
|
-
done: false;
|
70
|
-
value: T;
|
71
|
-
}
|
72
|
-
interface ReadableStreamDefaultReadDoneResult {
|
73
|
-
done: true;
|
74
|
-
value?: undefined;
|
75
|
-
}
|
76
103
|
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
|
77
|
-
type ReadableStreamDefaultReadResult<T> =
|
78
|
-
| ReadableStreamDefaultReadValueResult<T>
|
79
|
-
| ReadableStreamDefaultReadDoneResult;
|
80
104
|
interface ReadableStreamReadValueResult<T> {
|
81
105
|
done: false;
|
82
106
|
value: T;
|
@@ -146,8 +170,9 @@ declare module "stream/web" {
|
|
146
170
|
interface ReadableStream<R = any> {
|
147
171
|
readonly locked: boolean;
|
148
172
|
cancel(reason?: any): Promise<void>;
|
149
|
-
getReader(): ReadableStreamDefaultReader<R>;
|
150
173
|
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader;
|
174
|
+
getReader(): ReadableStreamDefaultReader<R>;
|
175
|
+
getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>;
|
151
176
|
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
152
177
|
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
153
178
|
tee(): [ReadableStream<R>, ReadableStream<R>];
|
@@ -160,20 +185,48 @@ declare module "stream/web" {
|
|
160
185
|
new(underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
|
161
186
|
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
162
187
|
};
|
188
|
+
type ReadableStreamReaderMode = "byob";
|
189
|
+
interface ReadableStreamGetReaderOptions {
|
190
|
+
/**
|
191
|
+
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
|
192
|
+
*
|
193
|
+
* This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.
|
194
|
+
*/
|
195
|
+
mode?: ReadableStreamReaderMode;
|
196
|
+
}
|
197
|
+
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
|
163
198
|
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
|
164
|
-
read(): Promise<
|
199
|
+
read(): Promise<ReadableStreamReadResult<R>>;
|
165
200
|
releaseLock(): void;
|
166
201
|
}
|
202
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
167
203
|
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
|
204
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
168
205
|
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
206
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
169
207
|
releaseLock(): void;
|
170
208
|
}
|
171
209
|
const ReadableStreamDefaultReader: {
|
172
210
|
prototype: ReadableStreamDefaultReader;
|
173
211
|
new<R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
|
174
212
|
};
|
175
|
-
const ReadableStreamBYOBReader:
|
176
|
-
|
213
|
+
const ReadableStreamBYOBReader: {
|
214
|
+
prototype: ReadableStreamBYOBReader;
|
215
|
+
new(stream: ReadableStream): ReadableStreamBYOBReader;
|
216
|
+
};
|
217
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
218
|
+
interface ReadableStreamBYOBRequest {
|
219
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/view) */
|
220
|
+
readonly view: ArrayBufferView | null;
|
221
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respond) */
|
222
|
+
respond(bytesWritten: number): void;
|
223
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView) */
|
224
|
+
respondWithNewView(view: ArrayBufferView): void;
|
225
|
+
}
|
226
|
+
const ReadableStreamBYOBRequest: {
|
227
|
+
prototype: ReadableStreamBYOBRequest;
|
228
|
+
new(): ReadableStreamBYOBRequest;
|
229
|
+
};
|
177
230
|
interface ReadableByteStreamController {
|
178
231
|
readonly byobRequest: undefined;
|
179
232
|
readonly desiredSize: number | null;
|
@@ -345,22 +398,123 @@ declare module "stream/web" {
|
|
345
398
|
prototype: TextDecoderStream;
|
346
399
|
new(encoding?: string, options?: TextDecoderOptions): TextDecoderStream;
|
347
400
|
};
|
348
|
-
interface CompressionStream
|
349
|
-
readonly readable: ReadableStream
|
350
|
-
readonly writable: WritableStream
|
401
|
+
interface CompressionStream {
|
402
|
+
readonly readable: ReadableStream;
|
403
|
+
readonly writable: WritableStream;
|
351
404
|
}
|
352
405
|
const CompressionStream: {
|
353
406
|
prototype: CompressionStream;
|
354
|
-
new
|
407
|
+
new(format: "deflate" | "deflate-raw" | "gzip"): CompressionStream;
|
355
408
|
};
|
356
|
-
interface DecompressionStream
|
357
|
-
readonly
|
358
|
-
readonly
|
409
|
+
interface DecompressionStream {
|
410
|
+
readonly writable: WritableStream;
|
411
|
+
readonly readable: ReadableStream;
|
359
412
|
}
|
360
413
|
const DecompressionStream: {
|
361
414
|
prototype: DecompressionStream;
|
362
|
-
new
|
415
|
+
new(format: "deflate" | "deflate-raw" | "gzip"): DecompressionStream;
|
363
416
|
};
|
417
|
+
|
418
|
+
global {
|
419
|
+
interface ByteLengthQueuingStrategy extends _ByteLengthQueuingStrategy {}
|
420
|
+
var ByteLengthQueuingStrategy: typeof globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T }
|
421
|
+
? T
|
422
|
+
: typeof import("stream/web").ByteLengthQueuingStrategy;
|
423
|
+
|
424
|
+
interface CompressionStream extends _CompressionStream {}
|
425
|
+
var CompressionStream: typeof globalThis extends {
|
426
|
+
onmessage: any;
|
427
|
+
// CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
|
428
|
+
// If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
|
429
|
+
ReportingObserver: any;
|
430
|
+
CompressionStream: infer T;
|
431
|
+
} ? T
|
432
|
+
// TS 4.8, 4.9, 5.0
|
433
|
+
: typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
|
434
|
+
prototype: T;
|
435
|
+
new(format: "deflate" | "deflate-raw" | "gzip"): T;
|
436
|
+
}
|
437
|
+
: typeof import("stream/web").CompressionStream;
|
438
|
+
|
439
|
+
interface CountQueuingStrategy extends _CountQueuingStrategy {}
|
440
|
+
var CountQueuingStrategy: typeof globalThis extends { onmessage: any; CountQueuingStrategy: infer T } ? T
|
441
|
+
: typeof import("stream/web").CountQueuingStrategy;
|
442
|
+
|
443
|
+
interface DecompressionStream extends _DecompressionStream {}
|
444
|
+
var DecompressionStream: typeof globalThis extends {
|
445
|
+
onmessage: any;
|
446
|
+
// CompressionStream, DecompressionStream and ReportingObserver was introduced in the same commit.
|
447
|
+
// If ReportingObserver check is removed, the type here will form a circular reference in TS5.0+lib.dom.d.ts
|
448
|
+
ReportingObserver: any;
|
449
|
+
DecompressionStream: infer T;
|
450
|
+
} ? T
|
451
|
+
// TS 4.8, 4.9, 5.0
|
452
|
+
: typeof globalThis extends { onmessage: any; TransformStream: { prototype: infer T } } ? {
|
453
|
+
prototype: T;
|
454
|
+
new(format: "deflate" | "deflate-raw" | "gzip"): T;
|
455
|
+
}
|
456
|
+
: typeof import("stream/web").DecompressionStream;
|
457
|
+
|
458
|
+
interface ReadableByteStreamController extends _ReadableByteStreamController {}
|
459
|
+
var ReadableByteStreamController: typeof globalThis extends
|
460
|
+
{ onmessage: any; ReadableByteStreamController: infer T } ? T
|
461
|
+
: typeof import("stream/web").ReadableByteStreamController;
|
462
|
+
|
463
|
+
interface ReadableStream<R = any> extends _ReadableStream<R> {}
|
464
|
+
var ReadableStream: typeof globalThis extends { onmessage: any; ReadableStream: infer T } ? T
|
465
|
+
: typeof import("stream/web").ReadableStream;
|
466
|
+
|
467
|
+
interface ReadableStreamBYOBReader extends _ReadableStreamBYOBReader {}
|
468
|
+
var ReadableStreamBYOBReader: typeof globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T }
|
469
|
+
? T
|
470
|
+
: typeof import("stream/web").ReadableStreamBYOBReader;
|
471
|
+
|
472
|
+
interface ReadableStreamBYOBRequest extends _ReadableStreamBYOBRequest {}
|
473
|
+
var ReadableStreamBYOBRequest: typeof globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T }
|
474
|
+
? T
|
475
|
+
: typeof import("stream/web").ReadableStreamBYOBRequest;
|
476
|
+
|
477
|
+
interface ReadableStreamDefaultController<R = any> extends _ReadableStreamDefaultController<R> {}
|
478
|
+
var ReadableStreamDefaultController: typeof globalThis extends
|
479
|
+
{ onmessage: any; ReadableStreamDefaultController: infer T } ? T
|
480
|
+
: typeof import("stream/web").ReadableStreamDefaultController;
|
481
|
+
|
482
|
+
interface ReadableStreamDefaultReader<R = any> extends _ReadableStreamDefaultReader<R> {}
|
483
|
+
var ReadableStreamDefaultReader: typeof globalThis extends
|
484
|
+
{ onmessage: any; ReadableStreamDefaultReader: infer T } ? T
|
485
|
+
: typeof import("stream/web").ReadableStreamDefaultReader;
|
486
|
+
|
487
|
+
interface TextDecoderStream extends _TextDecoderStream {}
|
488
|
+
var TextDecoderStream: typeof globalThis extends { onmessage: any; TextDecoderStream: infer T } ? T
|
489
|
+
: typeof import("stream/web").TextDecoderStream;
|
490
|
+
|
491
|
+
interface TextEncoderStream extends _TextEncoderStream {}
|
492
|
+
var TextEncoderStream: typeof globalThis extends { onmessage: any; TextEncoderStream: infer T } ? T
|
493
|
+
: typeof import("stream/web").TextEncoderStream;
|
494
|
+
|
495
|
+
interface TransformStream<I = any, O = any> extends _TransformStream<I, O> {}
|
496
|
+
var TransformStream: typeof globalThis extends { onmessage: any; TransformStream: infer T } ? T
|
497
|
+
: typeof import("stream/web").TransformStream;
|
498
|
+
|
499
|
+
interface TransformStreamDefaultController<O = any> extends _TransformStreamDefaultController<O> {}
|
500
|
+
var TransformStreamDefaultController: typeof globalThis extends
|
501
|
+
{ onmessage: any; TransformStreamDefaultController: infer T } ? T
|
502
|
+
: typeof import("stream/web").TransformStreamDefaultController;
|
503
|
+
|
504
|
+
interface WritableStream<W = any> extends _WritableStream<W> {}
|
505
|
+
var WritableStream: typeof globalThis extends { onmessage: any; WritableStream: infer T } ? T
|
506
|
+
: typeof import("stream/web").WritableStream;
|
507
|
+
|
508
|
+
interface WritableStreamDefaultController extends _WritableStreamDefaultController {}
|
509
|
+
var WritableStreamDefaultController: typeof globalThis extends
|
510
|
+
{ onmessage: any; WritableStreamDefaultController: infer T } ? T
|
511
|
+
: typeof import("stream/web").WritableStreamDefaultController;
|
512
|
+
|
513
|
+
interface WritableStreamDefaultWriter<W = any> extends _WritableStreamDefaultWriter<W> {}
|
514
|
+
var WritableStreamDefaultWriter: typeof globalThis extends
|
515
|
+
{ onmessage: any; WritableStreamDefaultWriter: infer T } ? T
|
516
|
+
: typeof import("stream/web").WritableStreamDefaultWriter;
|
517
|
+
}
|
364
518
|
}
|
365
519
|
declare module "node:stream/web" {
|
366
520
|
export * from "stream/web";
|
node v20.16/test.d.ts
CHANGED
@@ -460,32 +460,36 @@ declare module "node:test" {
|
|
460
460
|
readonly assert: TestContextAssert;
|
461
461
|
/**
|
462
462
|
* This function is used to create a hook running before subtest of the current test.
|
463
|
-
* @param fn The hook function.
|
463
|
+
* @param fn The hook function. The first argument to this function is a `TestContext` object.
|
464
|
+
* If the hook uses callbacks, the callback function is passed as the second argument.
|
464
465
|
* @param options Configuration options for the hook.
|
465
|
-
* @since v20.1.0
|
466
|
+
* @since v20.1.0, v18.17.0
|
466
467
|
*/
|
467
|
-
before:
|
468
|
+
before(fn?: TestContextHookFn, options?: HookOptions): void;
|
468
469
|
/**
|
469
470
|
* This function is used to create a hook running before each subtest of the current test.
|
470
|
-
* @param fn The hook function.
|
471
|
+
* @param fn The hook function. The first argument to this function is a `TestContext` object.
|
472
|
+
* If the hook uses callbacks, the callback function is passed as the second argument.
|
471
473
|
* @param options Configuration options for the hook.
|
472
474
|
* @since v18.8.0
|
473
475
|
*/
|
474
|
-
beforeEach:
|
476
|
+
beforeEach(fn?: TestContextHookFn, options?: HookOptions): void;
|
475
477
|
/**
|
476
478
|
* This function is used to create a hook that runs after the current test finishes.
|
477
|
-
* @param fn The hook function.
|
479
|
+
* @param fn The hook function. The first argument to this function is a `TestContext` object.
|
480
|
+
* If the hook uses callbacks, the callback function is passed as the second argument.
|
478
481
|
* @param options Configuration options for the hook.
|
479
482
|
* @since v18.13.0
|
480
483
|
*/
|
481
|
-
after:
|
484
|
+
after(fn?: TestContextHookFn, options?: HookOptions): void;
|
482
485
|
/**
|
483
486
|
* This function is used to create a hook running after each subtest of the current test.
|
484
|
-
* @param fn The hook function.
|
487
|
+
* @param fn The hook function. The first argument to this function is a `TestContext` object.
|
488
|
+
* If the hook uses callbacks, the callback function is passed as the second argument.
|
485
489
|
* @param options Configuration options for the hook.
|
486
490
|
* @since v18.8.0
|
487
491
|
*/
|
488
|
-
afterEach:
|
492
|
+
afterEach(fn?: TestContextHookFn, options?: HookOptions): void;
|
489
493
|
/**
|
490
494
|
* This function is used to write diagnostics to the output. Any diagnostic
|
491
495
|
* information is included at the end of the test's results. This function does
|
@@ -826,10 +830,15 @@ declare module "node:test" {
|
|
826
830
|
*/
|
827
831
|
function afterEach(fn?: HookFn, options?: HookOptions): void;
|
828
832
|
/**
|
829
|
-
* The hook function.
|
830
|
-
* second argument.
|
833
|
+
* The hook function. The first argument is the context in which the hook is called.
|
834
|
+
* If the hook uses callbacks, the callback function is passed as the second argument.
|
831
835
|
*/
|
832
|
-
type HookFn = (
|
836
|
+
type HookFn = (c: TestContext | SuiteContext, done: (result?: any) => void) => any;
|
837
|
+
/**
|
838
|
+
* The hook function. The first argument is a `TestContext` object.
|
839
|
+
* If the hook uses callbacks, the callback function is passed as the second argument.
|
840
|
+
*/
|
841
|
+
type TestContextHookFn = (t: TestContext, done: (result?: any) => void) => any;
|
833
842
|
/**
|
834
843
|
* Configuration options for hooks.
|
835
844
|
* @since v18.8.0
|