@types/node 20.16.2 → 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/package.json +2 -2
- node v20.16/stream/web.d.ts +177 -23
- node v20.16/test.d.ts +21 -12
node v20.16/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/v20.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Sun, 01 Sep 2024 12:10:27 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node v20.16/buffer.d.ts
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
// If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types.
|
2
|
+
// Otherwise, use the types from node.
|
3
|
+
type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob;
|
4
|
+
type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File;
|
5
|
+
|
1
6
|
/**
|
2
7
|
* `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
|
3
8
|
* Node.js APIs support `Buffer`s.
|
@@ -233,10 +238,7 @@ declare module "buffer" {
|
|
233
238
|
}
|
234
239
|
export import atob = globalThis.atob;
|
235
240
|
export import btoa = globalThis.btoa;
|
236
|
-
|
237
|
-
// This conditional type will be the existing global Blob in a browser, or
|
238
|
-
// the copy below in a Node environment.
|
239
|
-
type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
|
241
|
+
|
240
242
|
global {
|
241
243
|
namespace NodeJS {
|
242
244
|
export { BufferEncoding };
|
@@ -2276,17 +2278,22 @@ declare module "buffer" {
|
|
2276
2278
|
* @param data An ASCII (Latin1) string.
|
2277
2279
|
*/
|
2278
2280
|
function btoa(data: string): string;
|
2279
|
-
interface Blob extends
|
2281
|
+
interface Blob extends _Blob {}
|
2280
2282
|
/**
|
2281
2283
|
* `Blob` class is a global reference for `require('node:buffer').Blob`
|
2282
2284
|
* https://nodejs.org/api/buffer.html#class-blob
|
2283
2285
|
* @since v18.0.0
|
2284
2286
|
*/
|
2285
|
-
var Blob: typeof globalThis extends {
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
|
2287
|
+
var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T
|
2288
|
+
: typeof import("buffer").Blob;
|
2289
|
+
interface File extends _File {}
|
2290
|
+
/**
|
2291
|
+
* `File` class is a global reference for `require('node:buffer').File`
|
2292
|
+
* https://nodejs.org/api/buffer.html#class-file
|
2293
|
+
* @since v20.0.0
|
2294
|
+
*/
|
2295
|
+
var File: typeof globalThis extends { onmessage: any; File: infer T } ? T
|
2296
|
+
: typeof import("buffer").File;
|
2290
2297
|
}
|
2291
2298
|
}
|
2292
2299
|
declare module "node:buffer" {
|
node v20.16/globals.d.ts
CHANGED
@@ -7,13 +7,83 @@ type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undi
|
|
7
7
|
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
|
8
8
|
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
|
9
9
|
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
|
10
|
+
type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent;
|
10
11
|
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
|
11
12
|
: import("undici-types").RequestInit;
|
12
13
|
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
|
13
14
|
: import("undici-types").ResponseInit;
|
14
|
-
type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File;
|
15
15
|
// #endregion Fetch and friends
|
16
16
|
|
17
|
+
// #region DOMException
|
18
|
+
type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
|
19
|
+
interface NodeDOMException extends Error {
|
20
|
+
/**
|
21
|
+
* @deprecated
|
22
|
+
*
|
23
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
24
|
+
*/
|
25
|
+
readonly code: number;
|
26
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
|
27
|
+
readonly message: string;
|
28
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
|
29
|
+
readonly name: string;
|
30
|
+
readonly INDEX_SIZE_ERR: 1;
|
31
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
32
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
33
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
34
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
35
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
36
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
37
|
+
readonly NOT_FOUND_ERR: 8;
|
38
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
39
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
40
|
+
readonly INVALID_STATE_ERR: 11;
|
41
|
+
readonly SYNTAX_ERR: 12;
|
42
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
43
|
+
readonly NAMESPACE_ERR: 14;
|
44
|
+
readonly INVALID_ACCESS_ERR: 15;
|
45
|
+
readonly VALIDATION_ERR: 16;
|
46
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
47
|
+
readonly SECURITY_ERR: 18;
|
48
|
+
readonly NETWORK_ERR: 19;
|
49
|
+
readonly ABORT_ERR: 20;
|
50
|
+
readonly URL_MISMATCH_ERR: 21;
|
51
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
52
|
+
readonly TIMEOUT_ERR: 23;
|
53
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
54
|
+
readonly DATA_CLONE_ERR: 25;
|
55
|
+
}
|
56
|
+
interface NodeDOMExceptionConstructor {
|
57
|
+
prototype: DOMException;
|
58
|
+
new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException;
|
59
|
+
readonly INDEX_SIZE_ERR: 1;
|
60
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
61
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
62
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
63
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
64
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
65
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
66
|
+
readonly NOT_FOUND_ERR: 8;
|
67
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
68
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
69
|
+
readonly INVALID_STATE_ERR: 11;
|
70
|
+
readonly SYNTAX_ERR: 12;
|
71
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
72
|
+
readonly NAMESPACE_ERR: 14;
|
73
|
+
readonly INVALID_ACCESS_ERR: 15;
|
74
|
+
readonly VALIDATION_ERR: 16;
|
75
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
76
|
+
readonly SECURITY_ERR: 18;
|
77
|
+
readonly NETWORK_ERR: 19;
|
78
|
+
readonly ABORT_ERR: 20;
|
79
|
+
readonly URL_MISMATCH_ERR: 21;
|
80
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
81
|
+
readonly TIMEOUT_ERR: 23;
|
82
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
83
|
+
readonly DATA_CLONE_ERR: 25;
|
84
|
+
}
|
85
|
+
// #endregion DOMException
|
86
|
+
|
17
87
|
declare global {
|
18
88
|
// Declare "static" methods in Error
|
19
89
|
interface ErrorConstructor {
|
@@ -157,6 +227,24 @@ declare global {
|
|
157
227
|
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
158
228
|
): T;
|
159
229
|
|
230
|
+
// #region DOMException
|
231
|
+
/**
|
232
|
+
* @since v17.0.0
|
233
|
+
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
234
|
+
*
|
235
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
236
|
+
*/
|
237
|
+
interface DOMException extends _DOMException {}
|
238
|
+
|
239
|
+
/**
|
240
|
+
* @since v17.0.0
|
241
|
+
*
|
242
|
+
* The WHATWG `DOMException` class. See [DOMException](https://developer.mozilla.org/docs/Web/API/DOMException) for more details.
|
243
|
+
*/
|
244
|
+
var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
|
245
|
+
: NodeDOMExceptionConstructor;
|
246
|
+
// #endregion DOMException
|
247
|
+
|
160
248
|
/*----------------------------------------------*
|
161
249
|
* *
|
162
250
|
* GLOBAL INTERFACES *
|
@@ -403,10 +491,13 @@ declare global {
|
|
403
491
|
} ? T
|
404
492
|
: typeof import("undici-types").Headers;
|
405
493
|
|
406
|
-
interface
|
407
|
-
|
494
|
+
interface MessageEvent extends _MessageEvent {}
|
495
|
+
/**
|
496
|
+
* @since v15.0.0
|
497
|
+
*/
|
498
|
+
var MessageEvent: typeof globalThis extends {
|
408
499
|
onmessage: any;
|
409
|
-
|
500
|
+
MessageEvent: infer T;
|
410
501
|
} ? T
|
411
|
-
: typeof import("
|
502
|
+
: typeof import("undici-types").MessageEvent;
|
412
503
|
}
|
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/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
|