@types/node 18.17.18 → 18.18.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 v18.17 → node v18.18}/README.md +1 -1
- node v18.18/assert/strict.d.ts +8 -0
- {node v18.17/ts4.8 → node v18.18}/assert.d.ts +48 -24
- {node v18.17 → node v18.18}/async_hooks.d.ts +10 -7
- {node v18.17 → node v18.18}/buffer.d.ts +32 -34
- {node v18.17 → node v18.18}/child_process.d.ts +267 -122
- {node v18.17/ts4.8 → node v18.18}/cluster.d.ts +107 -89
- {node v18.17/ts4.8 → node v18.18}/console.d.ts +7 -7
- node v18.18/constants.d.ts +19 -0
- {node v18.17 → node v18.18}/crypto.d.ts +746 -268
- {node v18.17/ts4.8 → node v18.18}/dgram.d.ts +86 -45
- {node v18.17 → node v18.18}/diagnostics_channel.d.ts +3 -3
- {node v18.17 → node v18.18}/dns/promises.d.ts +28 -25
- {node v18.17/ts4.8 → node v18.18}/dns.d.ts +203 -62
- node v18.18/dom-events.d.ts +122 -0
- {node v18.17/ts4.8 → node v18.18}/domain.d.ts +4 -4
- {node v18.17 → node v18.18}/events.d.ts +50 -7
- {node v18.17 → node v18.18}/fs/promises.d.ts +107 -73
- {node v18.17 → node v18.18}/fs.d.ts +513 -311
- {node v18.17 → node v18.18}/globals.d.ts +38 -18
- {node v18.17 → node v18.18}/http.d.ts +185 -185
- {node v18.17 → node v18.18}/http2.d.ts +628 -376
- {node v18.17/ts4.8 → node v18.18}/https.d.ts +107 -105
- {node v18.17 → node v18.18}/index.d.ts +1 -1
- {node v18.17/ts4.8 → node v18.18}/module.d.ts +56 -12
- {node v18.17/ts4.8 → node v18.18}/net.d.ts +123 -99
- {node v18.17/ts4.8 → node v18.18}/os.d.ts +7 -7
- {node v18.17 → node v18.18}/package.json +2 -2
- {node v18.17/ts4.8 → node v18.18}/path.d.ts +13 -13
- {node v18.17/ts4.8 → node v18.18}/perf_hooks.d.ts +20 -19
- {node v18.17/ts4.8 → node v18.18}/process.d.ts +155 -125
- {node v18.17 → node v18.18}/punycode.d.ts +3 -3
- {node v18.17/ts4.8 → node v18.18}/querystring.d.ts +14 -4
- {node v18.17 → node v18.18}/readline/promises.d.ts +5 -5
- {node v18.17/ts4.8 → node v18.18}/readline.d.ts +69 -56
- {node v18.17/ts4.8 → node v18.18}/repl.d.ts +67 -61
- {node v18.17 → node v18.18}/stream/consumers.d.ts +4 -4
- node v18.18/stream/promises.d.ts +83 -0
- {node v18.17 → node v18.18}/stream/web.d.ts +26 -20
- {node v18.17 → node v18.18}/stream.d.ts +361 -226
- {node v18.17/ts4.8 → node v18.18}/string_decoder.d.ts +3 -3
- {node v18.17 → node v18.18}/test.d.ts +131 -131
- {node v18.17 → node v18.18}/timers/promises.d.ts +4 -4
- {node v18.17 → node v18.18}/timers.d.ts +34 -9
- {node v18.17 → node v18.18}/tls.d.ts +151 -71
- {node v18.17/ts4.8 → node v18.18}/trace_events.d.ts +3 -3
- node v18.18/ts4.8/assert/strict.d.ts +8 -0
- {node v18.17 → node v18.18/ts4.8}/assert.d.ts +48 -24
- {node v18.17 → node v18.18}/ts4.8/async_hooks.d.ts +10 -7
- {node v18.17 → node v18.18}/ts4.8/buffer.d.ts +32 -34
- {node v18.17 → node v18.18}/ts4.8/child_process.d.ts +267 -122
- {node v18.17 → node v18.18/ts4.8}/cluster.d.ts +107 -89
- {node v18.17 → node v18.18/ts4.8}/console.d.ts +7 -7
- node v18.18/ts4.8/constants.d.ts +19 -0
- {node v18.17 → node v18.18}/ts4.8/crypto.d.ts +746 -268
- {node v18.17 → node v18.18/ts4.8}/dgram.d.ts +86 -45
- {node v18.17 → node v18.18}/ts4.8/diagnostics_channel.d.ts +3 -3
- {node v18.17 → node v18.18}/ts4.8/dns/promises.d.ts +28 -25
- {node v18.17 → node v18.18/ts4.8}/dns.d.ts +203 -62
- node v18.18/ts4.8/dom-events.d.ts +122 -0
- {node v18.17 → node v18.18/ts4.8}/domain.d.ts +4 -4
- {node v18.17 → node v18.18}/ts4.8/events.d.ts +50 -7
- {node v18.17 → node v18.18}/ts4.8/fs/promises.d.ts +107 -73
- {node v18.17 → node v18.18}/ts4.8/fs.d.ts +514 -312
- {node v18.17 → node v18.18}/ts4.8/globals.d.ts +68 -47
- {node v18.17 → node v18.18}/ts4.8/http.d.ts +185 -185
- {node v18.17 → node v18.18}/ts4.8/http2.d.ts +628 -376
- {node v18.17 → node v18.18/ts4.8}/https.d.ts +107 -105
- {node v18.17 → node v18.18/ts4.8}/module.d.ts +56 -12
- {node v18.17 → node v18.18/ts4.8}/net.d.ts +117 -93
- {node v18.17 → node v18.18/ts4.8}/os.d.ts +7 -7
- {node v18.17 → node v18.18/ts4.8}/path.d.ts +13 -13
- {node v18.17 → node v18.18/ts4.8}/perf_hooks.d.ts +20 -19
- {node v18.17 → node v18.18/ts4.8}/process.d.ts +155 -125
- {node v18.17 → node v18.18}/ts4.8/punycode.d.ts +3 -3
- {node v18.17 → node v18.18/ts4.8}/querystring.d.ts +14 -4
- {node v18.17 → node v18.18}/ts4.8/readline/promises.d.ts +5 -5
- {node v18.17 → node v18.18/ts4.8}/readline.d.ts +69 -56
- {node v18.17 → node v18.18/ts4.8}/repl.d.ts +67 -61
- {node v18.17 → node v18.18}/ts4.8/stream/consumers.d.ts +4 -4
- node v18.18/ts4.8/stream/promises.d.ts +83 -0
- {node v18.17 → node v18.18}/ts4.8/stream/web.d.ts +26 -20
- {node v18.17 → node v18.18}/ts4.8/stream.d.ts +490 -217
- {node v18.17 → node v18.18/ts4.8}/string_decoder.d.ts +3 -3
- {node v18.17 → node v18.18}/ts4.8/test.d.ts +144 -130
- {node v18.17 → node v18.18}/ts4.8/timers/promises.d.ts +4 -4
- {node v18.17 → node v18.18}/ts4.8/timers.d.ts +41 -9
- {node v18.17 → node v18.18}/ts4.8/tls.d.ts +151 -71
- {node v18.17 → node v18.18/ts4.8}/trace_events.d.ts +3 -3
- {node v18.17 → node v18.18}/ts4.8/tty.d.ts +10 -10
- {node v18.17 → node v18.18}/ts4.8/url.d.ts +39 -18
- {node v18.17 → node v18.18}/ts4.8/util.d.ts +178 -117
- {node v18.17 → node v18.18}/ts4.8/v8.d.ts +4 -4
- {node v18.17 → node v18.18}/ts4.8/vm.d.ts +60 -42
- {node v18.17 → node v18.18}/ts4.8/wasi.d.ts +3 -3
- {node v18.17 → node v18.18/ts4.8}/worker_threads.d.ts +82 -85
- {node v18.17 → node v18.18/ts4.8}/zlib.d.ts +9 -9
- {node v18.17 → node v18.18}/tty.d.ts +10 -10
- {node v18.17 → node v18.18}/url.d.ts +39 -18
- {node v18.17 → node v18.18}/util.d.ts +178 -117
- {node v18.17 → node v18.18}/v8.d.ts +4 -4
- {node v18.17 → node v18.18}/vm.d.ts +60 -42
- {node v18.17 → node v18.18}/wasi.d.ts +3 -3
- {node v18.17/ts4.8 → node v18.18}/worker_threads.d.ts +82 -85
- {node v18.17/ts4.8 → node v18.18}/zlib.d.ts +9 -9
- node v18.17/assert/strict.d.ts +0 -8
- node v18.17/constants.d.ts +0 -18
- node v18.17/dom-events.d.ts +0 -126
- node v18.17/stream/promises.d.ts +0 -42
- node v18.17/ts4.8/assert/strict.d.ts +0 -8
- node v18.17/ts4.8/constants.d.ts +0 -18
- node v18.17/ts4.8/dom-events.d.ts +0 -126
- node v18.17/ts4.8/stream/promises.d.ts +0 -42
- {node v18.17 → node v18.18}/LICENSE +0 -0
- {node v18.17 → node v18.18}/globals.global.d.ts +0 -0
- {node v18.17 → node v18.18}/inspector.d.ts +0 -0
- {node v18.17 → node v18.18}/ts4.8/globals.global.d.ts +0 -0
- {node v18.17 → node v18.18}/ts4.8/index.d.ts +0 -0
- {node v18.17 → node v18.18}/ts4.8/inspector.d.ts +0 -0
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
|
-
declare module
|
|
37
|
+
declare module "events" {
|
|
38
38
|
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
|
39
39
|
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
|
40
40
|
// actually starts exporting the class, uncomment below.
|
|
@@ -87,7 +87,7 @@ declare module 'events' {
|
|
|
87
87
|
listener: (...args: any[]) => void,
|
|
88
88
|
opts?: {
|
|
89
89
|
once: boolean;
|
|
90
|
-
}
|
|
90
|
+
},
|
|
91
91
|
): any;
|
|
92
92
|
}
|
|
93
93
|
interface StaticEventEmitterOptions {
|
|
@@ -191,7 +191,11 @@ declare module 'events' {
|
|
|
191
191
|
* ```
|
|
192
192
|
* @since v11.13.0, v10.16.0
|
|
193
193
|
*/
|
|
194
|
-
static once(
|
|
194
|
+
static once(
|
|
195
|
+
emitter: _NodeEventTarget,
|
|
196
|
+
eventName: string | symbol,
|
|
197
|
+
options?: StaticEventEmitterOptions,
|
|
198
|
+
): Promise<any[]>;
|
|
195
199
|
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
196
200
|
/**
|
|
197
201
|
* ```js
|
|
@@ -251,7 +255,11 @@ declare module 'events' {
|
|
|
251
255
|
* @param eventName The name of the event being listened for
|
|
252
256
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
253
257
|
*/
|
|
254
|
-
static on(
|
|
258
|
+
static on(
|
|
259
|
+
emitter: NodeJS.EventEmitter,
|
|
260
|
+
eventName: string,
|
|
261
|
+
options?: StaticEventEmitterOptions,
|
|
262
|
+
): AsyncIterableIterator<any>;
|
|
255
263
|
/**
|
|
256
264
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
257
265
|
*
|
|
@@ -344,6 +352,41 @@ declare module 'events' {
|
|
|
344
352
|
* objects.
|
|
345
353
|
*/
|
|
346
354
|
static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void;
|
|
355
|
+
/**
|
|
356
|
+
* Listens once to the `abort` event on the provided `signal`.
|
|
357
|
+
*
|
|
358
|
+
* Listening to the `abort` event on abort signals is unsafe and may
|
|
359
|
+
* lead to resource leaks since another third party with the signal can
|
|
360
|
+
* call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change
|
|
361
|
+
* this since it would violate the web standard. Additionally, the original
|
|
362
|
+
* API makes it easy to forget to remove listeners.
|
|
363
|
+
*
|
|
364
|
+
* This API allows safely using `AbortSignal`s in Node.js APIs by solving these
|
|
365
|
+
* two issues by listening to the event such that `stopImmediatePropagation` does
|
|
366
|
+
* not prevent the listener from running.
|
|
367
|
+
*
|
|
368
|
+
* Returns a disposable so that it may be unsubscribed from more easily.
|
|
369
|
+
*
|
|
370
|
+
* ```js
|
|
371
|
+
* import { addAbortListener } from 'node:events';
|
|
372
|
+
*
|
|
373
|
+
* function example(signal) {
|
|
374
|
+
* let disposable;
|
|
375
|
+
* try {
|
|
376
|
+
* signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
|
|
377
|
+
* disposable = addAbortListener(signal, (e) => {
|
|
378
|
+
* // Do something when signal is aborted.
|
|
379
|
+
* });
|
|
380
|
+
* } finally {
|
|
381
|
+
* disposable?.[Symbol.dispose]();
|
|
382
|
+
* }
|
|
383
|
+
* }
|
|
384
|
+
* ```
|
|
385
|
+
* @since v18.18.0
|
|
386
|
+
* @experimental
|
|
387
|
+
* @return Disposable that removes the `abort` listener.
|
|
388
|
+
*/
|
|
389
|
+
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
|
347
390
|
/**
|
|
348
391
|
* This symbol shall be used to install a listener for only monitoring `'error'`
|
|
349
392
|
* events. Listeners installed using this symbol are called before the regular
|
|
@@ -362,7 +405,7 @@ declare module 'events' {
|
|
|
362
405
|
static captureRejections: boolean;
|
|
363
406
|
static defaultMaxListeners: number;
|
|
364
407
|
}
|
|
365
|
-
import internal = require(
|
|
408
|
+
import internal = require("node:events");
|
|
366
409
|
namespace EventEmitter {
|
|
367
410
|
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
|
368
411
|
export { internal as EventEmitter };
|
|
@@ -705,7 +748,7 @@ declare module 'events' {
|
|
|
705
748
|
}
|
|
706
749
|
export = EventEmitter;
|
|
707
750
|
}
|
|
708
|
-
declare module
|
|
709
|
-
import events = require(
|
|
751
|
+
declare module "node:events" {
|
|
752
|
+
import events = require("events");
|
|
710
753
|
export = events;
|
|
711
754
|
}
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* concurrent modifications on the same file or data corruption may occur.
|
|
9
9
|
* @since v10.0.0
|
|
10
10
|
*/
|
|
11
|
-
declare module
|
|
12
|
-
import { Abortable } from
|
|
13
|
-
import { Stream } from
|
|
14
|
-
import { ReadableStream } from
|
|
11
|
+
declare module "fs/promises" {
|
|
12
|
+
import { Abortable } from "node:events";
|
|
13
|
+
import { Stream } from "node:stream";
|
|
14
|
+
import { ReadableStream } from "node:stream/web";
|
|
15
15
|
import {
|
|
16
16
|
BigIntStats,
|
|
17
17
|
BigIntStatsFs,
|
|
@@ -30,8 +30,8 @@ declare module 'fs/promises' {
|
|
|
30
30
|
ReadVResult,
|
|
31
31
|
RmDirOptions,
|
|
32
32
|
RmOptions,
|
|
33
|
-
StatOptions,
|
|
34
33
|
StatFsOptions,
|
|
34
|
+
StatOptions,
|
|
35
35
|
Stats,
|
|
36
36
|
StatsFs,
|
|
37
37
|
TimeLike,
|
|
@@ -39,8 +39,8 @@ declare module 'fs/promises' {
|
|
|
39
39
|
WatchOptions,
|
|
40
40
|
WriteStream,
|
|
41
41
|
WriteVResult,
|
|
42
|
-
} from
|
|
43
|
-
import { Interface as ReadlineInterface } from
|
|
42
|
+
} from "node:fs";
|
|
43
|
+
import { Interface as ReadlineInterface } from "node:readline";
|
|
44
44
|
|
|
45
45
|
interface FileChangeInfo<T extends string | Buffer> {
|
|
46
46
|
eventType: WatchEventType;
|
|
@@ -89,7 +89,7 @@ declare module 'fs/promises' {
|
|
|
89
89
|
* Whether to open a normal or a `'bytes'` stream.
|
|
90
90
|
* @since v18.17.0
|
|
91
91
|
*/
|
|
92
|
-
type?:
|
|
92
|
+
type?: "bytes" | undefined;
|
|
93
93
|
}
|
|
94
94
|
// TODO: Add `EventEmitter` close
|
|
95
95
|
interface FileHandle {
|
|
@@ -106,7 +106,10 @@ declare module 'fs/promises' {
|
|
|
106
106
|
* @since v10.0.0
|
|
107
107
|
* @return Fulfills with `undefined` upon success.
|
|
108
108
|
*/
|
|
109
|
-
appendFile(
|
|
109
|
+
appendFile(
|
|
110
|
+
data: string | Uint8Array,
|
|
111
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
112
|
+
): Promise<void>;
|
|
110
113
|
/**
|
|
111
114
|
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
|
112
115
|
* @since v10.0.0
|
|
@@ -223,7 +226,12 @@ declare module 'fs/promises' {
|
|
|
223
226
|
* integer, the current file position will remain unchanged.
|
|
224
227
|
* @return Fulfills upon success with an object with two properties:
|
|
225
228
|
*/
|
|
226
|
-
read<T extends NodeJS.ArrayBufferView>(
|
|
229
|
+
read<T extends NodeJS.ArrayBufferView>(
|
|
230
|
+
buffer: T,
|
|
231
|
+
offset?: number | null,
|
|
232
|
+
length?: number | null,
|
|
233
|
+
position?: number | null,
|
|
234
|
+
): Promise<FileReadResult<T>>;
|
|
227
235
|
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
228
236
|
/**
|
|
229
237
|
* Returns a `ReadableStream` that may be used to read the files data.
|
|
@@ -266,7 +274,7 @@ declare module 'fs/promises' {
|
|
|
266
274
|
options?: {
|
|
267
275
|
encoding?: null | undefined;
|
|
268
276
|
flag?: OpenMode | undefined;
|
|
269
|
-
} | null
|
|
277
|
+
} | null,
|
|
270
278
|
): Promise<Buffer>;
|
|
271
279
|
/**
|
|
272
280
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -277,10 +285,10 @@ declare module 'fs/promises' {
|
|
|
277
285
|
readFile(
|
|
278
286
|
options:
|
|
279
287
|
| {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
| BufferEncoding
|
|
288
|
+
encoding: BufferEncoding;
|
|
289
|
+
flag?: OpenMode | undefined;
|
|
290
|
+
}
|
|
291
|
+
| BufferEncoding,
|
|
284
292
|
): Promise<string>;
|
|
285
293
|
/**
|
|
286
294
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -291,10 +299,10 @@ declare module 'fs/promises' {
|
|
|
291
299
|
readFile(
|
|
292
300
|
options?:
|
|
293
301
|
| (ObjectEncodingOptions & {
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
flag?: OpenMode | undefined;
|
|
303
|
+
})
|
|
296
304
|
| BufferEncoding
|
|
297
|
-
| null
|
|
305
|
+
| null,
|
|
298
306
|
): Promise<string | Buffer>;
|
|
299
307
|
/**
|
|
300
308
|
* Convenience method to create a `readline` interface and stream over the file. For example:
|
|
@@ -320,12 +328,12 @@ declare module 'fs/promises' {
|
|
|
320
328
|
stat(
|
|
321
329
|
opts?: StatOptions & {
|
|
322
330
|
bigint?: false | undefined;
|
|
323
|
-
}
|
|
331
|
+
},
|
|
324
332
|
): Promise<Stats>;
|
|
325
333
|
stat(
|
|
326
334
|
opts: StatOptions & {
|
|
327
335
|
bigint: true;
|
|
328
|
-
}
|
|
336
|
+
},
|
|
329
337
|
): Promise<BigIntStats>;
|
|
330
338
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
331
339
|
/**
|
|
@@ -380,7 +388,10 @@ declare module 'fs/promises' {
|
|
|
380
388
|
* beginning of the file.
|
|
381
389
|
* @since v10.0.0
|
|
382
390
|
*/
|
|
383
|
-
writeFile(
|
|
391
|
+
writeFile(
|
|
392
|
+
data: string | Uint8Array,
|
|
393
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null,
|
|
394
|
+
): Promise<void>;
|
|
384
395
|
/**
|
|
385
396
|
* Write `buffer` to the file.
|
|
386
397
|
*
|
|
@@ -403,7 +414,7 @@ declare module 'fs/promises' {
|
|
|
403
414
|
buffer: TBuffer,
|
|
404
415
|
offset?: number | null,
|
|
405
416
|
length?: number | null,
|
|
406
|
-
position?: number | null
|
|
417
|
+
position?: number | null,
|
|
407
418
|
): Promise<{
|
|
408
419
|
bytesWritten: number;
|
|
409
420
|
buffer: TBuffer;
|
|
@@ -411,7 +422,7 @@ declare module 'fs/promises' {
|
|
|
411
422
|
write(
|
|
412
423
|
data: string,
|
|
413
424
|
position?: number | null,
|
|
414
|
-
encoding?: BufferEncoding | null
|
|
425
|
+
encoding?: BufferEncoding | null,
|
|
415
426
|
): Promise<{
|
|
416
427
|
bytesWritten: number;
|
|
417
428
|
buffer: string;
|
|
@@ -457,6 +468,11 @@ declare module 'fs/promises' {
|
|
|
457
468
|
* @return Fulfills with `undefined` upon success.
|
|
458
469
|
*/
|
|
459
470
|
close(): Promise<void>;
|
|
471
|
+
/**
|
|
472
|
+
* An alias for {@link FileHandle.close()}.
|
|
473
|
+
* @since v18.18.0
|
|
474
|
+
*/
|
|
475
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
460
476
|
}
|
|
461
477
|
|
|
462
478
|
const constants: typeof fsConstants;
|
|
@@ -588,7 +604,7 @@ declare module 'fs/promises' {
|
|
|
588
604
|
path: PathLike,
|
|
589
605
|
options: MakeDirectoryOptions & {
|
|
590
606
|
recursive: true;
|
|
591
|
-
}
|
|
607
|
+
},
|
|
592
608
|
): Promise<string | undefined>;
|
|
593
609
|
/**
|
|
594
610
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -601,9 +617,9 @@ declare module 'fs/promises' {
|
|
|
601
617
|
options?:
|
|
602
618
|
| Mode
|
|
603
619
|
| (MakeDirectoryOptions & {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
| null
|
|
620
|
+
recursive?: false | undefined;
|
|
621
|
+
})
|
|
622
|
+
| null,
|
|
607
623
|
): Promise<void>;
|
|
608
624
|
/**
|
|
609
625
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -640,11 +656,11 @@ declare module 'fs/promises' {
|
|
|
640
656
|
path: PathLike,
|
|
641
657
|
options?:
|
|
642
658
|
| (ObjectEncodingOptions & {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
659
|
+
withFileTypes?: false | undefined;
|
|
660
|
+
recursive?: boolean | undefined;
|
|
661
|
+
})
|
|
646
662
|
| BufferEncoding
|
|
647
|
-
| null
|
|
663
|
+
| null,
|
|
648
664
|
): Promise<string[]>;
|
|
649
665
|
/**
|
|
650
666
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -655,11 +671,11 @@ declare module 'fs/promises' {
|
|
|
655
671
|
path: PathLike,
|
|
656
672
|
options:
|
|
657
673
|
| {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
|
674
|
+
encoding: "buffer";
|
|
675
|
+
withFileTypes?: false | undefined;
|
|
676
|
+
recursive?: boolean | undefined;
|
|
677
|
+
}
|
|
678
|
+
| "buffer",
|
|
663
679
|
): Promise<Buffer[]>;
|
|
664
680
|
/**
|
|
665
681
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -670,11 +686,11 @@ declare module 'fs/promises' {
|
|
|
670
686
|
path: PathLike,
|
|
671
687
|
options?:
|
|
672
688
|
| (ObjectEncodingOptions & {
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
689
|
+
withFileTypes?: false | undefined;
|
|
690
|
+
recursive?: boolean | undefined;
|
|
691
|
+
})
|
|
676
692
|
| BufferEncoding
|
|
677
|
-
| null
|
|
693
|
+
| null,
|
|
678
694
|
): Promise<string[] | Buffer[]>;
|
|
679
695
|
/**
|
|
680
696
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -686,7 +702,7 @@ declare module 'fs/promises' {
|
|
|
686
702
|
options: ObjectEncodingOptions & {
|
|
687
703
|
withFileTypes: true;
|
|
688
704
|
recursive?: boolean | undefined;
|
|
689
|
-
}
|
|
705
|
+
},
|
|
690
706
|
): Promise<Dirent[]>;
|
|
691
707
|
/**
|
|
692
708
|
* Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
|
|
@@ -734,13 +750,13 @@ declare module 'fs/promises' {
|
|
|
734
750
|
path: PathLike,
|
|
735
751
|
opts?: StatOptions & {
|
|
736
752
|
bigint?: false | undefined;
|
|
737
|
-
}
|
|
753
|
+
},
|
|
738
754
|
): Promise<Stats>;
|
|
739
755
|
function lstat(
|
|
740
756
|
path: PathLike,
|
|
741
757
|
opts: StatOptions & {
|
|
742
758
|
bigint: true;
|
|
743
|
-
}
|
|
759
|
+
},
|
|
744
760
|
): Promise<BigIntStats>;
|
|
745
761
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
746
762
|
/**
|
|
@@ -751,13 +767,13 @@ declare module 'fs/promises' {
|
|
|
751
767
|
path: PathLike,
|
|
752
768
|
opts?: StatOptions & {
|
|
753
769
|
bigint?: false | undefined;
|
|
754
|
-
}
|
|
770
|
+
},
|
|
755
771
|
): Promise<Stats>;
|
|
756
772
|
function stat(
|
|
757
773
|
path: PathLike,
|
|
758
774
|
opts: StatOptions & {
|
|
759
775
|
bigint: true;
|
|
760
|
-
}
|
|
776
|
+
},
|
|
761
777
|
): Promise<BigIntStats>;
|
|
762
778
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
763
779
|
/**
|
|
@@ -768,13 +784,13 @@ declare module 'fs/promises' {
|
|
|
768
784
|
path: PathLike,
|
|
769
785
|
opts?: StatFsOptions & {
|
|
770
786
|
bigint?: false | undefined;
|
|
771
|
-
}
|
|
787
|
+
},
|
|
772
788
|
): Promise<StatsFs>;
|
|
773
789
|
function statfs(
|
|
774
790
|
path: PathLike,
|
|
775
791
|
opts: StatFsOptions & {
|
|
776
792
|
bigint: true;
|
|
777
|
-
}
|
|
793
|
+
},
|
|
778
794
|
): Promise<BigIntStatsFs>;
|
|
779
795
|
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
|
|
780
796
|
|
|
@@ -866,7 +882,10 @@ declare module 'fs/promises' {
|
|
|
866
882
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
867
883
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
868
884
|
*/
|
|
869
|
-
function realpath(
|
|
885
|
+
function realpath(
|
|
886
|
+
path: PathLike,
|
|
887
|
+
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
888
|
+
): Promise<string | Buffer>;
|
|
870
889
|
/**
|
|
871
890
|
* Creates a unique temporary directory. A unique directory name is generated by
|
|
872
891
|
* appending six random characters to the end of the provided `prefix`. Due to
|
|
@@ -959,14 +978,19 @@ declare module 'fs/promises' {
|
|
|
959
978
|
*/
|
|
960
979
|
function writeFile(
|
|
961
980
|
file: PathLike | FileHandle,
|
|
962
|
-
data:
|
|
981
|
+
data:
|
|
982
|
+
| string
|
|
983
|
+
| NodeJS.ArrayBufferView
|
|
984
|
+
| Iterable<string | NodeJS.ArrayBufferView>
|
|
985
|
+
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
|
986
|
+
| Stream,
|
|
963
987
|
options?:
|
|
964
988
|
| (ObjectEncodingOptions & {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
989
|
+
mode?: Mode | undefined;
|
|
990
|
+
flag?: OpenMode | undefined;
|
|
991
|
+
} & Abortable)
|
|
968
992
|
| BufferEncoding
|
|
969
|
-
| null
|
|
993
|
+
| null,
|
|
970
994
|
): Promise<void>;
|
|
971
995
|
/**
|
|
972
996
|
* Asynchronously append data to a file, creating the file if it does not yet
|
|
@@ -982,7 +1006,11 @@ declare module 'fs/promises' {
|
|
|
982
1006
|
* @param path filename or {FileHandle}
|
|
983
1007
|
* @return Fulfills with `undefined` upon success.
|
|
984
1008
|
*/
|
|
985
|
-
function appendFile(
|
|
1009
|
+
function appendFile(
|
|
1010
|
+
path: PathLike | FileHandle,
|
|
1011
|
+
data: string | Uint8Array,
|
|
1012
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null,
|
|
1013
|
+
): Promise<void>;
|
|
986
1014
|
/**
|
|
987
1015
|
* Asynchronously reads the entire contents of a file.
|
|
988
1016
|
*
|
|
@@ -1029,10 +1057,10 @@ declare module 'fs/promises' {
|
|
|
1029
1057
|
path: PathLike | FileHandle,
|
|
1030
1058
|
options?:
|
|
1031
1059
|
| ({
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
| null
|
|
1060
|
+
encoding?: null | undefined;
|
|
1061
|
+
flag?: OpenMode | undefined;
|
|
1062
|
+
} & Abortable)
|
|
1063
|
+
| null,
|
|
1036
1064
|
): Promise<Buffer>;
|
|
1037
1065
|
/**
|
|
1038
1066
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1045,10 +1073,10 @@ declare module 'fs/promises' {
|
|
|
1045
1073
|
path: PathLike | FileHandle,
|
|
1046
1074
|
options:
|
|
1047
1075
|
| ({
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
| BufferEncoding
|
|
1076
|
+
encoding: BufferEncoding;
|
|
1077
|
+
flag?: OpenMode | undefined;
|
|
1078
|
+
} & Abortable)
|
|
1079
|
+
| BufferEncoding,
|
|
1052
1080
|
): Promise<string>;
|
|
1053
1081
|
/**
|
|
1054
1082
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1060,12 +1088,15 @@ declare module 'fs/promises' {
|
|
|
1060
1088
|
function readFile(
|
|
1061
1089
|
path: PathLike | FileHandle,
|
|
1062
1090
|
options?:
|
|
1063
|
-
| (
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1091
|
+
| (
|
|
1092
|
+
& ObjectEncodingOptions
|
|
1093
|
+
& Abortable
|
|
1094
|
+
& {
|
|
1095
|
+
flag?: OpenMode | undefined;
|
|
1096
|
+
}
|
|
1097
|
+
)
|
|
1067
1098
|
| BufferEncoding
|
|
1068
|
-
| null
|
|
1099
|
+
| null,
|
|
1069
1100
|
): Promise<string | Buffer>;
|
|
1070
1101
|
/**
|
|
1071
1102
|
* Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
|
|
@@ -1130,9 +1161,9 @@ declare module 'fs/promises' {
|
|
|
1130
1161
|
filename: PathLike,
|
|
1131
1162
|
options:
|
|
1132
1163
|
| (WatchOptions & {
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
|
1164
|
+
encoding: "buffer";
|
|
1165
|
+
})
|
|
1166
|
+
| "buffer",
|
|
1136
1167
|
): AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1137
1168
|
/**
|
|
1138
1169
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
@@ -1151,7 +1182,10 @@ declare module 'fs/promises' {
|
|
|
1151
1182
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
1152
1183
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
1153
1184
|
*/
|
|
1154
|
-
function watch(
|
|
1185
|
+
function watch(
|
|
1186
|
+
filename: PathLike,
|
|
1187
|
+
options: WatchOptions | string,
|
|
1188
|
+
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1155
1189
|
/**
|
|
1156
1190
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
1157
1191
|
* including subdirectories and files.
|
|
@@ -1166,6 +1200,6 @@ declare module 'fs/promises' {
|
|
|
1166
1200
|
*/
|
|
1167
1201
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
|
1168
1202
|
}
|
|
1169
|
-
declare module
|
|
1170
|
-
export * from
|
|
1203
|
+
declare module "node:fs/promises" {
|
|
1204
|
+
export * from "fs/promises";
|
|
1171
1205
|
}
|