@types/node 20.12.7 → 20.12.9
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 +41 -44
- node/async_hooks.d.ts +17 -15
- node/buffer.d.ts +7 -7
- node/child_process.d.ts +1 -1
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +38 -3
- node/dgram.d.ts +13 -13
- node/diagnostics_channel.d.ts +3 -3
- node/dns.d.ts +1 -1
- node/domain.d.ts +4 -4
- node/events.d.ts +29 -37
- node/fs/promises.d.ts +12 -12
- node/fs.d.ts +37 -37
- node/http.d.ts +4 -4
- node/http2.d.ts +77 -47
- node/https.d.ts +1 -1
- node/inspector.d.ts +4 -4
- node/net.d.ts +50 -8
- node/os.d.ts +28 -11
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +3 -3
- node/process.d.ts +214 -43
- node/punycode.d.ts +4 -4
- node/querystring.d.ts +18 -6
- node/readline/promises.d.ts +9 -9
- node/readline.d.ts +21 -20
- node/repl.d.ts +7 -7
- node/stream/web.d.ts +2 -2
- node/stream.d.ts +8 -6
- node/string_decoder.d.ts +3 -3
- node/test.d.ts +25 -23
- node/timers/promises.d.ts +10 -6
- node/timers.d.ts +5 -5
- node/tls.d.ts +39 -32
- node/trace_events.d.ts +40 -25
- node/tty.d.ts +8 -8
- node/url.d.ts +5 -5
- node/util.d.ts +115 -22
- node/v8.d.ts +6 -6
- node/vm.d.ts +35 -17
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +16 -16
- node/zlib.d.ts +16 -3
node/diagnostics_channel.d.ts
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
* should generally include the module name to avoid collisions with data from
|
21
21
|
* other modules.
|
22
22
|
* @since v15.1.0, v14.17.0
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.2
|
23
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/diagnostics_channel.js)
|
24
24
|
*/
|
25
25
|
declare module "diagnostics_channel" {
|
26
26
|
import { AsyncLocalStorage } from "node:async_hooks";
|
@@ -98,7 +98,7 @@ declare module "diagnostics_channel" {
|
|
98
98
|
function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
|
99
99
|
/**
|
100
100
|
* Creates a `TracingChannel` wrapper for the given `TracingChannel Channels`. If a name is given, the corresponding tracing
|
101
|
-
* channels will be created in the form of `tracing:${name}:${eventType}` where`eventType` corresponds to the types of `TracingChannel Channels`.
|
101
|
+
* channels will be created in the form of `tracing:${name}:${eventType}` where `eventType` corresponds to the types of `TracingChannel Channels`.
|
102
102
|
*
|
103
103
|
* ```js
|
104
104
|
* import diagnostics_channel from 'node:diagnostics_channel';
|
@@ -335,7 +335,7 @@ declare module "diagnostics_channel" {
|
|
335
335
|
/**
|
336
336
|
* The class `TracingChannel` is a collection of `TracingChannel Channels` which
|
337
337
|
* together express a single traceable action. It is used to formalize and
|
338
|
-
* simplify the process of producing events for tracing application flow.{@link tracingChannel} is used to construct a`TracingChannel`. As with `Channel` it is recommended to create and reuse a
|
338
|
+
* simplify the process of producing events for tracing application flow. {@link tracingChannel} is used to construct a `TracingChannel`. As with `Channel` it is recommended to create and reuse a
|
339
339
|
* single `TracingChannel` at the top-level of the file rather than creating them
|
340
340
|
* dynamically.
|
341
341
|
* @since v19.9.0
|
node/dns.d.ts
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
* ```
|
43
43
|
*
|
44
44
|
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v20.x/api/dns.html#implementation-considerations) for more information.
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
45
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/dns.js)
|
46
46
|
*/
|
47
47
|
declare module "dns" {
|
48
48
|
import * as dnsPromises from "node:dns/promises";
|
node/domain.d.ts
CHANGED
@@ -9,10 +9,10 @@
|
|
9
9
|
* Domains provide a way to handle multiple different IO operations as a
|
10
10
|
* single group. If any of the event emitters or callbacks registered to a
|
11
11
|
* domain emit an `'error'` event, or throw an error, then the domain object
|
12
|
-
* will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
|
12
|
+
* will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
|
13
13
|
* exit immediately with an error code.
|
14
14
|
* @deprecated Since v1.4.2 - Deprecated
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.2
|
15
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/domain.js)
|
16
16
|
*/
|
17
17
|
declare module "domain" {
|
18
18
|
import EventEmitter = require("node:events");
|
@@ -29,7 +29,7 @@ declare module "domain" {
|
|
29
29
|
*/
|
30
30
|
members: Array<EventEmitter | NodeJS.Timer>;
|
31
31
|
/**
|
32
|
-
* The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly
|
32
|
+
* The `enter()` method is plumbing used by the `run()`, `bind()`, and `intercept()` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly
|
33
33
|
* pushes the domain onto the domain
|
34
34
|
* stack managed by the domain module (see {@link exit} for details on the
|
35
35
|
* domain stack). The call to `enter()` delimits the beginning of a chain of
|
@@ -47,7 +47,7 @@ declare module "domain" {
|
|
47
47
|
* The call to `exit()` delimits either the end of or an interruption to the chain
|
48
48
|
* of asynchronous calls and I/O operations bound to a domain.
|
49
49
|
*
|
50
|
-
* If there are multiple, nested domains bound to the current execution context
|
50
|
+
* If there are multiple, nested domains bound to the current execution context, `exit()` will exit any domains nested within this domain.
|
51
51
|
*
|
52
52
|
* Calling `exit()` changes only the active domain, and does not alter the domain
|
53
53
|
* itself. `enter()` and `exit()` can be called an arbitrary number of times on a
|
node/events.d.ts
CHANGED
@@ -32,7 +32,7 @@
|
|
32
32
|
* });
|
33
33
|
* myEmitter.emit('event');
|
34
34
|
* ```
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.2
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/events.js)
|
36
36
|
*/
|
37
37
|
declare module "events" {
|
38
38
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
@@ -75,16 +75,6 @@ declare module "events" {
|
|
75
75
|
*/
|
76
76
|
captureRejections?: boolean | undefined;
|
77
77
|
}
|
78
|
-
// Any EventTarget with a DOM-style `addEventListener`
|
79
|
-
interface _DOMEventTarget {
|
80
|
-
addEventListener(
|
81
|
-
eventName: string,
|
82
|
-
listener: (...args: any[]) => void,
|
83
|
-
opts?: {
|
84
|
-
once: boolean;
|
85
|
-
},
|
86
|
-
): any;
|
87
|
-
}
|
88
78
|
interface StaticEventEmitterOptions {
|
89
79
|
signal?: AbortSignal | undefined;
|
90
80
|
}
|
@@ -158,7 +148,7 @@ declare module "events" {
|
|
158
148
|
* }
|
159
149
|
* ```
|
160
150
|
*
|
161
|
-
* The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
|
151
|
+
* The special handling of the `'error'` event is only used when `events.once()` is used to wait for another event. If `events.once()` is used to wait for the
|
162
152
|
* '`error'` event itself, then it is treated as any other kind of event without
|
163
153
|
* special handling:
|
164
154
|
*
|
@@ -208,7 +198,7 @@ declare module "events" {
|
|
208
198
|
eventName: string | symbol,
|
209
199
|
options?: StaticEventEmitterOptions,
|
210
200
|
): Promise<any[]>;
|
211
|
-
static once(emitter:
|
201
|
+
static once(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
212
202
|
/**
|
213
203
|
* ```js
|
214
204
|
* import { on, EventEmitter } from 'node:events';
|
@@ -266,7 +256,7 @@ declare module "events" {
|
|
266
256
|
* ```
|
267
257
|
* @since v13.6.0, v12.16.0
|
268
258
|
* @param eventName The name of the event being listened for
|
269
|
-
* @return that iterates `eventName` events emitted by the `emitter`
|
259
|
+
* @return An `AsyncIterator` that iterates `eventName` events emitted by the `emitter`
|
270
260
|
*/
|
271
261
|
static on(
|
272
262
|
emitter: NodeJS.EventEmitter,
|
@@ -274,7 +264,7 @@ declare module "events" {
|
|
274
264
|
options?: StaticEventEmitterOptions,
|
275
265
|
): AsyncIterableIterator<any>;
|
276
266
|
/**
|
277
|
-
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
267
|
+
* A class method that returns the number of listeners for the given `eventName` registered on the given `emitter`.
|
278
268
|
*
|
279
269
|
* ```js
|
280
270
|
* import { EventEmitter, listenerCount } from 'node:events';
|
@@ -318,7 +308,7 @@ declare module "events" {
|
|
318
308
|
* ```
|
319
309
|
* @since v15.2.0, v14.17.0
|
320
310
|
*/
|
321
|
-
static getEventListeners(emitter:
|
311
|
+
static getEventListeners(emitter: EventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
322
312
|
/**
|
323
313
|
* Returns the currently set max amount of listeners.
|
324
314
|
*
|
@@ -347,7 +337,7 @@ declare module "events" {
|
|
347
337
|
* ```
|
348
338
|
* @since v19.9.0
|
349
339
|
*/
|
350
|
-
static getMaxListeners(emitter:
|
340
|
+
static getMaxListeners(emitter: EventTarget | NodeJS.EventEmitter): number;
|
351
341
|
/**
|
352
342
|
* ```js
|
353
343
|
* import { setMaxListeners, EventEmitter } from 'node:events';
|
@@ -362,7 +352,7 @@ declare module "events" {
|
|
362
352
|
* @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
|
363
353
|
* objects.
|
364
354
|
*/
|
365
|
-
static setMaxListeners(n?: number, ...eventTargets: Array<
|
355
|
+
static setMaxListeners(n?: number, ...eventTargets: Array<EventTarget | NodeJS.EventEmitter>): void;
|
366
356
|
/**
|
367
357
|
* Listens once to the `abort` event on the provided `signal`.
|
368
358
|
*
|
@@ -399,9 +389,9 @@ declare module "events" {
|
|
399
389
|
*/
|
400
390
|
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
401
391
|
/**
|
402
|
-
* This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called.
|
392
|
+
* This symbol shall be used to install a listener for only monitoring `'error'` events. Listeners installed using this symbol are called before the regular `'error'` listeners are called.
|
403
393
|
*
|
404
|
-
* Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no
|
394
|
+
* Installing a listener using this symbol does not change the behavior once an `'error'` event is emitted. Therefore, the process will still crash if no
|
405
395
|
* regular `'error'` listener is installed.
|
406
396
|
* @since v13.6.0, v12.17.0
|
407
397
|
*/
|
@@ -424,16 +414,18 @@ declare module "events" {
|
|
424
414
|
* By default, a maximum of `10` listeners can be registered for any single
|
425
415
|
* event. This limit can be changed for individual `EventEmitter` instances
|
426
416
|
* using the `emitter.setMaxListeners(n)` method. To change the default
|
427
|
-
* for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property
|
417
|
+
* for _all_`EventEmitter` instances, the `events.defaultMaxListeners` property
|
418
|
+
* can be used. If this value is not a positive number, a `RangeError` is thrown.
|
428
419
|
*
|
429
420
|
* Take caution when setting the `events.defaultMaxListeners` because the
|
430
|
-
* change affects _all_`EventEmitter` instances, including those created before
|
421
|
+
* change affects _all_ `EventEmitter` instances, including those created before
|
431
422
|
* the change is made. However, calling `emitter.setMaxListeners(n)` still has
|
432
423
|
* precedence over `events.defaultMaxListeners`.
|
433
424
|
*
|
434
425
|
* This is not a hard limit. The `EventEmitter` instance will allow
|
435
426
|
* more listeners to be added but will output a trace warning to stderr indicating
|
436
|
-
* that a "possible EventEmitter memory leak" has been detected. For any single
|
427
|
+
* that a "possible EventEmitter memory leak" has been detected. For any single
|
428
|
+
* `EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()` methods can be used to
|
437
429
|
* temporarily avoid this warning:
|
438
430
|
*
|
439
431
|
* ```js
|
@@ -557,10 +549,10 @@ declare module "events" {
|
|
557
549
|
*/
|
558
550
|
addListener<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
|
559
551
|
/**
|
560
|
-
* Adds the `listener` function to the end of the listeners array for the
|
561
|
-
*
|
562
|
-
*
|
563
|
-
* times.
|
552
|
+
* Adds the `listener` function to the end of the listeners array for the event
|
553
|
+
* named `eventName`. No checks are made to see if the `listener` has already
|
554
|
+
* been added. Multiple calls passing the same combination of `eventName` and
|
555
|
+
* `listener` will result in the `listener` being added, and called, multiple times.
|
564
556
|
*
|
565
557
|
* ```js
|
566
558
|
* server.on('connection', (stream) => {
|
@@ -570,7 +562,7 @@ declare module "events" {
|
|
570
562
|
*
|
571
563
|
* Returns a reference to the `EventEmitter`, so that calls can be chained.
|
572
564
|
*
|
573
|
-
* By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the
|
565
|
+
* By default, event listeners are invoked in the order they are added. The `emitter.prependListener()` method can be used as an alternative to add the
|
574
566
|
* event listener to the beginning of the listeners array.
|
575
567
|
*
|
576
568
|
* ```js
|
@@ -589,7 +581,7 @@ declare module "events" {
|
|
589
581
|
*/
|
590
582
|
on<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
|
591
583
|
/**
|
592
|
-
* Adds a **one-time
|
584
|
+
* Adds a **one-time** `listener` function for the event named `eventName`. The
|
593
585
|
* next time `eventName` is triggered, this listener is removed and then invoked.
|
594
586
|
*
|
595
587
|
* ```js
|
@@ -600,7 +592,7 @@ declare module "events" {
|
|
600
592
|
*
|
601
593
|
* Returns a reference to the `EventEmitter`, so that calls can be chained.
|
602
594
|
*
|
603
|
-
* By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the
|
595
|
+
* By default, event listeners are invoked in the order they are added. The `emitter.prependOnceListener()` method can be used as an alternative to add the
|
604
596
|
* event listener to the beginning of the listeners array.
|
605
597
|
*
|
606
598
|
* ```js
|
@@ -619,7 +611,7 @@ declare module "events" {
|
|
619
611
|
*/
|
620
612
|
once<K>(eventName: Key<K, T>, listener: Listener1<K, T>): this;
|
621
613
|
/**
|
622
|
-
* Removes the specified `listener` from the listener array for the event named`eventName`.
|
614
|
+
* Removes the specified `listener` from the listener array for the event named `eventName`.
|
623
615
|
*
|
624
616
|
* ```js
|
625
617
|
* const callback = (stream) => {
|
@@ -636,7 +628,7 @@ declare module "events" {
|
|
636
628
|
* called multiple times to remove each instance.
|
637
629
|
*
|
638
630
|
* Once an event is emitted, all listeners attached to it at the
|
639
|
-
* time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
|
631
|
+
* time of emitting are called in order. This implies that any `removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
|
640
632
|
* will not remove them from`emit()` in progress. Subsequent events behave as expected.
|
641
633
|
*
|
642
634
|
* ```js
|
@@ -679,7 +671,7 @@ declare module "events" {
|
|
679
671
|
*
|
680
672
|
* When a single function has been added as a handler multiple times for a single
|
681
673
|
* event (as in the example below), `removeListener()` will remove the most
|
682
|
-
* recently added instance. In the example the `once('ping')`listener is removed:
|
674
|
+
* recently added instance. In the example the `once('ping')` listener is removed:
|
683
675
|
*
|
684
676
|
* ```js
|
685
677
|
* import { EventEmitter } from 'node:events';
|
@@ -721,7 +713,7 @@ declare module "events" {
|
|
721
713
|
* By default `EventEmitter`s will print a warning if more than `10` listeners are
|
722
714
|
* added for a particular event. This is a useful default that helps finding
|
723
715
|
* memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
|
724
|
-
* modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
|
716
|
+
* modified for this specific `EventEmitter` instance. The value can be set to `Infinity` (or `0`) to indicate an unlimited number of listeners.
|
725
717
|
*
|
726
718
|
* Returns a reference to the `EventEmitter`, so that calls can be chained.
|
727
719
|
* @since v0.3.5
|
@@ -778,7 +770,7 @@ declare module "events" {
|
|
778
770
|
*/
|
779
771
|
rawListeners<K>(eventName: Key<K, T>): Array<Listener2<K, T>>;
|
780
772
|
/**
|
781
|
-
* Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
|
773
|
+
* Synchronously calls each of the listeners registered for the event named `eventName`, in the order they were registered, passing the supplied arguments
|
782
774
|
* to each.
|
783
775
|
*
|
784
776
|
* Returns `true` if the event had listeners, `false` otherwise.
|
@@ -830,8 +822,8 @@ declare module "events" {
|
|
830
822
|
/**
|
831
823
|
* Adds the `listener` function to the _beginning_ of the listeners array for the
|
832
824
|
* event named `eventName`. No checks are made to see if the `listener` has
|
833
|
-
* already been added. Multiple calls passing the same combination of `eventName`
|
834
|
-
* times.
|
825
|
+
* already been added. Multiple calls passing the same combination of `eventName`
|
826
|
+
* and `listener` will result in the `listener` being added, and called, multiple times.
|
835
827
|
*
|
836
828
|
* ```js
|
837
829
|
* server.prependListener('connection', (stream) => {
|
node/fs/promises.d.ts
CHANGED
@@ -189,7 +189,7 @@ declare module "fs/promises" {
|
|
189
189
|
* replacing it may require the `flags` `open` option to be set to `r+` rather than
|
190
190
|
* the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
|
191
191
|
*
|
192
|
-
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
|
192
|
+
* If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false,
|
193
193
|
* then the file descriptor won't be closed, even if there's an error.
|
194
194
|
* It is the application's responsibility to close it and make sure there's no
|
195
195
|
* file descriptor leak.
|
@@ -268,7 +268,7 @@ declare module "fs/promises" {
|
|
268
268
|
*
|
269
269
|
* The `FileHandle` has to support reading.
|
270
270
|
*
|
271
|
-
* If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current
|
271
|
+
* If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current
|
272
272
|
* position till the end of the file. It doesn't always read from the beginning
|
273
273
|
* of the file.
|
274
274
|
* @since v10.0.0
|
@@ -375,7 +375,7 @@ declare module "fs/promises" {
|
|
375
375
|
*/
|
376
376
|
utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
|
377
377
|
/**
|
378
|
-
* Asynchronously writes data to a file, replacing the file if it already exists
|
378
|
+
* Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an
|
379
379
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
380
380
|
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
381
381
|
* The promise is fulfilled with no arguments upon success.
|
@@ -485,7 +485,7 @@ declare module "fs/promises" {
|
|
485
485
|
/**
|
486
486
|
* Tests a user's permissions for the file or directory specified by `path`.
|
487
487
|
* The `mode` argument is an optional integer that specifies the accessibility
|
488
|
-
* checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK
|
488
|
+
* checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK`
|
489
489
|
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
490
490
|
* possible values of `mode`.
|
491
491
|
*
|
@@ -570,7 +570,7 @@ declare module "fs/promises" {
|
|
570
570
|
*/
|
571
571
|
function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
|
572
572
|
/**
|
573
|
-
* Truncates (shortens or extends the length) of the content at `path` to `len`bytes.
|
573
|
+
* Truncates (shortens or extends the length) of the content at `path` to `len` bytes.
|
574
574
|
* @since v10.0.0
|
575
575
|
* @param [len=0]
|
576
576
|
* @return Fulfills with `undefined` upon success.
|
@@ -580,7 +580,7 @@ declare module "fs/promises" {
|
|
580
580
|
* Removes the directory identified by `path`.
|
581
581
|
*
|
582
582
|
* Using `fsPromises.rmdir()` on a file (not a directory) results in the
|
583
|
-
* promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX.
|
583
|
+
* promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX.
|
584
584
|
*
|
585
585
|
* To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`.
|
586
586
|
* @since v10.0.0
|
@@ -597,7 +597,7 @@ declare module "fs/promises" {
|
|
597
597
|
* Asynchronously creates a directory.
|
598
598
|
*
|
599
599
|
* The optional `options` argument can be an integer specifying `mode` (permission
|
600
|
-
* and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory
|
600
|
+
* and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fsPromises.mkdir()` when `path` is a directory
|
601
601
|
* that exists results in a
|
602
602
|
* rejection only when `recursive` is false.
|
603
603
|
*
|
@@ -747,7 +747,7 @@ declare module "fs/promises" {
|
|
747
747
|
/**
|
748
748
|
* Creates a symbolic link.
|
749
749
|
*
|
750
|
-
* The `type` argument is only used on Windows platforms and can be one of `'dir'
|
750
|
+
* The `type` argument is only used on Windows platforms and can be one of `'dir'`, `'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will
|
751
751
|
* autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not
|
752
752
|
* exist, `'file'` will be used. Windows junction points require the destination
|
753
753
|
* path to be absolute. When using `'junction'`, the `target` argument will
|
@@ -867,13 +867,13 @@ declare module "fs/promises" {
|
|
867
867
|
*
|
868
868
|
* * Values can be either numbers representing Unix epoch time, `Date`s, or a
|
869
869
|
* numeric string like `'123456789.0'`.
|
870
|
-
* * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown.
|
870
|
+
* * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown.
|
871
871
|
* @since v10.0.0
|
872
872
|
* @return Fulfills with `undefined` upon success.
|
873
873
|
*/
|
874
874
|
function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
|
875
875
|
/**
|
876
|
-
* Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
|
876
|
+
* Determines the actual location of `path` using the same semantics as the `fs.realpath.native()` function.
|
877
877
|
*
|
878
878
|
* Only paths that can be converted to UTF8 strings are supported.
|
879
879
|
*
|
@@ -927,7 +927,7 @@ declare module "fs/promises" {
|
|
927
927
|
* ```
|
928
928
|
*
|
929
929
|
* The `fsPromises.mkdtemp()` method will append the six randomly selected
|
930
|
-
* characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing
|
930
|
+
* characters directly to the `prefix` string. For instance, given a directory `/tmp`, if the intention is to create a temporary directory _within_ `/tmp`, the `prefix` must end with a trailing
|
931
931
|
* platform-specific path separator
|
932
932
|
* (`require('node:path').sep`).
|
933
933
|
* @since v10.0.0
|
@@ -947,7 +947,7 @@ declare module "fs/promises" {
|
|
947
947
|
*/
|
948
948
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
949
949
|
/**
|
950
|
-
* Asynchronously writes data to a file, replacing the file if it already exists
|
950
|
+
* Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an
|
951
951
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
952
952
|
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
953
953
|
*
|