@types/node 24.3.0 → 24.7.2
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 +1 -1
- node/assert/strict.d.ts +105 -2
- node/assert.d.ts +119 -95
- node/buffer.d.ts +1 -1
- node/child_process.d.ts +16 -10
- node/cluster.d.ts +3 -4
- node/crypto.d.ts +699 -179
- node/dns.d.ts +6 -1
- node/events.d.ts +80 -34
- node/fs/promises.d.ts +22 -0
- node/fs.d.ts +272 -11
- node/globals.d.ts +149 -346
- node/http.d.ts +71 -13
- node/http2.d.ts +5 -4
- node/https.d.ts +14 -12
- node/index.d.ts +9 -2
- node/inspector.d.ts +205 -4139
- node/inspector.generated.d.ts +4233 -0
- node/module.d.ts +1 -0
- node/net.d.ts +26 -5
- node/os.d.ts +13 -3
- node/package.json +3 -3
- node/perf_hooks.d.ts +6 -8
- node/process.d.ts +7 -19
- node/readline/promises.d.ts +1 -1
- node/sqlite.d.ts +40 -4
- node/stream/web.d.ts +6 -55
- node/stream.d.ts +29 -22
- node/test.d.ts +31 -26
- node/tls.d.ts +34 -2
- node/ts5.6/index.d.ts +9 -2
- node/ts5.7/index.d.ts +9 -2
- node/url.d.ts +14 -6
- node/util.d.ts +11 -4
- node/v8.d.ts +2 -2
- node/vm.d.ts +91 -58
- node/wasi.d.ts +21 -0
- node/web-globals/abortcontroller.d.ts +34 -0
- node/web-globals/crypto.d.ts +32 -0
- node/web-globals/domexception.d.ts +68 -0
- node/{dom-events.d.ts → web-globals/events.d.ts} +49 -51
- node/web-globals/fetch.d.ts +50 -0
- node/web-globals/navigator.d.ts +25 -0
- node/web-globals/storage.d.ts +24 -0
- node/web-globals/streams.d.ts +22 -0
- node/worker_threads.d.ts +84 -50
- node/zlib.d.ts +6 -0
node/globals.d.ts
CHANGED
|
@@ -1,367 +1,170 @@
|
|
|
1
|
-
|
|
1
|
+
declare var global: typeof globalThis;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Will either be empty if lib.dom (or lib.webworker) is included, or the undici version otherwise.
|
|
6
|
-
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
|
|
7
|
-
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
|
|
8
|
-
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
|
|
9
|
-
type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers;
|
|
10
|
-
type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").MessageEvent;
|
|
11
|
-
type _RequestInit = typeof globalThis extends { onmessage: any } ? {}
|
|
12
|
-
: import("undici-types").RequestInit;
|
|
13
|
-
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
|
|
14
|
-
: import("undici-types").ResponseInit;
|
|
15
|
-
type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").WebSocket;
|
|
16
|
-
type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource;
|
|
17
|
-
type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").CloseEvent;
|
|
18
|
-
// #endregion Fetch and friends
|
|
19
|
-
|
|
20
|
-
// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
|
|
21
|
-
type _Storage = typeof globalThis extends { onabort: any } ? {} : {
|
|
22
|
-
readonly length: number;
|
|
23
|
-
clear(): void;
|
|
24
|
-
getItem(key: string): string | null;
|
|
25
|
-
key(index: number): string | null;
|
|
26
|
-
removeItem(key: string): void;
|
|
27
|
-
setItem(key: string, value: string): void;
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// #region DOMException
|
|
32
|
-
type _DOMException = typeof globalThis extends { onmessage: any } ? {} : NodeDOMException;
|
|
33
|
-
interface NodeDOMException extends Error {
|
|
34
|
-
readonly code: number;
|
|
35
|
-
readonly message: string;
|
|
36
|
-
readonly name: string;
|
|
37
|
-
readonly INDEX_SIZE_ERR: 1;
|
|
38
|
-
readonly DOMSTRING_SIZE_ERR: 2;
|
|
39
|
-
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
40
|
-
readonly WRONG_DOCUMENT_ERR: 4;
|
|
41
|
-
readonly INVALID_CHARACTER_ERR: 5;
|
|
42
|
-
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
43
|
-
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
44
|
-
readonly NOT_FOUND_ERR: 8;
|
|
45
|
-
readonly NOT_SUPPORTED_ERR: 9;
|
|
46
|
-
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
47
|
-
readonly INVALID_STATE_ERR: 11;
|
|
48
|
-
readonly SYNTAX_ERR: 12;
|
|
49
|
-
readonly INVALID_MODIFICATION_ERR: 13;
|
|
50
|
-
readonly NAMESPACE_ERR: 14;
|
|
51
|
-
readonly INVALID_ACCESS_ERR: 15;
|
|
52
|
-
readonly VALIDATION_ERR: 16;
|
|
53
|
-
readonly TYPE_MISMATCH_ERR: 17;
|
|
54
|
-
readonly SECURITY_ERR: 18;
|
|
55
|
-
readonly NETWORK_ERR: 19;
|
|
56
|
-
readonly ABORT_ERR: 20;
|
|
57
|
-
readonly URL_MISMATCH_ERR: 21;
|
|
58
|
-
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
59
|
-
readonly TIMEOUT_ERR: 23;
|
|
60
|
-
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
61
|
-
readonly DATA_CLONE_ERR: 25;
|
|
62
|
-
}
|
|
63
|
-
interface NodeDOMExceptionConstructor {
|
|
64
|
-
prototype: DOMException;
|
|
65
|
-
new(message?: string, nameOrOptions?: string | { name?: string; cause?: unknown }): DOMException;
|
|
66
|
-
readonly INDEX_SIZE_ERR: 1;
|
|
67
|
-
readonly DOMSTRING_SIZE_ERR: 2;
|
|
68
|
-
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
69
|
-
readonly WRONG_DOCUMENT_ERR: 4;
|
|
70
|
-
readonly INVALID_CHARACTER_ERR: 5;
|
|
71
|
-
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
72
|
-
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
73
|
-
readonly NOT_FOUND_ERR: 8;
|
|
74
|
-
readonly NOT_SUPPORTED_ERR: 9;
|
|
75
|
-
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
76
|
-
readonly INVALID_STATE_ERR: 11;
|
|
77
|
-
readonly SYNTAX_ERR: 12;
|
|
78
|
-
readonly INVALID_MODIFICATION_ERR: 13;
|
|
79
|
-
readonly NAMESPACE_ERR: 14;
|
|
80
|
-
readonly INVALID_ACCESS_ERR: 15;
|
|
81
|
-
readonly VALIDATION_ERR: 16;
|
|
82
|
-
readonly TYPE_MISMATCH_ERR: 17;
|
|
83
|
-
readonly SECURITY_ERR: 18;
|
|
84
|
-
readonly NETWORK_ERR: 19;
|
|
85
|
-
readonly ABORT_ERR: 20;
|
|
86
|
-
readonly URL_MISMATCH_ERR: 21;
|
|
87
|
-
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
88
|
-
readonly TIMEOUT_ERR: 23;
|
|
89
|
-
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
90
|
-
readonly DATA_CLONE_ERR: 25;
|
|
91
|
-
}
|
|
92
|
-
// #endregion DOMException
|
|
93
|
-
|
|
94
|
-
declare global {
|
|
95
|
-
var global: typeof globalThis;
|
|
96
|
-
|
|
97
|
-
var process: NodeJS.Process;
|
|
98
|
-
var console: Console;
|
|
99
|
-
|
|
100
|
-
interface ErrorConstructor {
|
|
101
|
-
/**
|
|
102
|
-
* Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
103
|
-
* a string representing the location in the code at which
|
|
104
|
-
* `Error.captureStackTrace()` was called.
|
|
105
|
-
*
|
|
106
|
-
* ```js
|
|
107
|
-
* const myObject = {};
|
|
108
|
-
* Error.captureStackTrace(myObject);
|
|
109
|
-
* myObject.stack; // Similar to `new Error().stack`
|
|
110
|
-
* ```
|
|
111
|
-
*
|
|
112
|
-
* The first line of the trace will be prefixed with
|
|
113
|
-
* `${myObject.name}: ${myObject.message}`.
|
|
114
|
-
*
|
|
115
|
-
* The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
116
|
-
* above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
117
|
-
* generated stack trace.
|
|
118
|
-
*
|
|
119
|
-
* The `constructorOpt` argument is useful for hiding implementation
|
|
120
|
-
* details of error generation from the user. For instance:
|
|
121
|
-
*
|
|
122
|
-
* ```js
|
|
123
|
-
* function a() {
|
|
124
|
-
* b();
|
|
125
|
-
* }
|
|
126
|
-
*
|
|
127
|
-
* function b() {
|
|
128
|
-
* c();
|
|
129
|
-
* }
|
|
130
|
-
*
|
|
131
|
-
* function c() {
|
|
132
|
-
* // Create an error without stack trace to avoid calculating the stack trace twice.
|
|
133
|
-
* const { stackTraceLimit } = Error;
|
|
134
|
-
* Error.stackTraceLimit = 0;
|
|
135
|
-
* const error = new Error();
|
|
136
|
-
* Error.stackTraceLimit = stackTraceLimit;
|
|
137
|
-
*
|
|
138
|
-
* // Capture the stack trace above function b
|
|
139
|
-
* Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
140
|
-
* throw error;
|
|
141
|
-
* }
|
|
142
|
-
*
|
|
143
|
-
* a();
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
147
|
-
/**
|
|
148
|
-
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
149
|
-
*/
|
|
150
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
151
|
-
/**
|
|
152
|
-
* The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
153
|
-
* collected by a stack trace (whether generated by `new Error().stack` or
|
|
154
|
-
* `Error.captureStackTrace(obj)`).
|
|
155
|
-
*
|
|
156
|
-
* The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
157
|
-
* will affect any stack trace captured _after_ the value has been changed.
|
|
158
|
-
*
|
|
159
|
-
* If set to a non-number value, or set to a negative number, stack traces will
|
|
160
|
-
* not capture any frames.
|
|
161
|
-
*/
|
|
162
|
-
stackTraceLimit: number;
|
|
163
|
-
}
|
|
3
|
+
declare var process: NodeJS.Process;
|
|
4
|
+
declare var console: Console;
|
|
164
5
|
|
|
6
|
+
interface ErrorConstructor {
|
|
165
7
|
/**
|
|
166
|
-
*
|
|
8
|
+
* Creates a `.stack` property on `targetObject`, which when accessed returns
|
|
9
|
+
* a string representing the location in the code at which
|
|
10
|
+
* `Error.captureStackTrace()` was called.
|
|
11
|
+
*
|
|
12
|
+
* ```js
|
|
13
|
+
* const myObject = {};
|
|
14
|
+
* Error.captureStackTrace(myObject);
|
|
15
|
+
* myObject.stack; // Similar to `new Error().stack`
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The first line of the trace will be prefixed with
|
|
19
|
+
* `${myObject.name}: ${myObject.message}`.
|
|
20
|
+
*
|
|
21
|
+
* The optional `constructorOpt` argument accepts a function. If given, all frames
|
|
22
|
+
* above `constructorOpt`, including `constructorOpt`, will be omitted from the
|
|
23
|
+
* generated stack trace.
|
|
24
|
+
*
|
|
25
|
+
* The `constructorOpt` argument is useful for hiding implementation
|
|
26
|
+
* details of error generation from the user. For instance:
|
|
27
|
+
*
|
|
28
|
+
* ```js
|
|
29
|
+
* function a() {
|
|
30
|
+
* b();
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* function b() {
|
|
34
|
+
* c();
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* function c() {
|
|
38
|
+
* // Create an error without stack trace to avoid calculating the stack trace twice.
|
|
39
|
+
* const { stackTraceLimit } = Error;
|
|
40
|
+
* Error.stackTraceLimit = 0;
|
|
41
|
+
* const error = new Error();
|
|
42
|
+
* Error.stackTraceLimit = stackTraceLimit;
|
|
43
|
+
*
|
|
44
|
+
* // Capture the stack trace above function b
|
|
45
|
+
* Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
|
|
46
|
+
* throw error;
|
|
47
|
+
* }
|
|
48
|
+
*
|
|
49
|
+
* a();
|
|
50
|
+
* ```
|
|
167
51
|
*/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
getTypeName(): string | null;
|
|
187
|
-
isAsync(): boolean;
|
|
188
|
-
isConstructor(): boolean;
|
|
189
|
-
isEval(): boolean;
|
|
190
|
-
isNative(): boolean;
|
|
191
|
-
isPromiseAll(): boolean;
|
|
192
|
-
isToplevel(): boolean;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
interface ErrnoException extends Error {
|
|
196
|
-
errno?: number | undefined;
|
|
197
|
-
code?: string | undefined;
|
|
198
|
-
path?: string | undefined;
|
|
199
|
-
syscall?: string | undefined;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
interface ReadableStream extends EventEmitter {
|
|
203
|
-
readable: boolean;
|
|
204
|
-
read(size?: number): string | Buffer;
|
|
205
|
-
setEncoding(encoding: BufferEncoding): this;
|
|
206
|
-
pause(): this;
|
|
207
|
-
resume(): this;
|
|
208
|
-
isPaused(): boolean;
|
|
209
|
-
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
|
210
|
-
unpipe(destination?: WritableStream): this;
|
|
211
|
-
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
212
|
-
wrap(oldStream: ReadableStream): this;
|
|
213
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
interface WritableStream extends EventEmitter {
|
|
217
|
-
writable: boolean;
|
|
218
|
-
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
|
219
|
-
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
|
220
|
-
end(cb?: () => void): this;
|
|
221
|
-
end(data: string | Uint8Array, cb?: () => void): this;
|
|
222
|
-
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
|
226
|
-
|
|
227
|
-
interface RefCounted {
|
|
228
|
-
ref(): this;
|
|
229
|
-
unref(): this;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
interface Dict<T> {
|
|
233
|
-
[key: string]: T | undefined;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
interface ReadOnlyDict<T> {
|
|
237
|
-
readonly [key: string]: T | undefined;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
interface GCFunction {
|
|
241
|
-
(minor?: boolean): void;
|
|
242
|
-
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
|
|
243
|
-
(options: NodeJS.GCOptions): void;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
interface GCOptions {
|
|
247
|
-
execution?: "sync" | "async" | undefined;
|
|
248
|
-
flavor?: "regular" | "last-resort" | undefined;
|
|
249
|
-
type?: "major-snapshot" | "major" | "minor" | undefined;
|
|
250
|
-
filename?: string | undefined;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/** An iterable iterator returned by the Node.js API. */
|
|
254
|
-
interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
|
255
|
-
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
|
256
|
-
}
|
|
52
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
53
|
+
/**
|
|
54
|
+
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
55
|
+
*/
|
|
56
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
57
|
+
/**
|
|
58
|
+
* The `Error.stackTraceLimit` property specifies the number of stack frames
|
|
59
|
+
* collected by a stack trace (whether generated by `new Error().stack` or
|
|
60
|
+
* `Error.captureStackTrace(obj)`).
|
|
61
|
+
*
|
|
62
|
+
* The default value is `10` but may be set to any valid JavaScript number. Changes
|
|
63
|
+
* will affect any stack trace captured _after_ the value has been changed.
|
|
64
|
+
*
|
|
65
|
+
* If set to a non-number value, or set to a negative number, stack traces will
|
|
66
|
+
* not capture any frames.
|
|
67
|
+
*/
|
|
68
|
+
stackTraceLimit: number;
|
|
69
|
+
}
|
|
257
70
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Enable this API with the `--expose-gc` CLI flag.
|
|
73
|
+
*/
|
|
74
|
+
declare var gc: NodeJS.GCFunction | undefined;
|
|
75
|
+
|
|
76
|
+
declare namespace NodeJS {
|
|
77
|
+
interface CallSite {
|
|
78
|
+
getColumnNumber(): number | null;
|
|
79
|
+
getEnclosingColumnNumber(): number | null;
|
|
80
|
+
getEnclosingLineNumber(): number | null;
|
|
81
|
+
getEvalOrigin(): string | undefined;
|
|
82
|
+
getFileName(): string | null;
|
|
83
|
+
getFunction(): Function | undefined;
|
|
84
|
+
getFunctionName(): string | null;
|
|
85
|
+
getLineNumber(): number | null;
|
|
86
|
+
getMethodName(): string | null;
|
|
87
|
+
getPosition(): number;
|
|
88
|
+
getPromiseIndex(): number | null;
|
|
89
|
+
getScriptHash(): string;
|
|
90
|
+
getScriptNameOrSourceURL(): string | null;
|
|
91
|
+
getThis(): unknown;
|
|
92
|
+
getTypeName(): string | null;
|
|
93
|
+
isAsync(): boolean;
|
|
94
|
+
isConstructor(): boolean;
|
|
95
|
+
isEval(): boolean;
|
|
96
|
+
isNative(): boolean;
|
|
97
|
+
isPromiseAll(): boolean;
|
|
98
|
+
isToplevel(): boolean;
|
|
262
99
|
}
|
|
263
100
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
// #region AbortController
|
|
271
|
-
interface AbortController {
|
|
272
|
-
readonly signal: AbortSignal;
|
|
273
|
-
abort(reason?: any): void;
|
|
101
|
+
interface ErrnoException extends Error {
|
|
102
|
+
errno?: number | undefined;
|
|
103
|
+
code?: string | undefined;
|
|
104
|
+
path?: string | undefined;
|
|
105
|
+
syscall?: string | undefined;
|
|
274
106
|
}
|
|
275
|
-
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
|
276
|
-
: {
|
|
277
|
-
prototype: AbortController;
|
|
278
|
-
new(): AbortController;
|
|
279
|
-
};
|
|
280
107
|
|
|
281
|
-
interface
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
108
|
+
interface ReadableStream extends EventEmitter {
|
|
109
|
+
readable: boolean;
|
|
110
|
+
read(size?: number): string | Buffer;
|
|
111
|
+
setEncoding(encoding: BufferEncoding): this;
|
|
112
|
+
pause(): this;
|
|
113
|
+
resume(): this;
|
|
114
|
+
isPaused(): boolean;
|
|
115
|
+
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
|
116
|
+
unpipe(destination?: WritableStream): this;
|
|
117
|
+
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
118
|
+
wrap(oldStream: ReadableStream): this;
|
|
119
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
|
286
120
|
}
|
|
287
|
-
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
|
288
|
-
: {
|
|
289
|
-
prototype: AbortSignal;
|
|
290
|
-
new(): AbortSignal;
|
|
291
|
-
abort(reason?: any): AbortSignal;
|
|
292
|
-
any(signals: AbortSignal[]): AbortSignal;
|
|
293
|
-
timeout(milliseconds: number): AbortSignal;
|
|
294
|
-
};
|
|
295
|
-
// #endregion AbortController
|
|
296
|
-
|
|
297
|
-
// #region Storage
|
|
298
|
-
interface Storage extends _Storage {}
|
|
299
|
-
// Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
|
|
300
|
-
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
|
|
301
|
-
: {
|
|
302
|
-
prototype: Storage;
|
|
303
|
-
new(): Storage;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
var localStorage: Storage;
|
|
307
|
-
var sessionStorage: Storage;
|
|
308
|
-
// #endregion Storage
|
|
309
121
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
122
|
+
interface WritableStream extends EventEmitter {
|
|
123
|
+
writable: boolean;
|
|
124
|
+
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
|
125
|
+
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
|
126
|
+
end(cb?: () => void): this;
|
|
127
|
+
end(data: string | Uint8Array, cb?: () => void): this;
|
|
128
|
+
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
|
129
|
+
}
|
|
317
130
|
|
|
318
|
-
interface
|
|
319
|
-
var Request: typeof globalThis extends {
|
|
320
|
-
onmessage: any;
|
|
321
|
-
Request: infer T;
|
|
322
|
-
} ? T
|
|
323
|
-
: typeof import("undici-types").Request;
|
|
131
|
+
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
|
324
132
|
|
|
325
|
-
interface
|
|
133
|
+
interface RefCounted {
|
|
134
|
+
ref(): this;
|
|
135
|
+
unref(): this;
|
|
136
|
+
}
|
|
326
137
|
|
|
327
|
-
interface
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
Response: infer T;
|
|
331
|
-
} ? T
|
|
332
|
-
: typeof import("undici-types").Response;
|
|
138
|
+
interface Dict<T> {
|
|
139
|
+
[key: string]: T | undefined;
|
|
140
|
+
}
|
|
333
141
|
|
|
334
|
-
interface
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
FormData: infer T;
|
|
338
|
-
} ? T
|
|
339
|
-
: typeof import("undici-types").FormData;
|
|
142
|
+
interface ReadOnlyDict<T> {
|
|
143
|
+
readonly [key: string]: T | undefined;
|
|
144
|
+
}
|
|
340
145
|
|
|
341
|
-
|
|
342
|
-
var Headers: typeof globalThis extends {
|
|
343
|
-
onmessage: any;
|
|
344
|
-
Headers: infer T;
|
|
345
|
-
} ? T
|
|
346
|
-
: typeof import("undici-types").Headers;
|
|
146
|
+
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
|
|
347
147
|
|
|
348
|
-
interface
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
: typeof import("undici-types").MessageEvent;
|
|
148
|
+
interface GCFunction {
|
|
149
|
+
(minor?: boolean): void;
|
|
150
|
+
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;
|
|
151
|
+
(options: NodeJS.GCOptions): void;
|
|
152
|
+
}
|
|
354
153
|
|
|
355
|
-
interface
|
|
356
|
-
|
|
357
|
-
|
|
154
|
+
interface GCOptions {
|
|
155
|
+
execution?: "sync" | "async" | undefined;
|
|
156
|
+
flavor?: "regular" | "last-resort" | undefined;
|
|
157
|
+
type?: "major-snapshot" | "major" | "minor" | undefined;
|
|
158
|
+
filename?: string | undefined;
|
|
159
|
+
}
|
|
358
160
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
:
|
|
161
|
+
/** An iterable iterator returned by the Node.js API. */
|
|
162
|
+
interface Iterator<T, TReturn = undefined, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
|
163
|
+
[Symbol.iterator](): NodeJS.Iterator<T, TReturn, TNext>;
|
|
164
|
+
}
|
|
362
165
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
:
|
|
366
|
-
|
|
166
|
+
/** An async iterable iterator returned by the Node.js API. */
|
|
167
|
+
interface AsyncIterator<T, TReturn = undefined, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
|
168
|
+
[Symbol.asyncIterator](): NodeJS.AsyncIterator<T, TReturn, TNext>;
|
|
169
|
+
}
|
|
367
170
|
}
|