@types/node 20.10.1 → 20.10.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/globals.d.ts +346 -342
- node/package.json +2 -2
- node/ts4.8/globals.d.ts +346 -342
node/globals.d.ts
CHANGED
|
@@ -1,381 +1,385 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export {}; // Make this a module
|
|
2
|
+
|
|
3
|
+
// #region Fetch and friends
|
|
4
|
+
// Conditional type aliases, used at the end of this file.
|
|
5
|
+
// Will either be empty if lib-dom 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 _RequestInit = typeof globalThis extends { onmessage: any } ? {}
|
|
11
|
+
: import("undici-types").RequestInit;
|
|
12
|
+
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {}
|
|
13
|
+
: import("undici-types").ResponseInit;
|
|
14
|
+
type _File = typeof globalThis extends { onmessage: any } ? {} : import("node:buffer").File;
|
|
15
|
+
// #endregion Fetch and friends
|
|
16
|
+
|
|
17
|
+
declare global {
|
|
18
|
+
// Declare "static" methods in Error
|
|
19
|
+
interface ErrorConstructor {
|
|
20
|
+
/** Create .stack property on a target object */
|
|
21
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
5
22
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
stackTraceLimit: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/*-----------------------------------------------*
|
|
17
|
-
* *
|
|
18
|
-
* GLOBAL *
|
|
19
|
-
* *
|
|
20
|
-
------------------------------------------------*/
|
|
21
|
-
|
|
22
|
-
// For backwards compability
|
|
23
|
-
interface NodeRequire extends NodeJS.Require {}
|
|
24
|
-
interface RequireResolve extends NodeJS.RequireResolve {}
|
|
25
|
-
interface NodeModule extends NodeJS.Module {}
|
|
26
|
-
|
|
27
|
-
declare var process: NodeJS.Process;
|
|
28
|
-
declare var console: Console;
|
|
29
|
-
|
|
30
|
-
declare var __filename: string;
|
|
31
|
-
declare var __dirname: string;
|
|
32
|
-
|
|
33
|
-
declare var require: NodeRequire;
|
|
34
|
-
declare var module: NodeModule;
|
|
35
|
-
|
|
36
|
-
// Same as module.exports
|
|
37
|
-
declare var exports: any;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Only available if `--expose-gc` is passed to the process.
|
|
41
|
-
*/
|
|
42
|
-
declare var gc: undefined | (() => void);
|
|
23
|
+
/**
|
|
24
|
+
* Optional override for formatting stack traces
|
|
25
|
+
*
|
|
26
|
+
* @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
27
|
+
*/
|
|
28
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
43
29
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
|
47
|
-
interface AbortController {
|
|
48
|
-
/**
|
|
49
|
-
* Returns the AbortSignal object associated with this object.
|
|
50
|
-
*/
|
|
30
|
+
stackTraceLimit: number;
|
|
31
|
+
}
|
|
51
32
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
33
|
+
/*-----------------------------------------------*
|
|
34
|
+
* *
|
|
35
|
+
* GLOBAL *
|
|
36
|
+
* *
|
|
37
|
+
------------------------------------------------*/
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
interface
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*/
|
|
64
|
-
readonly aborted: boolean;
|
|
65
|
-
readonly reason: any;
|
|
66
|
-
onabort: null | ((this: AbortSignal, event: Event) => any);
|
|
67
|
-
throwIfAborted(): void;
|
|
68
|
-
}
|
|
39
|
+
// For backwards compability
|
|
40
|
+
interface NodeRequire extends NodeJS.Require {}
|
|
41
|
+
interface RequireResolve extends NodeJS.RequireResolve {}
|
|
42
|
+
interface NodeModule extends NodeJS.Module {}
|
|
69
43
|
|
|
70
|
-
|
|
71
|
-
:
|
|
72
|
-
prototype: AbortController;
|
|
73
|
-
new(): AbortController;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
declare var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
|
77
|
-
: {
|
|
78
|
-
prototype: AbortSignal;
|
|
79
|
-
new(): AbortSignal;
|
|
80
|
-
abort(reason?: any): AbortSignal;
|
|
81
|
-
timeout(milliseconds: number): AbortSignal;
|
|
82
|
-
};
|
|
83
|
-
// #endregion borrowed
|
|
84
|
-
|
|
85
|
-
// #region Disposable
|
|
86
|
-
interface SymbolConstructor {
|
|
87
|
-
/**
|
|
88
|
-
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
|
89
|
-
*/
|
|
90
|
-
readonly dispose: unique symbol;
|
|
44
|
+
var process: NodeJS.Process;
|
|
45
|
+
var console: Console;
|
|
91
46
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
*/
|
|
95
|
-
readonly asyncDispose: unique symbol;
|
|
96
|
-
}
|
|
47
|
+
var __filename: string;
|
|
48
|
+
var __dirname: string;
|
|
97
49
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
50
|
+
var require: NodeRequire;
|
|
51
|
+
var module: NodeModule;
|
|
101
52
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
// #endregion Disposable
|
|
53
|
+
// Same as module.exports
|
|
54
|
+
var exports: any;
|
|
106
55
|
|
|
107
|
-
// #region ArrayLike.at()
|
|
108
|
-
interface RelativeIndexable<T> {
|
|
109
56
|
/**
|
|
110
|
-
*
|
|
111
|
-
* allowing for positive and negative integers.
|
|
112
|
-
* Negative integers count back from the last item in the array.
|
|
57
|
+
* Only available if `--expose-gc` is passed to the process.
|
|
113
58
|
*/
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
interface String extends RelativeIndexable<string> {}
|
|
117
|
-
interface Array<T> extends RelativeIndexable<T> {}
|
|
118
|
-
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
119
|
-
interface Int8Array extends RelativeIndexable<number> {}
|
|
120
|
-
interface Uint8Array extends RelativeIndexable<number> {}
|
|
121
|
-
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
122
|
-
interface Int16Array extends RelativeIndexable<number> {}
|
|
123
|
-
interface Uint16Array extends RelativeIndexable<number> {}
|
|
124
|
-
interface Int32Array extends RelativeIndexable<number> {}
|
|
125
|
-
interface Uint32Array extends RelativeIndexable<number> {}
|
|
126
|
-
interface Float32Array extends RelativeIndexable<number> {}
|
|
127
|
-
interface Float64Array extends RelativeIndexable<number> {}
|
|
128
|
-
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
129
|
-
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
130
|
-
// #endregion ArrayLike.at() end
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @since v17.0.0
|
|
134
|
-
*
|
|
135
|
-
* Creates a deep clone of an object.
|
|
136
|
-
*/
|
|
137
|
-
declare function structuredClone<T>(
|
|
138
|
-
value: T,
|
|
139
|
-
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
|
140
|
-
): T;
|
|
141
|
-
|
|
142
|
-
/*----------------------------------------------*
|
|
143
|
-
* *
|
|
144
|
-
* GLOBAL INTERFACES *
|
|
145
|
-
* *
|
|
146
|
-
*-----------------------------------------------*/
|
|
147
|
-
declare namespace NodeJS {
|
|
148
|
-
interface CallSite {
|
|
149
|
-
/**
|
|
150
|
-
* Value of "this"
|
|
151
|
-
*/
|
|
152
|
-
getThis(): unknown;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Type of "this" as a string.
|
|
156
|
-
* This is the name of the function stored in the constructor field of
|
|
157
|
-
* "this", if available. Otherwise the object's [[Class]] internal
|
|
158
|
-
* property.
|
|
159
|
-
*/
|
|
160
|
-
getTypeName(): string | null;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Current function
|
|
164
|
-
*/
|
|
165
|
-
getFunction(): Function | undefined;
|
|
59
|
+
var gc: undefined | (() => void);
|
|
166
60
|
|
|
61
|
+
// #region borrowed
|
|
62
|
+
// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
|
|
63
|
+
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
|
64
|
+
interface AbortController {
|
|
167
65
|
/**
|
|
168
|
-
*
|
|
169
|
-
* If a name property is not available an attempt will be made to try
|
|
170
|
-
* to infer a name from the function's context.
|
|
66
|
+
* Returns the AbortSignal object associated with this object.
|
|
171
67
|
*/
|
|
172
|
-
getFunctionName(): string | null;
|
|
173
68
|
|
|
69
|
+
readonly signal: AbortSignal;
|
|
174
70
|
/**
|
|
175
|
-
*
|
|
176
|
-
* the current function
|
|
71
|
+
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
177
72
|
*/
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Name of the script [if this function was defined in a script]
|
|
182
|
-
*/
|
|
183
|
-
getFileName(): string | undefined;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Current line number [if this function was defined in a script]
|
|
187
|
-
*/
|
|
188
|
-
getLineNumber(): number | null;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Current column number [if this function was defined in a script]
|
|
192
|
-
*/
|
|
193
|
-
getColumnNumber(): number | null;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* A call site object representing the location where eval was called
|
|
197
|
-
* [if this function was created using a call to eval]
|
|
198
|
-
*/
|
|
199
|
-
getEvalOrigin(): string | undefined;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Is this a toplevel invocation, that is, is "this" the global object?
|
|
203
|
-
*/
|
|
204
|
-
isToplevel(): boolean;
|
|
73
|
+
abort(reason?: any): void;
|
|
74
|
+
}
|
|
205
75
|
|
|
76
|
+
/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
|
|
77
|
+
interface AbortSignal extends EventTarget {
|
|
206
78
|
/**
|
|
207
|
-
*
|
|
79
|
+
* Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
|
|
208
80
|
*/
|
|
209
|
-
|
|
81
|
+
readonly aborted: boolean;
|
|
82
|
+
readonly reason: any;
|
|
83
|
+
onabort: null | ((this: AbortSignal, event: Event) => any);
|
|
84
|
+
throwIfAborted(): void;
|
|
85
|
+
}
|
|
210
86
|
|
|
87
|
+
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
|
88
|
+
: {
|
|
89
|
+
prototype: AbortController;
|
|
90
|
+
new(): AbortController;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
|
94
|
+
: {
|
|
95
|
+
prototype: AbortSignal;
|
|
96
|
+
new(): AbortSignal;
|
|
97
|
+
abort(reason?: any): AbortSignal;
|
|
98
|
+
timeout(milliseconds: number): AbortSignal;
|
|
99
|
+
};
|
|
100
|
+
// #endregion borrowed
|
|
101
|
+
|
|
102
|
+
// #region Disposable
|
|
103
|
+
interface SymbolConstructor {
|
|
211
104
|
/**
|
|
212
|
-
*
|
|
105
|
+
* A method that is used to release resources held by an object. Called by the semantics of the `using` statement.
|
|
213
106
|
*/
|
|
214
|
-
|
|
107
|
+
readonly dispose: unique symbol;
|
|
215
108
|
|
|
216
109
|
/**
|
|
217
|
-
*
|
|
110
|
+
* A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement.
|
|
218
111
|
*/
|
|
219
|
-
|
|
112
|
+
readonly asyncDispose: unique symbol;
|
|
220
113
|
}
|
|
221
114
|
|
|
222
|
-
interface
|
|
223
|
-
|
|
224
|
-
code?: string | undefined;
|
|
225
|
-
path?: string | undefined;
|
|
226
|
-
syscall?: string | undefined;
|
|
115
|
+
interface Disposable {
|
|
116
|
+
[Symbol.dispose](): void;
|
|
227
117
|
}
|
|
228
118
|
|
|
229
|
-
interface
|
|
230
|
-
|
|
231
|
-
read(size?: number): string | Buffer;
|
|
232
|
-
setEncoding(encoding: BufferEncoding): this;
|
|
233
|
-
pause(): this;
|
|
234
|
-
resume(): this;
|
|
235
|
-
isPaused(): boolean;
|
|
236
|
-
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
|
237
|
-
unpipe(destination?: WritableStream): this;
|
|
238
|
-
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
239
|
-
wrap(oldStream: ReadableStream): this;
|
|
240
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
|
119
|
+
interface AsyncDisposable {
|
|
120
|
+
[Symbol.asyncDispose](): PromiseLike<void>;
|
|
241
121
|
}
|
|
122
|
+
// #endregion Disposable
|
|
242
123
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
|
246
|
-
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
|
247
|
-
end(cb?: () => void): this;
|
|
248
|
-
end(data: string | Uint8Array, cb?: () => void): this;
|
|
249
|
-
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
|
253
|
-
|
|
254
|
-
interface RefCounted {
|
|
255
|
-
ref(): this;
|
|
256
|
-
unref(): this;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
type TypedArray =
|
|
260
|
-
| Uint8Array
|
|
261
|
-
| Uint8ClampedArray
|
|
262
|
-
| Uint16Array
|
|
263
|
-
| Uint32Array
|
|
264
|
-
| Int8Array
|
|
265
|
-
| Int16Array
|
|
266
|
-
| Int32Array
|
|
267
|
-
| BigUint64Array
|
|
268
|
-
| BigInt64Array
|
|
269
|
-
| Float32Array
|
|
270
|
-
| Float64Array;
|
|
271
|
-
type ArrayBufferView = TypedArray | DataView;
|
|
272
|
-
|
|
273
|
-
interface Require {
|
|
274
|
-
(id: string): any;
|
|
275
|
-
resolve: RequireResolve;
|
|
276
|
-
cache: Dict<NodeModule>;
|
|
124
|
+
// #region ArrayLike.at()
|
|
125
|
+
interface RelativeIndexable<T> {
|
|
277
126
|
/**
|
|
278
|
-
*
|
|
127
|
+
* Takes an integer value and returns the item at that index,
|
|
128
|
+
* allowing for positive and negative integers.
|
|
129
|
+
* Negative integers count back from the last item in the array.
|
|
279
130
|
*/
|
|
280
|
-
|
|
281
|
-
main: Module | undefined;
|
|
131
|
+
at(index: number): T | undefined;
|
|
282
132
|
}
|
|
133
|
+
interface String extends RelativeIndexable<string> {}
|
|
134
|
+
interface Array<T> extends RelativeIndexable<T> {}
|
|
135
|
+
interface ReadonlyArray<T> extends RelativeIndexable<T> {}
|
|
136
|
+
interface Int8Array extends RelativeIndexable<number> {}
|
|
137
|
+
interface Uint8Array extends RelativeIndexable<number> {}
|
|
138
|
+
interface Uint8ClampedArray extends RelativeIndexable<number> {}
|
|
139
|
+
interface Int16Array extends RelativeIndexable<number> {}
|
|
140
|
+
interface Uint16Array extends RelativeIndexable<number> {}
|
|
141
|
+
interface Int32Array extends RelativeIndexable<number> {}
|
|
142
|
+
interface Uint32Array extends RelativeIndexable<number> {}
|
|
143
|
+
interface Float32Array extends RelativeIndexable<number> {}
|
|
144
|
+
interface Float64Array extends RelativeIndexable<number> {}
|
|
145
|
+
interface BigInt64Array extends RelativeIndexable<bigint> {}
|
|
146
|
+
interface BigUint64Array extends RelativeIndexable<bigint> {}
|
|
147
|
+
// #endregion ArrayLike.at() end
|
|
283
148
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
149
|
+
/**
|
|
150
|
+
* @since v17.0.0
|
|
151
|
+
*
|
|
152
|
+
* Creates a deep clone of an object.
|
|
153
|
+
*/
|
|
154
|
+
function structuredClone<T>(
|
|
155
|
+
value: T,
|
|
156
|
+
transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
|
|
157
|
+
): T;
|
|
158
|
+
|
|
159
|
+
/*----------------------------------------------*
|
|
160
|
+
* *
|
|
161
|
+
* GLOBAL INTERFACES *
|
|
162
|
+
* *
|
|
163
|
+
*-----------------------------------------------*/
|
|
164
|
+
namespace NodeJS {
|
|
165
|
+
interface CallSite {
|
|
166
|
+
/**
|
|
167
|
+
* Value of "this"
|
|
168
|
+
*/
|
|
169
|
+
getThis(): unknown;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Type of "this" as a string.
|
|
173
|
+
* This is the name of the function stored in the constructor field of
|
|
174
|
+
* "this", if available. Otherwise the object's [[Class]] internal
|
|
175
|
+
* property.
|
|
176
|
+
*/
|
|
177
|
+
getTypeName(): string | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Current function
|
|
181
|
+
*/
|
|
182
|
+
getFunction(): Function | undefined;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Name of the current function, typically its name property.
|
|
186
|
+
* If a name property is not available an attempt will be made to try
|
|
187
|
+
* to infer a name from the function's context.
|
|
188
|
+
*/
|
|
189
|
+
getFunctionName(): string | null;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Name of the property [of "this" or one of its prototypes] that holds
|
|
193
|
+
* the current function
|
|
194
|
+
*/
|
|
195
|
+
getMethodName(): string | null;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Name of the script [if this function was defined in a script]
|
|
199
|
+
*/
|
|
200
|
+
getFileName(): string | undefined;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Current line number [if this function was defined in a script]
|
|
204
|
+
*/
|
|
205
|
+
getLineNumber(): number | null;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Current column number [if this function was defined in a script]
|
|
209
|
+
*/
|
|
210
|
+
getColumnNumber(): number | null;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* A call site object representing the location where eval was called
|
|
214
|
+
* [if this function was created using a call to eval]
|
|
215
|
+
*/
|
|
216
|
+
getEvalOrigin(): string | undefined;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Is this a toplevel invocation, that is, is "this" the global object?
|
|
220
|
+
*/
|
|
221
|
+
isToplevel(): boolean;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Does this call take place in code defined by a call to eval?
|
|
225
|
+
*/
|
|
226
|
+
isEval(): boolean;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Is this call in native V8 code?
|
|
230
|
+
*/
|
|
231
|
+
isNative(): boolean;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Is this a constructor call?
|
|
235
|
+
*/
|
|
236
|
+
isConstructor(): boolean;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
interface ErrnoException extends Error {
|
|
240
|
+
errno?: number | undefined;
|
|
241
|
+
code?: string | undefined;
|
|
242
|
+
path?: string | undefined;
|
|
243
|
+
syscall?: string | undefined;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface ReadableStream extends EventEmitter {
|
|
247
|
+
readable: boolean;
|
|
248
|
+
read(size?: number): string | Buffer;
|
|
249
|
+
setEncoding(encoding: BufferEncoding): this;
|
|
250
|
+
pause(): this;
|
|
251
|
+
resume(): this;
|
|
252
|
+
isPaused(): boolean;
|
|
253
|
+
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
|
|
254
|
+
unpipe(destination?: WritableStream): this;
|
|
255
|
+
unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
|
|
256
|
+
wrap(oldStream: ReadableStream): this;
|
|
257
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface WritableStream extends EventEmitter {
|
|
261
|
+
writable: boolean;
|
|
262
|
+
write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
|
|
263
|
+
write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
|
|
264
|
+
end(cb?: () => void): this;
|
|
265
|
+
end(data: string | Uint8Array, cb?: () => void): this;
|
|
266
|
+
end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
interface ReadWriteStream extends ReadableStream, WritableStream {}
|
|
270
|
+
|
|
271
|
+
interface RefCounted {
|
|
272
|
+
ref(): this;
|
|
273
|
+
unref(): this;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
type TypedArray =
|
|
277
|
+
| Uint8Array
|
|
278
|
+
| Uint8ClampedArray
|
|
279
|
+
| Uint16Array
|
|
280
|
+
| Uint32Array
|
|
281
|
+
| Int8Array
|
|
282
|
+
| Int16Array
|
|
283
|
+
| Int32Array
|
|
284
|
+
| BigUint64Array
|
|
285
|
+
| BigInt64Array
|
|
286
|
+
| Float32Array
|
|
287
|
+
| Float64Array;
|
|
288
|
+
type ArrayBufferView = TypedArray | DataView;
|
|
289
|
+
|
|
290
|
+
interface Require {
|
|
291
|
+
(id: string): any;
|
|
292
|
+
resolve: RequireResolve;
|
|
293
|
+
cache: Dict<NodeModule>;
|
|
294
|
+
/**
|
|
295
|
+
* @deprecated
|
|
296
|
+
*/
|
|
297
|
+
extensions: RequireExtensions;
|
|
298
|
+
main: Module | undefined;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
interface RequireResolve {
|
|
302
|
+
(id: string, options?: { paths?: string[] | undefined }): string;
|
|
303
|
+
paths(request: string): string[] | null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
|
|
307
|
+
".js": (m: Module, filename: string) => any;
|
|
308
|
+
".json": (m: Module, filename: string) => any;
|
|
309
|
+
".node": (m: Module, filename: string) => any;
|
|
310
|
+
}
|
|
311
|
+
interface Module {
|
|
312
|
+
/**
|
|
313
|
+
* `true` if the module is running during the Node.js preload
|
|
314
|
+
*/
|
|
315
|
+
isPreloading: boolean;
|
|
316
|
+
exports: any;
|
|
317
|
+
require: Require;
|
|
318
|
+
id: string;
|
|
319
|
+
filename: string;
|
|
320
|
+
loaded: boolean;
|
|
321
|
+
/** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */
|
|
322
|
+
parent: Module | null | undefined;
|
|
323
|
+
children: Module[];
|
|
324
|
+
/**
|
|
325
|
+
* @since v11.14.0
|
|
326
|
+
*
|
|
327
|
+
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
|
328
|
+
*/
|
|
329
|
+
path: string;
|
|
330
|
+
paths: string[];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface Dict<T> {
|
|
334
|
+
[key: string]: T | undefined;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
interface ReadOnlyDict<T> {
|
|
338
|
+
readonly [key: string]: T | undefined;
|
|
339
|
+
}
|
|
322
340
|
}
|
|
323
341
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
342
|
+
interface RequestInit extends _RequestInit {}
|
|
343
|
+
|
|
344
|
+
function fetch(
|
|
345
|
+
input: string | URL | globalThis.Request,
|
|
346
|
+
init?: RequestInit,
|
|
347
|
+
): Promise<Response>;
|
|
348
|
+
|
|
349
|
+
interface Request extends _Request {}
|
|
350
|
+
var Request: typeof globalThis extends {
|
|
351
|
+
onmessage: any;
|
|
352
|
+
Request: infer T;
|
|
353
|
+
} ? T
|
|
354
|
+
: typeof import("undici-types").Request;
|
|
355
|
+
|
|
356
|
+
interface ResponseInit extends _ResponseInit {}
|
|
357
|
+
|
|
358
|
+
interface Response extends _Response {}
|
|
359
|
+
var Response: typeof globalThis extends {
|
|
360
|
+
onmessage: any;
|
|
361
|
+
Response: infer T;
|
|
362
|
+
} ? T
|
|
363
|
+
: typeof import("undici-types").Response;
|
|
364
|
+
|
|
365
|
+
interface FormData extends _FormData {}
|
|
366
|
+
var FormData: typeof globalThis extends {
|
|
367
|
+
onmessage: any;
|
|
368
|
+
FormData: infer T;
|
|
369
|
+
} ? T
|
|
370
|
+
: typeof import("undici-types").FormData;
|
|
371
|
+
|
|
372
|
+
interface Headers extends _Headers {}
|
|
373
|
+
var Headers: typeof globalThis extends {
|
|
374
|
+
onmessage: any;
|
|
375
|
+
Headers: infer T;
|
|
376
|
+
} ? T
|
|
377
|
+
: typeof import("undici-types").Headers;
|
|
378
|
+
|
|
379
|
+
interface File extends _File {}
|
|
380
|
+
var File: typeof globalThis extends {
|
|
381
|
+
onmessage: any;
|
|
382
|
+
File: infer T;
|
|
383
|
+
} ? T
|
|
384
|
+
: typeof import("node:buffer").File;
|
|
346
385
|
}
|
|
347
|
-
|
|
348
|
-
interface RequestInit extends NodeJS.fetch._RequestInit {}
|
|
349
|
-
|
|
350
|
-
declare function fetch(
|
|
351
|
-
input: NodeJS.fetch.RequestInfo,
|
|
352
|
-
init?: RequestInit,
|
|
353
|
-
): Promise<Response>;
|
|
354
|
-
|
|
355
|
-
interface Request extends NodeJS.fetch._Request {}
|
|
356
|
-
declare var Request: typeof globalThis extends {
|
|
357
|
-
onmessage: any;
|
|
358
|
-
Request: infer T;
|
|
359
|
-
} ? T
|
|
360
|
-
: typeof import("undici-types").Request;
|
|
361
|
-
|
|
362
|
-
interface Response extends NodeJS.fetch._Response {}
|
|
363
|
-
declare var Response: typeof globalThis extends {
|
|
364
|
-
onmessage: any;
|
|
365
|
-
Response: infer T;
|
|
366
|
-
} ? T
|
|
367
|
-
: typeof import("undici-types").Response;
|
|
368
|
-
|
|
369
|
-
interface FormData extends NodeJS.fetch._FormData {}
|
|
370
|
-
declare var FormData: typeof globalThis extends {
|
|
371
|
-
onmessage: any;
|
|
372
|
-
FormData: infer T;
|
|
373
|
-
} ? T
|
|
374
|
-
: typeof import("undici-types").FormData;
|
|
375
|
-
|
|
376
|
-
interface Headers extends NodeJS.fetch._Headers {}
|
|
377
|
-
declare var Headers: typeof globalThis extends {
|
|
378
|
-
onmessage: any;
|
|
379
|
-
Headers: infer T;
|
|
380
|
-
} ? T
|
|
381
|
-
: typeof import("undici-types").Headers;
|