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