@types/node 16.11.10 → 17.0.0
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.d.ts +1 -1
- node/async_hooks.d.ts +7 -3
- node/buffer.d.ts +9 -9
- node/child_process.d.ts +1 -1
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +2 -2
- node/dgram.d.ts +2 -2
- node/diagnostics_channel.d.ts +1 -1
- node/dns/promises.d.ts +12 -10
- node/dns.d.ts +17 -12
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -2
- node/fs/promises.d.ts +5 -5
- node/fs.d.ts +62 -11
- node/http.d.ts +21 -4
- node/http2.d.ts +2 -2
- node/https.d.ts +1 -1
- node/index.d.ts +1 -1
- node/inspector.d.ts +4 -5
- node/net.d.ts +11 -11
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +4 -4
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +121 -14
- node/repl.d.ts +1 -1
- node/stream/web.d.ts +323 -0
- node/stream.d.ts +2 -2
- node/string_decoder.d.ts +1 -1
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +58 -18
- node/util.d.ts +3 -3
- node/v8.d.ts +3 -3
- node/vm.d.ts +1 -1
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +4 -4
- node/zlib.d.ts +1 -1
node/stream/web.d.ts
CHANGED
|
@@ -1,5 +1,328 @@
|
|
|
1
1
|
declare module 'stream/web' {
|
|
2
2
|
// stub module, pending copy&paste from .d.ts or manual impl
|
|
3
|
+
// copy from lib.dom.d.ts
|
|
4
|
+
interface ReadableWritablePair<R = any, W = any> {
|
|
5
|
+
readable: ReadableStream<R>;
|
|
6
|
+
/**
|
|
7
|
+
* Provides a convenient, chainable way of piping this readable stream
|
|
8
|
+
* through a transform stream (or any other { writable, readable }
|
|
9
|
+
* pair). It simply pipes the stream into the writable side of the
|
|
10
|
+
* supplied pair, and returns the readable side for further use.
|
|
11
|
+
*
|
|
12
|
+
* Piping a stream will lock it for the duration of the pipe, preventing
|
|
13
|
+
* any other consumer from acquiring a reader.
|
|
14
|
+
*/
|
|
15
|
+
writable: WritableStream<W>;
|
|
16
|
+
}
|
|
17
|
+
interface StreamPipeOptions {
|
|
18
|
+
preventAbort?: boolean;
|
|
19
|
+
preventCancel?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Pipes this readable stream to a given writable stream destination.
|
|
22
|
+
* The way in which the piping process behaves under various error
|
|
23
|
+
* conditions can be customized with a number of passed options. It
|
|
24
|
+
* returns a promise that fulfills when the piping process completes
|
|
25
|
+
* successfully, or rejects if any errors were encountered.
|
|
26
|
+
*
|
|
27
|
+
* Piping a stream will lock it for the duration of the pipe, preventing
|
|
28
|
+
* any other consumer from acquiring a reader.
|
|
29
|
+
*
|
|
30
|
+
* Errors and closures of the source and destination streams propagate
|
|
31
|
+
* as follows:
|
|
32
|
+
*
|
|
33
|
+
* An error in this source readable stream will abort destination,
|
|
34
|
+
* unless preventAbort is truthy. The returned promise will be rejected
|
|
35
|
+
* with the source's error, or with any error that occurs during
|
|
36
|
+
* aborting the destination.
|
|
37
|
+
*
|
|
38
|
+
* An error in destination will cancel this source readable stream,
|
|
39
|
+
* unless preventCancel is truthy. The returned promise will be rejected
|
|
40
|
+
* with the destination's error, or with any error that occurs during
|
|
41
|
+
* canceling the source.
|
|
42
|
+
*
|
|
43
|
+
* When this source readable stream closes, destination will be closed,
|
|
44
|
+
* unless preventClose is truthy. The returned promise will be fulfilled
|
|
45
|
+
* once this process completes, unless an error is encountered while
|
|
46
|
+
* closing the destination, in which case it will be rejected with that
|
|
47
|
+
* error.
|
|
48
|
+
*
|
|
49
|
+
* If destination starts out closed or closing, this source readable
|
|
50
|
+
* stream will be canceled, unless preventCancel is true. The returned
|
|
51
|
+
* promise will be rejected with an error indicating piping to a closed
|
|
52
|
+
* stream failed, or with any error that occurs during canceling the
|
|
53
|
+
* source.
|
|
54
|
+
*
|
|
55
|
+
* The signal option can be set to an AbortSignal to allow aborting an
|
|
56
|
+
* ongoing pipe operation via the corresponding AbortController. In this
|
|
57
|
+
* case, this source readable stream will be canceled, and destination
|
|
58
|
+
* aborted, unless the respective options preventCancel or preventAbort
|
|
59
|
+
* are set.
|
|
60
|
+
*/
|
|
61
|
+
preventClose?: boolean;
|
|
62
|
+
signal?: AbortSignal;
|
|
63
|
+
}
|
|
64
|
+
interface ReadableStreamGenericReader {
|
|
65
|
+
readonly closed: Promise<undefined>;
|
|
66
|
+
cancel(reason?: any): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
interface ReadableStreamDefaultReadValueResult<T> {
|
|
69
|
+
done: false;
|
|
70
|
+
value: T;
|
|
71
|
+
}
|
|
72
|
+
interface ReadableStreamDefaultReadDoneResult {
|
|
73
|
+
done: true;
|
|
74
|
+
value?: undefined;
|
|
75
|
+
}
|
|
76
|
+
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
|
|
77
|
+
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
|
|
78
|
+
interface ReadableByteStreamControllerCallback {
|
|
79
|
+
(controller: ReadableByteStreamController): void | PromiseLike<void>;
|
|
80
|
+
}
|
|
81
|
+
interface UnderlyingSinkAbortCallback {
|
|
82
|
+
(reason?: any): void | PromiseLike<void>;
|
|
83
|
+
}
|
|
84
|
+
interface UnderlyingSinkCloseCallback {
|
|
85
|
+
(): void | PromiseLike<void>;
|
|
86
|
+
}
|
|
87
|
+
interface UnderlyingSinkStartCallback {
|
|
88
|
+
(controller: WritableStreamDefaultController): any;
|
|
89
|
+
}
|
|
90
|
+
interface UnderlyingSinkWriteCallback<W> {
|
|
91
|
+
(chunk: W, controller: WritableStreamDefaultController): void | PromiseLike<void>;
|
|
92
|
+
}
|
|
93
|
+
interface UnderlyingSourceCancelCallback {
|
|
94
|
+
(reason?: any): void | PromiseLike<void>;
|
|
95
|
+
}
|
|
96
|
+
interface UnderlyingSourcePullCallback<R> {
|
|
97
|
+
(controller: ReadableStreamController<R>): void | PromiseLike<void>;
|
|
98
|
+
}
|
|
99
|
+
interface UnderlyingSourceStartCallback<R> {
|
|
100
|
+
(controller: ReadableStreamController<R>): any;
|
|
101
|
+
}
|
|
102
|
+
interface TransformerFlushCallback<O> {
|
|
103
|
+
(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
|
|
104
|
+
}
|
|
105
|
+
interface TransformerStartCallback<O> {
|
|
106
|
+
(controller: TransformStreamDefaultController<O>): any;
|
|
107
|
+
}
|
|
108
|
+
interface TransformerTransformCallback<I, O> {
|
|
109
|
+
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
|
|
110
|
+
}
|
|
111
|
+
interface UnderlyingByteSource {
|
|
112
|
+
autoAllocateChunkSize?: number;
|
|
113
|
+
cancel?: ReadableStreamErrorCallback;
|
|
114
|
+
pull?: ReadableByteStreamControllerCallback;
|
|
115
|
+
start?: ReadableByteStreamControllerCallback;
|
|
116
|
+
type: 'bytes';
|
|
117
|
+
}
|
|
118
|
+
interface UnderlyingSource<R = any> {
|
|
119
|
+
cancel?: UnderlyingSourceCancelCallback;
|
|
120
|
+
pull?: UnderlyingSourcePullCallback<R>;
|
|
121
|
+
start?: UnderlyingSourceStartCallback<R>;
|
|
122
|
+
type?: undefined;
|
|
123
|
+
}
|
|
124
|
+
interface UnderlyingSink<W = any> {
|
|
125
|
+
abort?: UnderlyingSinkAbortCallback;
|
|
126
|
+
close?: UnderlyingSinkCloseCallback;
|
|
127
|
+
start?: UnderlyingSinkStartCallback;
|
|
128
|
+
type?: undefined;
|
|
129
|
+
write?: UnderlyingSinkWriteCallback<W>;
|
|
130
|
+
}
|
|
131
|
+
interface ReadableStreamErrorCallback {
|
|
132
|
+
(reason: any): void | PromiseLike<void>;
|
|
133
|
+
}
|
|
134
|
+
/** This Streams API interface represents a readable stream of byte data. */
|
|
135
|
+
interface ReadableStream<R = any> {
|
|
136
|
+
readonly locked: boolean;
|
|
137
|
+
cancel(reason?: any): Promise<void>;
|
|
138
|
+
getReader(): ReadableStreamDefaultReader<R>;
|
|
139
|
+
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
|
|
140
|
+
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
|
|
141
|
+
tee(): [ReadableStream<R>, ReadableStream<R>];
|
|
142
|
+
[Symbol.asyncIterator](options?: { preventCancel?: boolean }): AsyncIterableIterator<R>;
|
|
143
|
+
}
|
|
144
|
+
const ReadableStream: {
|
|
145
|
+
prototype: ReadableStream;
|
|
146
|
+
new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy<Uint8Array>): ReadableStream<Uint8Array>;
|
|
147
|
+
new <R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
|
148
|
+
};
|
|
149
|
+
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
|
|
150
|
+
read(): Promise<ReadableStreamDefaultReadResult<R>>;
|
|
151
|
+
releaseLock(): void;
|
|
152
|
+
}
|
|
153
|
+
const ReadableStreamDefaultReader: {
|
|
154
|
+
prototype: ReadableStreamDefaultReader;
|
|
155
|
+
new <R = any>(stream: ReadableStream<R>): ReadableStreamDefaultReader<R>;
|
|
156
|
+
};
|
|
157
|
+
const ReadableStreamBYOBReader: any;
|
|
158
|
+
const ReadableStreamBYOBRequest: any;
|
|
159
|
+
interface ReadableByteStreamController {
|
|
160
|
+
readonly byobRequest: undefined;
|
|
161
|
+
readonly desiredSize: number | null;
|
|
162
|
+
close(): void;
|
|
163
|
+
enqueue(chunk: ArrayBufferView): void;
|
|
164
|
+
error(error?: any): void;
|
|
165
|
+
}
|
|
166
|
+
const ReadableByteStreamController: {
|
|
167
|
+
prototype: ReadableByteStreamController;
|
|
168
|
+
new (): ReadableByteStreamController;
|
|
169
|
+
};
|
|
170
|
+
interface ReadableStreamDefaultController<R = any> {
|
|
171
|
+
readonly desiredSize: number | null;
|
|
172
|
+
close(): void;
|
|
173
|
+
enqueue(chunk?: R): void;
|
|
174
|
+
error(e?: any): void;
|
|
175
|
+
}
|
|
176
|
+
const ReadableStreamDefaultController: {
|
|
177
|
+
prototype: ReadableStreamDefaultController;
|
|
178
|
+
new (): ReadableStreamDefaultController;
|
|
179
|
+
};
|
|
180
|
+
interface Transformer<I = any, O = any> {
|
|
181
|
+
flush?: TransformerFlushCallback<O>;
|
|
182
|
+
readableType?: undefined;
|
|
183
|
+
start?: TransformerStartCallback<O>;
|
|
184
|
+
transform?: TransformerTransformCallback<I, O>;
|
|
185
|
+
writableType?: undefined;
|
|
186
|
+
}
|
|
187
|
+
interface TransformStream<I = any, O = any> {
|
|
188
|
+
readonly readable: ReadableStream<O>;
|
|
189
|
+
readonly writable: WritableStream<I>;
|
|
190
|
+
}
|
|
191
|
+
const TransformStream: {
|
|
192
|
+
prototype: TransformStream;
|
|
193
|
+
new <I = any, O = any>(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>): TransformStream<I, O>;
|
|
194
|
+
};
|
|
195
|
+
interface TransformStreamDefaultController<O = any> {
|
|
196
|
+
readonly desiredSize: number | null;
|
|
197
|
+
enqueue(chunk?: O): void;
|
|
198
|
+
error(reason?: any): void;
|
|
199
|
+
terminate(): void;
|
|
200
|
+
}
|
|
201
|
+
const TransformStreamDefaultController: {
|
|
202
|
+
prototype: TransformStreamDefaultController;
|
|
203
|
+
new (): TransformStreamDefaultController;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* This Streams API interface provides a standard abstraction for writing
|
|
207
|
+
* streaming data to a destination, known as a sink. This object comes with
|
|
208
|
+
* built-in back pressure and queuing.
|
|
209
|
+
*/
|
|
210
|
+
interface WritableStream<W = any> {
|
|
211
|
+
readonly locked: boolean;
|
|
212
|
+
abort(reason?: any): Promise<void>;
|
|
213
|
+
close(): Promise<void>;
|
|
214
|
+
getWriter(): WritableStreamDefaultWriter<W>;
|
|
215
|
+
}
|
|
216
|
+
const WritableStream: {
|
|
217
|
+
prototype: WritableStream;
|
|
218
|
+
new <W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* This Streams API interface is the object returned by
|
|
222
|
+
* WritableStream.getWriter() and once created locks the < writer to the
|
|
223
|
+
* WritableStream ensuring that no other streams can write to the underlying
|
|
224
|
+
* sink.
|
|
225
|
+
*/
|
|
226
|
+
interface WritableStreamDefaultWriter<W = any> {
|
|
227
|
+
readonly closed: Promise<undefined>;
|
|
228
|
+
readonly desiredSize: number | null;
|
|
229
|
+
readonly ready: Promise<undefined>;
|
|
230
|
+
abort(reason?: any): Promise<void>;
|
|
231
|
+
close(): Promise<void>;
|
|
232
|
+
releaseLock(): void;
|
|
233
|
+
write(chunk?: W): Promise<void>;
|
|
234
|
+
}
|
|
235
|
+
const WritableStreamDefaultWriter: {
|
|
236
|
+
prototype: WritableStreamDefaultWriter;
|
|
237
|
+
new <W = any>(stream: WritableStream<W>): WritableStreamDefaultWriter<W>;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* This Streams API interface represents a controller allowing control of a
|
|
241
|
+
* WritableStream's state. When constructing a WritableStream, the
|
|
242
|
+
* underlying sink is given a corresponding WritableStreamDefaultController
|
|
243
|
+
* instance to manipulate.
|
|
244
|
+
*/
|
|
245
|
+
interface WritableStreamDefaultController {
|
|
246
|
+
error(e?: any): void;
|
|
247
|
+
}
|
|
248
|
+
const WritableStreamDefaultController: {
|
|
249
|
+
prototype: WritableStreamDefaultController;
|
|
250
|
+
new (): WritableStreamDefaultController;
|
|
251
|
+
};
|
|
252
|
+
interface QueuingStrategy<T = any> {
|
|
253
|
+
highWaterMark?: number;
|
|
254
|
+
size?: QueuingStrategySize<T>;
|
|
255
|
+
}
|
|
256
|
+
interface QueuingStrategySize<T = any> {
|
|
257
|
+
(chunk?: T): number;
|
|
258
|
+
}
|
|
259
|
+
interface QueuingStrategyInit {
|
|
260
|
+
/**
|
|
261
|
+
* Creates a new ByteLengthQueuingStrategy with the provided high water
|
|
262
|
+
* mark.
|
|
263
|
+
*
|
|
264
|
+
* Note that the provided high water mark will not be validated ahead of
|
|
265
|
+
* time. Instead, if it is negative, NaN, or not a number, the resulting
|
|
266
|
+
* ByteLengthQueuingStrategy will cause the corresponding stream
|
|
267
|
+
* constructor to throw.
|
|
268
|
+
*/
|
|
269
|
+
highWaterMark: number;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* This Streams API interface provides a built-in byte length queuing
|
|
273
|
+
* strategy that can be used when constructing streams.
|
|
274
|
+
*/
|
|
275
|
+
interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> {
|
|
276
|
+
readonly highWaterMark: number;
|
|
277
|
+
readonly size: QueuingStrategySize<ArrayBufferView>;
|
|
278
|
+
}
|
|
279
|
+
const ByteLengthQueuingStrategy: {
|
|
280
|
+
prototype: ByteLengthQueuingStrategy;
|
|
281
|
+
new (init: QueuingStrategyInit): ByteLengthQueuingStrategy;
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* This Streams API interface provides a built-in byte length queuing
|
|
285
|
+
* strategy that can be used when constructing streams.
|
|
286
|
+
*/
|
|
287
|
+
interface CountQueuingStrategy extends QueuingStrategy {
|
|
288
|
+
readonly highWaterMark: number;
|
|
289
|
+
readonly size: QueuingStrategySize;
|
|
290
|
+
}
|
|
291
|
+
const CountQueuingStrategy: {
|
|
292
|
+
prototype: CountQueuingStrategy;
|
|
293
|
+
new (init: QueuingStrategyInit): CountQueuingStrategy;
|
|
294
|
+
};
|
|
295
|
+
interface TextEncoderStream {
|
|
296
|
+
/** Returns "utf-8". */
|
|
297
|
+
readonly encoding: 'utf-8';
|
|
298
|
+
readonly readable: ReadableStream<Uint8Array>;
|
|
299
|
+
readonly writable: WritableStream<string>;
|
|
300
|
+
readonly [Symbol.toStringTag]: string;
|
|
301
|
+
}
|
|
302
|
+
const TextEncoderStream: {
|
|
303
|
+
prototype: TextEncoderStream;
|
|
304
|
+
new (): TextEncoderStream;
|
|
305
|
+
};
|
|
306
|
+
interface TextDecoderOptions {
|
|
307
|
+
fatal?: boolean;
|
|
308
|
+
ignoreBOM?: boolean;
|
|
309
|
+
}
|
|
310
|
+
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
311
|
+
interface TextDecoderStream {
|
|
312
|
+
/** Returns encoding's name, lower cased. */
|
|
313
|
+
readonly encoding: string;
|
|
314
|
+
/** Returns `true` if error mode is "fatal", and `false` otherwise. */
|
|
315
|
+
readonly fatal: boolean;
|
|
316
|
+
/** Returns `true` if ignore BOM flag is set, and `false` otherwise. */
|
|
317
|
+
readonly ignoreBOM: boolean;
|
|
318
|
+
readonly readable: ReadableStream<string>;
|
|
319
|
+
readonly writable: WritableStream<BufferSource>;
|
|
320
|
+
readonly [Symbol.toStringTag]: string;
|
|
321
|
+
}
|
|
322
|
+
const TextDecoderStream: {
|
|
323
|
+
prototype: TextDecoderStream;
|
|
324
|
+
new (label?: string, options?: TextDecoderOptions): TextDecoderStream;
|
|
325
|
+
};
|
|
3
326
|
}
|
|
4
327
|
declare module 'node:stream/web' {
|
|
5
328
|
export * from 'stream/web';
|
node/stream.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* The `stream` module is useful for creating new types of stream instances. It is
|
|
16
16
|
* usually not necessary to use the `stream` module to consume streams.
|
|
17
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
17
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/stream.js)
|
|
18
18
|
*/
|
|
19
19
|
declare module 'stream' {
|
|
20
20
|
import { EventEmitter, Abortable } from 'node:events';
|
|
@@ -71,7 +71,7 @@ declare module 'stream' {
|
|
|
71
71
|
readable: boolean;
|
|
72
72
|
/**
|
|
73
73
|
* Returns whether `'data'` has been emitted.
|
|
74
|
-
* @since v16.7.0
|
|
74
|
+
* @since v16.7.0, v14.18.0
|
|
75
75
|
* @experimental
|
|
76
76
|
*/
|
|
77
77
|
readonly readableDidRead: boolean;
|
node/string_decoder.d.ts
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* decoder.write(Buffer.from([0x82]));
|
|
37
37
|
* console.log(decoder.end(Buffer.from([0xAC])));
|
|
38
38
|
* ```
|
|
39
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
39
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/string_decoder.js)
|
|
40
40
|
*/
|
|
41
41
|
declare module 'string_decoder' {
|
|
42
42
|
class StringDecoder {
|
node/timers.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* The timer functions within Node.js implement a similar API as the timers API
|
|
7
7
|
* provided by Web Browsers but use a different internal implementation that is
|
|
8
8
|
* built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/timers.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'timers' {
|
|
12
12
|
import { Abortable } from 'node:events';
|
node/tls.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const tls = require('tls');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/tls.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'tls' {
|
|
12
12
|
import { X509Certificate } from 'node:crypto';
|
node/trace_events.d.ts
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
*
|
|
74
74
|
* The features from this module are not available in `Worker` threads.
|
|
75
75
|
* @experimental
|
|
76
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
76
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/trace_events.js)
|
|
77
77
|
*/
|
|
78
78
|
declare module 'trace_events' {
|
|
79
79
|
/**
|
node/tty.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* In most cases, there should be little to no reason for an application to
|
|
24
24
|
* manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
|
|
25
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
25
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/tty.js)
|
|
26
26
|
*/
|
|
27
27
|
declare module 'tty' {
|
|
28
28
|
import * as net from 'node:net';
|
node/url.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ```js
|
|
6
6
|
* import url from 'url';
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/url.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module 'url' {
|
|
11
11
|
import { Blob } from 'node:buffer';
|
|
@@ -72,27 +72,67 @@ declare module 'url' {
|
|
|
72
72
|
function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
|
|
73
73
|
function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
|
|
74
74
|
/**
|
|
75
|
-
* The
|
|
76
|
-
* These are not, however, customizable in any way. The `url.format(URL[, options])` method allows for basic
|
|
77
|
-
* customization of the output.
|
|
78
|
-
* Returns a customizable serialization of a URL `String` representation of a `WHATWG URL` object.
|
|
75
|
+
* The `url.format()` method returns a formatted URL string derived from`urlObject`.
|
|
79
76
|
*
|
|
80
77
|
* ```js
|
|
81
|
-
*
|
|
82
|
-
*
|
|
78
|
+
* const url = require('url');
|
|
79
|
+
* url.format({
|
|
80
|
+
* protocol: 'https',
|
|
81
|
+
* hostname: 'example.com',
|
|
82
|
+
* pathname: '/some/path',
|
|
83
|
+
* query: {
|
|
84
|
+
* page: 1,
|
|
85
|
+
* format: 'json'
|
|
86
|
+
* }
|
|
87
|
+
* });
|
|
83
88
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
89
|
+
* // => 'https://example.com/some/path?page=1&format=json'
|
|
90
|
+
* ```
|
|
86
91
|
*
|
|
87
|
-
*
|
|
88
|
-
* // Prints https://a:b@xn--g6w251d/?abc#foo
|
|
92
|
+
* If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`.
|
|
89
93
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
94
|
+
* The formatting process operates as follows:
|
|
95
|
+
*
|
|
96
|
+
* * A new empty string `result` is created.
|
|
97
|
+
* * If `urlObject.protocol` is a string, it is appended as-is to `result`.
|
|
98
|
+
* * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown.
|
|
99
|
+
* * For all string values of `urlObject.protocol` that _do not end_ with an ASCII
|
|
100
|
+
* colon (`:`) character, the literal string `:` will be appended to `result`.
|
|
101
|
+
* * If either of the following conditions is true, then the literal string `//`will be appended to `result`:
|
|
102
|
+
* * `urlObject.slashes` property is true;
|
|
103
|
+
* * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`;
|
|
104
|
+
* * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string
|
|
105
|
+
* and appended to `result`followed by the literal string `@`.
|
|
106
|
+
* * If the `urlObject.host` property is `undefined` then:
|
|
107
|
+
* * If the `urlObject.hostname` is a string, it is appended to `result`.
|
|
108
|
+
* * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string,
|
|
109
|
+
* an `Error` is thrown.
|
|
110
|
+
* * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`:
|
|
111
|
+
* * The literal string `:` is appended to `result`, and
|
|
112
|
+
* * The value of `urlObject.port` is coerced to a string and appended to`result`.
|
|
113
|
+
* * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`.
|
|
114
|
+
* * If the `urlObject.pathname` property is a string that is not an empty string:
|
|
115
|
+
* * If the `urlObject.pathname`_does not start_ with an ASCII forward slash
|
|
116
|
+
* (`/`), then the literal string `'/'` is appended to `result`.
|
|
117
|
+
* * The value of `urlObject.pathname` is appended to `result`.
|
|
118
|
+
* * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown.
|
|
119
|
+
* * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the
|
|
120
|
+
* `querystring` module's `stringify()`method passing the value of `urlObject.query`.
|
|
121
|
+
* * Otherwise, if `urlObject.search` is a string:
|
|
122
|
+
* * If the value of `urlObject.search`_does not start_ with the ASCII question
|
|
123
|
+
* mark (`?`) character, the literal string `?` is appended to `result`.
|
|
124
|
+
* * The value of `urlObject.search` is appended to `result`.
|
|
125
|
+
* * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown.
|
|
126
|
+
* * If the `urlObject.hash` property is a string:
|
|
127
|
+
* * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`)
|
|
128
|
+
* character, the literal string `#` is appended to `result`.
|
|
129
|
+
* * The value of `urlObject.hash` is appended to `result`.
|
|
130
|
+
* * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a
|
|
131
|
+
* string, an `Error` is thrown.
|
|
132
|
+
* * `result` is returned.
|
|
133
|
+
* @since v0.1.25
|
|
134
|
+
* @deprecated Legacy: Use the WHATWG URL API instead.
|
|
135
|
+
* @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
|
|
96
136
|
*/
|
|
97
137
|
function format(urlObject: URL, options?: URLFormatOptions): string;
|
|
98
138
|
/**
|
|
@@ -301,7 +341,7 @@ declare module 'url' {
|
|
|
301
341
|
* }
|
|
302
342
|
*
|
|
303
343
|
* ```
|
|
304
|
-
* @since v15.7.0
|
|
344
|
+
* @since v15.7.0, v14.18.0
|
|
305
345
|
* @param url The `WHATWG URL` object to convert to an options object.
|
|
306
346
|
* @return Options object
|
|
307
347
|
*/
|
node/util.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const util = require('util');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/util.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'util' {
|
|
12
12
|
import * as types from 'node:util/types';
|
|
@@ -139,7 +139,7 @@ declare module 'util' {
|
|
|
139
139
|
* console.error(name); // ENOENT
|
|
140
140
|
* });
|
|
141
141
|
* ```
|
|
142
|
-
* @since v16.0.0
|
|
142
|
+
* @since v16.0.0, v14.17.0
|
|
143
143
|
*/
|
|
144
144
|
export function getSystemErrorMap(): Map<number, [string, string]>;
|
|
145
145
|
/**
|
|
@@ -159,7 +159,7 @@ declare module 'util' {
|
|
|
159
159
|
* Returns the `string` after replacing any surrogate code points
|
|
160
160
|
* (or equivalently, any unpaired surrogate code units) with the
|
|
161
161
|
* Unicode "replacement character" U+FFFD.
|
|
162
|
-
* @since v16.8.0
|
|
162
|
+
* @since v16.8.0, v14.18.0
|
|
163
163
|
*/
|
|
164
164
|
export function toUSVString(string: string): string;
|
|
165
165
|
/**
|
node/v8.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ```js
|
|
5
5
|
* const v8 = require('v8');
|
|
6
6
|
* ```
|
|
7
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
7
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/v8.js)
|
|
8
8
|
*/
|
|
9
9
|
declare module 'v8' {
|
|
10
10
|
import { Readable } from 'node:stream';
|
|
@@ -362,14 +362,14 @@ declare module 'v8' {
|
|
|
362
362
|
*
|
|
363
363
|
* When the process is about to exit, one last coverage will still be written to
|
|
364
364
|
* disk unless {@link stopCoverage} is invoked before the process exits.
|
|
365
|
-
* @since v15.1.0, v12.22.0
|
|
365
|
+
* @since v15.1.0, v14.18.0, v12.22.0
|
|
366
366
|
*/
|
|
367
367
|
function takeCoverage(): void;
|
|
368
368
|
/**
|
|
369
369
|
* The `v8.stopCoverage()` method allows the user to stop the coverage collection
|
|
370
370
|
* started by `NODE_V8_COVERAGE`, so that V8 can release the execution count
|
|
371
371
|
* records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand.
|
|
372
|
-
* @since v15.1.0, v12.22.0
|
|
372
|
+
* @since v15.1.0, v14.18.0, v12.22.0
|
|
373
373
|
*/
|
|
374
374
|
function stopCoverage(): void;
|
|
375
375
|
}
|
node/vm.d.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*
|
|
33
33
|
* console.log(x); // 1; y is not defined.
|
|
34
34
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/vm.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'vm' {
|
|
38
38
|
interface Context extends NodeJS.Dict<any> {}
|
node/wasi.d.ts
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
* The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
|
|
69
69
|
* example to run.
|
|
70
70
|
* @experimental
|
|
71
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
71
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/wasi.js)
|
|
72
72
|
*/
|
|
73
73
|
declare module 'wasi' {
|
|
74
74
|
interface WASIOptions {
|
node/worker_threads.d.ts
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*
|
|
50
50
|
* Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
|
|
51
51
|
* specifically `argv` and `execArgv` options.
|
|
52
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/worker_threads.js)
|
|
53
53
|
*/
|
|
54
54
|
declare module 'worker_threads' {
|
|
55
55
|
import { Blob } from 'node:buffer';
|
|
@@ -384,7 +384,7 @@ declare module 'worker_threads' {
|
|
|
384
384
|
/**
|
|
385
385
|
* An object that can be used to query performance information from a worker
|
|
386
386
|
* instance. Similar to `perf_hooks.performance`.
|
|
387
|
-
* @since v15.1.0, v12.22.0
|
|
387
|
+
* @since v15.1.0, v14.17.0, v12.22.0
|
|
388
388
|
*/
|
|
389
389
|
readonly performance: WorkerPerformance;
|
|
390
390
|
/**
|
|
@@ -629,14 +629,14 @@ declare module 'worker_threads' {
|
|
|
629
629
|
* console.log(getEnvironmentData('Hello')); // Prints 'World!'.
|
|
630
630
|
* }
|
|
631
631
|
* ```
|
|
632
|
-
* @since v15.12.0
|
|
632
|
+
* @since v15.12.0, v14.18.0
|
|
633
633
|
* @experimental
|
|
634
634
|
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
|
|
635
635
|
*/
|
|
636
636
|
function getEnvironmentData(key: Serializable): Serializable;
|
|
637
637
|
/**
|
|
638
638
|
* The `worker.setEnvironmentData()` API sets the content of`worker.getEnvironmentData()` in the current thread and all new `Worker`instances spawned from the current context.
|
|
639
|
-
* @since v15.12.0
|
|
639
|
+
* @since v15.12.0, v14.18.0
|
|
640
640
|
* @experimental
|
|
641
641
|
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
|
|
642
642
|
* @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
|
node/zlib.d.ts
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
* });
|
|
89
89
|
* ```
|
|
90
90
|
* @since v0.5.8
|
|
91
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
91
|
+
* @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/zlib.js)
|
|
92
92
|
*/
|
|
93
93
|
declare module 'zlib' {
|
|
94
94
|
import * as stream from 'node:stream';
|