node-red-contrib-tak-registration 0.11.1 → 0.11.5
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.
- package/node_modules/@types/node/LICENSE +0 -0
- package/node_modules/@types/node/README.md +4 -5
- package/node_modules/@types/node/assert/strict.d.ts +4 -4
- package/node_modules/@types/node/assert.d.ts +50 -26
- package/node_modules/@types/node/async_hooks.d.ts +13 -6
- package/node_modules/@types/node/buffer.d.ts +46 -38
- package/node_modules/@types/node/child_process.d.ts +278 -138
- package/node_modules/@types/node/cluster.d.ts +107 -89
- package/node_modules/@types/node/console.d.ts +18 -15
- package/node_modules/@types/node/constants.d.ts +12 -11
- package/node_modules/@types/node/crypto.d.ts +746 -268
- package/node_modules/@types/node/dgram.d.ts +82 -46
- package/node_modules/@types/node/diagnostics_channel.d.ts +3 -3
- package/node_modules/@types/node/dns/promises.d.ts +37 -26
- package/node_modules/@types/node/dns.d.ts +204 -63
- package/node_modules/@types/node/dom-events.d.ts +67 -71
- package/node_modules/@types/node/domain.d.ts +4 -4
- package/node_modules/@types/node/events.d.ts +99 -8
- package/node_modules/@types/node/fs/promises.d.ts +122 -85
- package/node_modules/@types/node/fs.d.ts +520 -316
- package/node_modules/@types/node/globals.d.ts +346 -286
- package/node_modules/@types/node/globals.global.d.ts +0 -0
- package/node_modules/@types/node/http.d.ts +321 -189
- package/node_modules/@types/node/http2.d.ts +630 -377
- package/node_modules/@types/node/https.d.ts +221 -112
- package/node_modules/@types/node/index.d.ts +0 -45
- package/node_modules/@types/node/inspector.d.ts +0 -1
- package/node_modules/@types/node/module.d.ts +75 -31
- package/node_modules/@types/node/net.d.ts +149 -93
- package/node_modules/@types/node/os.d.ts +10 -9
- package/node_modules/@types/node/package.json +88 -90
- package/node_modules/@types/node/path.d.ts +13 -13
- package/node_modules/@types/node/perf_hooks.d.ts +19 -18
- package/node_modules/@types/node/process.d.ts +170 -126
- package/node_modules/@types/node/punycode.d.ts +4 -4
- package/node_modules/@types/node/querystring.d.ts +14 -4
- package/node_modules/@types/node/readline/promises.d.ts +12 -7
- package/node_modules/@types/node/readline.d.ts +69 -56
- package/node_modules/@types/node/repl.d.ts +67 -61
- package/node_modules/@types/node/stream/consumers.d.ts +10 -10
- package/node_modules/@types/node/stream/promises.d.ts +56 -15
- package/node_modules/@types/node/stream/web.d.ts +40 -20
- package/node_modules/@types/node/stream.d.ts +365 -232
- package/node_modules/@types/node/string_decoder.d.ts +8 -8
- package/node_modules/@types/node/test.d.ts +133 -212
- package/node_modules/@types/node/timers/promises.d.ts +4 -4
- package/node_modules/@types/node/timers.d.ts +26 -11
- package/node_modules/@types/node/tls.d.ts +152 -72
- package/node_modules/@types/node/trace_events.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/assert.d.ts +50 -26
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +13 -6
- package/node_modules/@types/node/ts4.8/buffer.d.ts +47 -39
- package/node_modules/@types/node/ts4.8/child_process.d.ts +278 -138
- package/node_modules/@types/node/ts4.8/cluster.d.ts +107 -89
- package/node_modules/@types/node/ts4.8/console.d.ts +18 -15
- package/node_modules/@types/node/ts4.8/constants.d.ts +12 -11
- package/node_modules/@types/node/ts4.8/crypto.d.ts +746 -268
- package/node_modules/@types/node/ts4.8/dgram.d.ts +82 -46
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +37 -26
- package/node_modules/@types/node/ts4.8/dns.d.ts +204 -63
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +67 -71
- package/node_modules/@types/node/ts4.8/domain.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/events.d.ts +99 -8
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +122 -85
- package/node_modules/@types/node/ts4.8/fs.d.ts +520 -316
- package/node_modules/@types/node/ts4.8/globals.d.ts +346 -286
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -0
- package/node_modules/@types/node/ts4.8/http.d.ts +321 -189
- package/node_modules/@types/node/ts4.8/http2.d.ts +630 -377
- package/node_modules/@types/node/ts4.8/https.d.ts +221 -112
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -0
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/module.d.ts +75 -31
- package/node_modules/@types/node/ts4.8/net.d.ts +149 -93
- package/node_modules/@types/node/ts4.8/os.d.ts +10 -9
- package/node_modules/@types/node/ts4.8/path.d.ts +13 -13
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +19 -18
- package/node_modules/@types/node/ts4.8/process.d.ts +170 -126
- package/node_modules/@types/node/ts4.8/punycode.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/querystring.d.ts +14 -4
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +12 -7
- package/node_modules/@types/node/ts4.8/readline.d.ts +69 -56
- package/node_modules/@types/node/ts4.8/repl.d.ts +67 -61
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +10 -10
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +56 -15
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +40 -20
- package/node_modules/@types/node/ts4.8/stream.d.ts +494 -223
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +8 -8
- package/node_modules/@types/node/ts4.8/test.d.ts +135 -214
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/timers.d.ts +26 -11
- package/node_modules/@types/node/ts4.8/tls.d.ts +152 -72
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +3 -3
- package/node_modules/@types/node/ts4.8/tty.d.ts +10 -10
- package/node_modules/@types/node/ts4.8/url.d.ts +26 -14
- package/node_modules/@types/node/ts4.8/util.d.ts +187 -120
- package/node_modules/@types/node/ts4.8/v8.d.ts +4 -4
- package/node_modules/@types/node/ts4.8/vm.d.ts +58 -50
- package/node_modules/@types/node/ts4.8/wasi.d.ts +10 -4
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +83 -86
- package/node_modules/@types/node/ts4.8/zlib.d.ts +9 -9
- package/node_modules/@types/node/tty.d.ts +10 -10
- package/node_modules/@types/node/url.d.ts +26 -14
- package/node_modules/@types/node/util.d.ts +187 -120
- package/node_modules/@types/node/v8.d.ts +4 -4
- package/node_modules/@types/node/vm.d.ts +58 -50
- package/node_modules/@types/node/wasi.d.ts +10 -4
- package/node_modules/@types/node/worker_threads.d.ts +83 -86
- package/node_modules/@types/node/zlib.d.ts +9 -9
- package/node_modules/axios/CHANGELOG.md +225 -0
- package/node_modules/axios/README.md +273 -9
- package/node_modules/axios/dist/axios.js +249 -178
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +213 -193
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +213 -193
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +297 -213
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +20 -11
- package/node_modules/axios/index.d.ts +21 -12
- package/node_modules/axios/lib/adapters/adapters.js +33 -15
- package/node_modules/axios/lib/adapters/http.js +25 -12
- package/node_modules/axios/lib/adapters/xhr.js +17 -10
- package/node_modules/axios/lib/core/mergeConfig.js +1 -0
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +39 -49
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +2 -2
- package/node_modules/axios/lib/platform/browser/index.js +0 -51
- package/node_modules/axios/lib/platform/common/utils.js +47 -0
- package/node_modules/axios/lib/platform/index.js +5 -1
- package/node_modules/axios/package.json +2 -1
- package/node_modules/call-bind/.eslintrc +0 -1
- package/node_modules/call-bind/.nycrc +0 -4
- package/node_modules/call-bind/CHANGELOG.md +35 -0
- package/node_modules/call-bind/README.md +63 -1
- package/node_modules/call-bind/index.js +10 -13
- package/node_modules/call-bind/package.json +33 -23
- package/node_modules/call-bind/test/callBound.js +0 -1
- package/node_modules/call-bind/test/index.js +18 -4
- package/node_modules/{function-bind → deep-equal}/.editorconfig +1 -1
- package/node_modules/deep-equal/.eslintrc +6 -0
- package/node_modules/deep-equal/.nycrc +17 -0
- package/node_modules/deep-equal/CHANGELOG.md +204 -4
- package/node_modules/deep-equal/assert.js +3 -0
- package/node_modules/deep-equal/package.json +39 -17
- package/node_modules/deep-equal/readme.markdown +28 -12
- package/node_modules/deep-equal/test/_tape.js +24 -3
- package/node_modules/deep-equal/test/cmp.js +1047 -48
- package/node_modules/define-data-property/CHANGELOG.md +10 -0
- package/node_modules/define-data-property/index.d.ts.map +1 -1
- package/node_modules/define-data-property/index.js +8 -0
- package/node_modules/define-data-property/package.json +11 -9
- package/node_modules/define-data-property/test/index.js +6 -11
- package/node_modules/define-data-property/tsconfig.json +1 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +11 -0
- package/node_modules/fast-xml-parser/package.json +5 -5
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +1 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +4 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +6 -3
- package/node_modules/follow-redirects/index.js +16 -4
- package/node_modules/follow-redirects/package.json +2 -3
- package/node_modules/function-bind/.eslintrc +11 -5
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/README.md +25 -27
- package/node_modules/function-bind/implementation.js +44 -12
- package/node_modules/function-bind/package.json +38 -14
- package/node_modules/get-intrinsic/CHANGELOG.md +8 -0
- package/node_modules/get-intrinsic/index.js +1 -1
- package/node_modules/get-intrinsic/package.json +11 -11
- package/node_modules/has-property-descriptors/CHANGELOG.md +11 -0
- package/node_modules/has-property-descriptors/package.json +13 -6
- package/node_modules/hasown/.eslintrc +5 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +20 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.d.ts.map +1 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +49 -0
- package/node_modules/set-function-length/.eslintrc +27 -0
- package/node_modules/set-function-length/.github/FUNDING.yml +12 -0
- package/node_modules/set-function-length/.nycrc +13 -0
- package/node_modules/set-function-length/CHANGELOG.md +41 -0
- package/node_modules/set-function-length/LICENSE +21 -0
- package/node_modules/set-function-length/README.md +56 -0
- package/node_modules/set-function-length/env.js +19 -0
- package/node_modules/set-function-length/index.js +41 -0
- package/node_modules/set-function-length/package.json +84 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +97 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/node_modules/undici-types/errors.d.ts +128 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +9 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +63 -0
- package/node_modules/undici-types/interceptors.d.ts +5 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +71 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +28 -0
- package/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/node_modules/undici-types/readable.d.ts +61 -0
- package/node_modules/undici-types/webidl.d.ts +220 -0
- package/node_modules/undici-types/websocket.d.ts +131 -0
- package/package.json +3 -3
- package/tak-ingest.js +42 -23
- package/tak-registration.html +4 -4
- package/node_modules/define-data-property/tsinit +0 -109
- package/node_modules/function-bind/.jscs.json +0 -176
- package/node_modules/function-bind/.npmignore +0 -22
- package/node_modules/function-bind/.travis.yml +0 -168
- package/node_modules/has/LICENSE-MIT +0 -22
- package/node_modules/has/README.md +0 -18
- package/node_modules/has/package.json +0 -48
- package/node_modules/has/src/index.js +0 -5
- package/node_modules/has/test/index.js +0 -10
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
* ```
|
|
35
35
|
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js)
|
|
36
36
|
*/
|
|
37
|
-
declare module
|
|
37
|
+
declare module "events" {
|
|
38
|
+
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
|
38
39
|
// NOTE: This class is in the docs but is **not actually exported** by Node.
|
|
39
40
|
// If https://github.com/nodejs/node/issues/39903 gets resolved and Node
|
|
40
41
|
// actually starts exporting the class, uncomment below.
|
|
@@ -85,7 +86,7 @@ declare module 'events' {
|
|
|
85
86
|
listener: (...args: any[]) => void,
|
|
86
87
|
opts?: {
|
|
87
88
|
once: boolean;
|
|
88
|
-
}
|
|
89
|
+
},
|
|
89
90
|
): any;
|
|
90
91
|
}
|
|
91
92
|
interface StaticEventEmitterOptions {
|
|
@@ -107,6 +108,9 @@ declare module 'events' {
|
|
|
107
108
|
*/
|
|
108
109
|
class EventEmitter {
|
|
109
110
|
constructor(options?: EventEmitterOptions);
|
|
111
|
+
|
|
112
|
+
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
113
|
+
|
|
110
114
|
/**
|
|
111
115
|
* Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
|
112
116
|
* event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
|
@@ -186,7 +190,11 @@ declare module 'events' {
|
|
|
186
190
|
* ```
|
|
187
191
|
* @since v11.13.0, v10.16.0
|
|
188
192
|
*/
|
|
189
|
-
static once(
|
|
193
|
+
static once(
|
|
194
|
+
emitter: _NodeEventTarget,
|
|
195
|
+
eventName: string | symbol,
|
|
196
|
+
options?: StaticEventEmitterOptions,
|
|
197
|
+
): Promise<any[]>;
|
|
190
198
|
static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
191
199
|
/**
|
|
192
200
|
* ```js
|
|
@@ -247,7 +255,11 @@ declare module 'events' {
|
|
|
247
255
|
* @param eventName The name of the event being listened for
|
|
248
256
|
* @return that iterates `eventName` events emitted by the `emitter`
|
|
249
257
|
*/
|
|
250
|
-
static on(
|
|
258
|
+
static on(
|
|
259
|
+
emitter: NodeJS.EventEmitter,
|
|
260
|
+
eventName: string,
|
|
261
|
+
options?: StaticEventEmitterOptions,
|
|
262
|
+
): AsyncIterableIterator<any>;
|
|
251
263
|
/**
|
|
252
264
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
|
253
265
|
*
|
|
@@ -370,7 +382,7 @@ declare module 'events' {
|
|
|
370
382
|
* ```
|
|
371
383
|
* @since v20.5.0
|
|
372
384
|
* @experimental
|
|
373
|
-
* @return that removes the `abort` listener.
|
|
385
|
+
* @return Disposable that removes the `abort` listener.
|
|
374
386
|
*/
|
|
375
387
|
static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable;
|
|
376
388
|
/**
|
|
@@ -433,7 +445,7 @@ declare module 'events' {
|
|
|
433
445
|
*/
|
|
434
446
|
static defaultMaxListeners: number;
|
|
435
447
|
}
|
|
436
|
-
import internal = require(
|
|
448
|
+
import internal = require("node:events");
|
|
437
449
|
namespace EventEmitter {
|
|
438
450
|
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
|
439
451
|
export { internal as EventEmitter };
|
|
@@ -443,10 +455,89 @@ declare module 'events' {
|
|
|
443
455
|
*/
|
|
444
456
|
signal?: AbortSignal | undefined;
|
|
445
457
|
}
|
|
458
|
+
|
|
459
|
+
export interface EventEmitterReferencingAsyncResource extends AsyncResource {
|
|
460
|
+
readonly eventEmitter: EventEmitterAsyncResource;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface EventEmitterAsyncResourceOptions extends AsyncResourceOptions, EventEmitterOptions {
|
|
464
|
+
/**
|
|
465
|
+
* The type of async event, this is required when instantiating `EventEmitterAsyncResource`
|
|
466
|
+
* directly rather than as a child class.
|
|
467
|
+
* @default new.target.name if instantiated as a child class.
|
|
468
|
+
*/
|
|
469
|
+
name?: string;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Integrates `EventEmitter` with `AsyncResource` for `EventEmitter`s that
|
|
474
|
+
* require manual async tracking. Specifically, all events emitted by instances
|
|
475
|
+
* of `events.EventEmitterAsyncResource` will run within its `async context`.
|
|
476
|
+
*
|
|
477
|
+
* ```js
|
|
478
|
+
* import { EventEmitterAsyncResource, EventEmitter } from 'node:events';
|
|
479
|
+
* import { notStrictEqual, strictEqual } from 'node:assert';
|
|
480
|
+
* import { executionAsyncId, triggerAsyncId } from 'node:async_hooks';
|
|
481
|
+
*
|
|
482
|
+
* // Async tracking tooling will identify this as 'Q'.
|
|
483
|
+
* const ee1 = new EventEmitterAsyncResource({ name: 'Q' });
|
|
484
|
+
*
|
|
485
|
+
* // 'foo' listeners will run in the EventEmitters async context.
|
|
486
|
+
* ee1.on('foo', () => {
|
|
487
|
+
* strictEqual(executionAsyncId(), ee1.asyncId);
|
|
488
|
+
* strictEqual(triggerAsyncId(), ee1.triggerAsyncId);
|
|
489
|
+
* });
|
|
490
|
+
*
|
|
491
|
+
* const ee2 = new EventEmitter();
|
|
492
|
+
*
|
|
493
|
+
* // 'foo' listeners on ordinary EventEmitters that do not track async
|
|
494
|
+
* // context, however, run in the same async context as the emit().
|
|
495
|
+
* ee2.on('foo', () => {
|
|
496
|
+
* notStrictEqual(executionAsyncId(), ee2.asyncId);
|
|
497
|
+
* notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);
|
|
498
|
+
* });
|
|
499
|
+
*
|
|
500
|
+
* Promise.resolve().then(() => {
|
|
501
|
+
* ee1.emit('foo');
|
|
502
|
+
* ee2.emit('foo');
|
|
503
|
+
* });
|
|
504
|
+
* ```
|
|
505
|
+
*
|
|
506
|
+
* The `EventEmitterAsyncResource` class has the same methods and takes the
|
|
507
|
+
* same options as `EventEmitter` and `AsyncResource` themselves.
|
|
508
|
+
* @since v17.4.0, v16.14.0
|
|
509
|
+
*/
|
|
510
|
+
export class EventEmitterAsyncResource extends EventEmitter {
|
|
511
|
+
/**
|
|
512
|
+
* @param options Only optional in child class.
|
|
513
|
+
*/
|
|
514
|
+
constructor(options?: EventEmitterAsyncResourceOptions);
|
|
515
|
+
/**
|
|
516
|
+
* Call all `destroy` hooks. This should only ever be called once. An error will
|
|
517
|
+
* be thrown if it is called more than once. This **must** be manually called. If
|
|
518
|
+
* the resource is left to be collected by the GC then the `destroy` hooks will
|
|
519
|
+
* never be called.
|
|
520
|
+
*/
|
|
521
|
+
emitDestroy(): void;
|
|
522
|
+
/**
|
|
523
|
+
* The unique `asyncId` assigned to the resource.
|
|
524
|
+
*/
|
|
525
|
+
readonly asyncId: number;
|
|
526
|
+
/**
|
|
527
|
+
* The same triggerAsyncId that is passed to the AsyncResource constructor.
|
|
528
|
+
*/
|
|
529
|
+
readonly triggerAsyncId: number;
|
|
530
|
+
/**
|
|
531
|
+
* The returned `AsyncResource` object has an additional `eventEmitter` property
|
|
532
|
+
* that provides a reference to this `EventEmitterAsyncResource`.
|
|
533
|
+
*/
|
|
534
|
+
readonly asyncResource: EventEmitterReferencingAsyncResource;
|
|
535
|
+
}
|
|
446
536
|
}
|
|
447
537
|
global {
|
|
448
538
|
namespace NodeJS {
|
|
449
539
|
interface EventEmitter {
|
|
540
|
+
[EventEmitter.captureRejectionSymbol]?(error: Error, event: string, ...args: any[]): void;
|
|
450
541
|
/**
|
|
451
542
|
* Alias for `emitter.on(eventName, listener)`.
|
|
452
543
|
* @since v0.1.26
|
|
@@ -782,7 +873,7 @@ declare module 'events' {
|
|
|
782
873
|
}
|
|
783
874
|
export = EventEmitter;
|
|
784
875
|
}
|
|
785
|
-
declare module
|
|
786
|
-
import events = require(
|
|
876
|
+
declare module "node:events" {
|
|
877
|
+
import events = require("events");
|
|
787
878
|
export = events;
|
|
788
879
|
}
|
|
@@ -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
|
interface FileChangeInfo<T extends string | Buffer> {
|
|
45
45
|
eventType: WatchEventType;
|
|
46
46
|
filename: T | null;
|
|
@@ -81,13 +81,15 @@ declare module 'fs/promises' {
|
|
|
81
81
|
autoClose?: boolean | undefined;
|
|
82
82
|
emitClose?: boolean | undefined;
|
|
83
83
|
start?: number | undefined;
|
|
84
|
+
highWaterMark?: number | undefined;
|
|
85
|
+
flush?: boolean | undefined;
|
|
84
86
|
}
|
|
85
87
|
interface ReadableWebStreamOptions {
|
|
86
88
|
/**
|
|
87
89
|
* Whether to open a normal or a `'bytes'` stream.
|
|
88
90
|
* @since v20.0.0
|
|
89
91
|
*/
|
|
90
|
-
type?:
|
|
92
|
+
type?: "bytes" | undefined;
|
|
91
93
|
}
|
|
92
94
|
// TODO: Add `EventEmitter` close
|
|
93
95
|
interface FileHandle {
|
|
@@ -104,7 +106,13 @@ declare module 'fs/promises' {
|
|
|
104
106
|
* @since v10.0.0
|
|
105
107
|
* @return Fulfills with `undefined` upon success.
|
|
106
108
|
*/
|
|
107
|
-
appendFile(
|
|
109
|
+
appendFile(
|
|
110
|
+
data: string | Uint8Array,
|
|
111
|
+
options?:
|
|
112
|
+
| (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined })
|
|
113
|
+
| BufferEncoding
|
|
114
|
+
| null,
|
|
115
|
+
): Promise<void>;
|
|
108
116
|
/**
|
|
109
117
|
* Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
|
|
110
118
|
* @since v10.0.0
|
|
@@ -221,7 +229,12 @@ declare module 'fs/promises' {
|
|
|
221
229
|
* integer, the current file position will remain unchanged.
|
|
222
230
|
* @return Fulfills upon success with an object with two properties:
|
|
223
231
|
*/
|
|
224
|
-
read<T extends NodeJS.ArrayBufferView>(
|
|
232
|
+
read<T extends NodeJS.ArrayBufferView>(
|
|
233
|
+
buffer: T,
|
|
234
|
+
offset?: number | null,
|
|
235
|
+
length?: number | null,
|
|
236
|
+
position?: number | null,
|
|
237
|
+
): Promise<FileReadResult<T>>;
|
|
225
238
|
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
|
|
226
239
|
/**
|
|
227
240
|
* Returns a `ReadableStream` that may be used to read the files data.
|
|
@@ -266,7 +279,7 @@ declare module 'fs/promises' {
|
|
|
266
279
|
options?: {
|
|
267
280
|
encoding?: null | undefined;
|
|
268
281
|
flag?: OpenMode | undefined;
|
|
269
|
-
} | null
|
|
282
|
+
} | null,
|
|
270
283
|
): Promise<Buffer>;
|
|
271
284
|
/**
|
|
272
285
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -277,10 +290,10 @@ declare module 'fs/promises' {
|
|
|
277
290
|
readFile(
|
|
278
291
|
options:
|
|
279
292
|
| {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
| BufferEncoding
|
|
293
|
+
encoding: BufferEncoding;
|
|
294
|
+
flag?: OpenMode | undefined;
|
|
295
|
+
}
|
|
296
|
+
| BufferEncoding,
|
|
284
297
|
): Promise<string>;
|
|
285
298
|
/**
|
|
286
299
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
@@ -291,10 +304,10 @@ declare module 'fs/promises' {
|
|
|
291
304
|
readFile(
|
|
292
305
|
options?:
|
|
293
306
|
| (ObjectEncodingOptions & {
|
|
294
|
-
|
|
295
|
-
|
|
307
|
+
flag?: OpenMode | undefined;
|
|
308
|
+
})
|
|
296
309
|
| BufferEncoding
|
|
297
|
-
| null
|
|
310
|
+
| null,
|
|
298
311
|
): Promise<string | Buffer>;
|
|
299
312
|
/**
|
|
300
313
|
* Convenience method to create a `readline` interface and stream over the file.
|
|
@@ -319,12 +332,12 @@ declare module 'fs/promises' {
|
|
|
319
332
|
stat(
|
|
320
333
|
opts?: StatOptions & {
|
|
321
334
|
bigint?: false | undefined;
|
|
322
|
-
}
|
|
335
|
+
},
|
|
323
336
|
): Promise<Stats>;
|
|
324
337
|
stat(
|
|
325
338
|
opts: StatOptions & {
|
|
326
339
|
bigint: true;
|
|
327
|
-
}
|
|
340
|
+
},
|
|
328
341
|
): Promise<BigIntStats>;
|
|
329
342
|
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
330
343
|
/**
|
|
@@ -357,7 +370,7 @@ declare module 'fs/promises' {
|
|
|
357
370
|
*/
|
|
358
371
|
truncate(len?: number): Promise<void>;
|
|
359
372
|
/**
|
|
360
|
-
* Change the file system timestamps of the object referenced by the `FileHandle` then
|
|
373
|
+
* Change the file system timestamps of the object referenced by the `FileHandle` then fulfills the promise with no arguments upon success.
|
|
361
374
|
* @since v10.0.0
|
|
362
375
|
*/
|
|
363
376
|
utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
|
|
@@ -365,28 +378,34 @@ declare module 'fs/promises' {
|
|
|
365
378
|
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
366
379
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
|
367
380
|
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
|
|
368
|
-
* The promise is
|
|
381
|
+
* The promise is fulfilled with no arguments upon success.
|
|
369
382
|
*
|
|
370
383
|
* If `options` is a string, then it specifies the `encoding`.
|
|
371
384
|
*
|
|
372
385
|
* The `FileHandle` has to support writing.
|
|
373
386
|
*
|
|
374
387
|
* It is unsafe to use `filehandle.writeFile()` multiple times on the same file
|
|
375
|
-
* without waiting for the promise to be
|
|
388
|
+
* without waiting for the promise to be fulfilled (or rejected).
|
|
376
389
|
*
|
|
377
390
|
* If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
|
|
378
391
|
* current position till the end of the file. It doesn't always write from the
|
|
379
392
|
* beginning of the file.
|
|
380
393
|
* @since v10.0.0
|
|
381
394
|
*/
|
|
382
|
-
writeFile(
|
|
395
|
+
writeFile(
|
|
396
|
+
data: string | Uint8Array,
|
|
397
|
+
options?:
|
|
398
|
+
| (ObjectEncodingOptions & FlagAndOpenMode & Abortable & { flush?: boolean | undefined })
|
|
399
|
+
| BufferEncoding
|
|
400
|
+
| null,
|
|
401
|
+
): Promise<void>;
|
|
383
402
|
/**
|
|
384
403
|
* Write `buffer` to the file.
|
|
385
404
|
*
|
|
386
|
-
* The promise is
|
|
405
|
+
* The promise is fulfilled with an object containing two properties:
|
|
387
406
|
*
|
|
388
407
|
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
|
389
|
-
* without waiting for the promise to be
|
|
408
|
+
* without waiting for the promise to be fulfilled (or rejected). For this
|
|
390
409
|
* scenario, use `filehandle.createWriteStream()`.
|
|
391
410
|
*
|
|
392
411
|
* On Linux, positional writes do not work when the file is opened in append mode.
|
|
@@ -402,7 +421,7 @@ declare module 'fs/promises' {
|
|
|
402
421
|
buffer: TBuffer,
|
|
403
422
|
offset?: number | null,
|
|
404
423
|
length?: number | null,
|
|
405
|
-
position?: number | null
|
|
424
|
+
position?: number | null,
|
|
406
425
|
): Promise<{
|
|
407
426
|
bytesWritten: number;
|
|
408
427
|
buffer: TBuffer;
|
|
@@ -410,7 +429,7 @@ declare module 'fs/promises' {
|
|
|
410
429
|
write(
|
|
411
430
|
data: string,
|
|
412
431
|
position?: number | null,
|
|
413
|
-
encoding?: BufferEncoding | null
|
|
432
|
+
encoding?: BufferEncoding | null,
|
|
414
433
|
): Promise<{
|
|
415
434
|
bytesWritten: number;
|
|
416
435
|
buffer: string;
|
|
@@ -418,10 +437,10 @@ declare module 'fs/promises' {
|
|
|
418
437
|
/**
|
|
419
438
|
* Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
|
|
420
439
|
*
|
|
421
|
-
* The promise is
|
|
440
|
+
* The promise is fulfilled with an object containing a two properties:
|
|
422
441
|
*
|
|
423
442
|
* It is unsafe to call `writev()` multiple times on the same file without waiting
|
|
424
|
-
* for the promise to be
|
|
443
|
+
* for the promise to be fulfilled (or rejected).
|
|
425
444
|
*
|
|
426
445
|
* On Linux, positional writes don't work when the file is opened in append mode.
|
|
427
446
|
* The kernel ignores the position argument and always appends the data to
|
|
@@ -430,14 +449,14 @@ declare module 'fs/promises' {
|
|
|
430
449
|
* @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
|
|
431
450
|
* position.
|
|
432
451
|
*/
|
|
433
|
-
writev(buffers:
|
|
452
|
+
writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
|
|
434
453
|
/**
|
|
435
454
|
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
|
436
455
|
* @since v13.13.0, v12.17.0
|
|
437
456
|
* @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
|
|
438
457
|
* @return Fulfills upon success an object containing two properties:
|
|
439
458
|
*/
|
|
440
|
-
readv(buffers:
|
|
459
|
+
readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
|
|
441
460
|
/**
|
|
442
461
|
* Closes the file handle after waiting for any pending operation on the handle to
|
|
443
462
|
* complete.
|
|
@@ -470,7 +489,7 @@ declare module 'fs/promises' {
|
|
|
470
489
|
* (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
|
|
471
490
|
* possible values of `mode`.
|
|
472
491
|
*
|
|
473
|
-
* If the accessibility check is successful, the promise is
|
|
492
|
+
* If the accessibility check is successful, the promise is fulfilled with no
|
|
474
493
|
* value. If any of the accessibility checks fail, the promise is rejected
|
|
475
494
|
* with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and
|
|
476
495
|
* written by the current process.
|
|
@@ -601,7 +620,7 @@ declare module 'fs/promises' {
|
|
|
601
620
|
path: PathLike,
|
|
602
621
|
options: MakeDirectoryOptions & {
|
|
603
622
|
recursive: true;
|
|
604
|
-
}
|
|
623
|
+
},
|
|
605
624
|
): Promise<string | undefined>;
|
|
606
625
|
/**
|
|
607
626
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -614,9 +633,9 @@ declare module 'fs/promises' {
|
|
|
614
633
|
options?:
|
|
615
634
|
| Mode
|
|
616
635
|
| (MakeDirectoryOptions & {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
| null
|
|
636
|
+
recursive?: false | undefined;
|
|
637
|
+
})
|
|
638
|
+
| null,
|
|
620
639
|
): Promise<void>;
|
|
621
640
|
/**
|
|
622
641
|
* Asynchronous mkdir(2) - create a directory.
|
|
@@ -633,7 +652,7 @@ declare module 'fs/promises' {
|
|
|
633
652
|
* the filenames. If the `encoding` is set to `'buffer'`, the filenames returned
|
|
634
653
|
* will be passed as `Buffer` objects.
|
|
635
654
|
*
|
|
636
|
-
* If `options.withFileTypes` is set to `true`, the
|
|
655
|
+
* If `options.withFileTypes` is set to `true`, the returned array will contain `fs.Dirent` objects.
|
|
637
656
|
*
|
|
638
657
|
* ```js
|
|
639
658
|
* import { readdir } from 'node:fs/promises';
|
|
@@ -653,11 +672,11 @@ declare module 'fs/promises' {
|
|
|
653
672
|
path: PathLike,
|
|
654
673
|
options?:
|
|
655
674
|
| (ObjectEncodingOptions & {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
675
|
+
withFileTypes?: false | undefined;
|
|
676
|
+
recursive?: boolean | undefined;
|
|
677
|
+
})
|
|
659
678
|
| BufferEncoding
|
|
660
|
-
| null
|
|
679
|
+
| null,
|
|
661
680
|
): Promise<string[]>;
|
|
662
681
|
/**
|
|
663
682
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -668,11 +687,11 @@ declare module 'fs/promises' {
|
|
|
668
687
|
path: PathLike,
|
|
669
688
|
options:
|
|
670
689
|
| {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
|
690
|
+
encoding: "buffer";
|
|
691
|
+
withFileTypes?: false | undefined;
|
|
692
|
+
recursive?: boolean | undefined;
|
|
693
|
+
}
|
|
694
|
+
| "buffer",
|
|
676
695
|
): Promise<Buffer[]>;
|
|
677
696
|
/**
|
|
678
697
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -683,11 +702,11 @@ declare module 'fs/promises' {
|
|
|
683
702
|
path: PathLike,
|
|
684
703
|
options?:
|
|
685
704
|
| (ObjectEncodingOptions & {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
705
|
+
withFileTypes?: false | undefined;
|
|
706
|
+
recursive?: boolean | undefined;
|
|
707
|
+
})
|
|
689
708
|
| BufferEncoding
|
|
690
|
-
| null
|
|
709
|
+
| null,
|
|
691
710
|
): Promise<string[] | Buffer[]>;
|
|
692
711
|
/**
|
|
693
712
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -699,11 +718,11 @@ declare module 'fs/promises' {
|
|
|
699
718
|
options: ObjectEncodingOptions & {
|
|
700
719
|
withFileTypes: true;
|
|
701
720
|
recursive?: boolean | undefined;
|
|
702
|
-
}
|
|
721
|
+
},
|
|
703
722
|
): Promise<Dirent[]>;
|
|
704
723
|
/**
|
|
705
724
|
* 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
|
|
706
|
-
*
|
|
725
|
+
* fulfilled with the`linkString` upon success.
|
|
707
726
|
*
|
|
708
727
|
* The optional `options` argument can be a string specifying an encoding, or an
|
|
709
728
|
* object with an `encoding` property specifying the character encoding to use for
|
|
@@ -750,13 +769,13 @@ declare module 'fs/promises' {
|
|
|
750
769
|
path: PathLike,
|
|
751
770
|
opts?: StatOptions & {
|
|
752
771
|
bigint?: false | undefined;
|
|
753
|
-
}
|
|
772
|
+
},
|
|
754
773
|
): Promise<Stats>;
|
|
755
774
|
function lstat(
|
|
756
775
|
path: PathLike,
|
|
757
776
|
opts: StatOptions & {
|
|
758
777
|
bigint: true;
|
|
759
|
-
}
|
|
778
|
+
},
|
|
760
779
|
): Promise<BigIntStats>;
|
|
761
780
|
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
762
781
|
/**
|
|
@@ -767,13 +786,13 @@ declare module 'fs/promises' {
|
|
|
767
786
|
path: PathLike,
|
|
768
787
|
opts?: StatOptions & {
|
|
769
788
|
bigint?: false | undefined;
|
|
770
|
-
}
|
|
789
|
+
},
|
|
771
790
|
): Promise<Stats>;
|
|
772
791
|
function stat(
|
|
773
792
|
path: PathLike,
|
|
774
793
|
opts: StatOptions & {
|
|
775
794
|
bigint: true;
|
|
776
|
-
}
|
|
795
|
+
},
|
|
777
796
|
): Promise<BigIntStats>;
|
|
778
797
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
779
798
|
/**
|
|
@@ -784,13 +803,13 @@ declare module 'fs/promises' {
|
|
|
784
803
|
path: PathLike,
|
|
785
804
|
opts?: StatFsOptions & {
|
|
786
805
|
bigint?: false | undefined;
|
|
787
|
-
}
|
|
806
|
+
},
|
|
788
807
|
): Promise<StatsFs>;
|
|
789
808
|
function statfs(
|
|
790
809
|
path: PathLike,
|
|
791
810
|
opts: StatFsOptions & {
|
|
792
811
|
bigint: true;
|
|
793
|
-
}
|
|
812
|
+
},
|
|
794
813
|
): Promise<BigIntStatsFs>;
|
|
795
814
|
function statfs(path: PathLike, opts?: StatFsOptions): Promise<StatsFs | BigIntStatsFs>;
|
|
796
815
|
/**
|
|
@@ -881,7 +900,10 @@ declare module 'fs/promises' {
|
|
|
881
900
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
882
901
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
883
902
|
*/
|
|
884
|
-
function realpath(
|
|
903
|
+
function realpath(
|
|
904
|
+
path: PathLike,
|
|
905
|
+
options?: ObjectEncodingOptions | BufferEncoding | null,
|
|
906
|
+
): Promise<string | Buffer>;
|
|
885
907
|
/**
|
|
886
908
|
* Creates a unique temporary directory. A unique directory name is generated by
|
|
887
909
|
* appending six random characters to the end of the provided `prefix`. Due to
|
|
@@ -976,14 +998,19 @@ declare module 'fs/promises' {
|
|
|
976
998
|
*/
|
|
977
999
|
function writeFile(
|
|
978
1000
|
file: PathLike | FileHandle,
|
|
979
|
-
data:
|
|
1001
|
+
data:
|
|
1002
|
+
| string
|
|
1003
|
+
| NodeJS.ArrayBufferView
|
|
1004
|
+
| Iterable<string | NodeJS.ArrayBufferView>
|
|
1005
|
+
| AsyncIterable<string | NodeJS.ArrayBufferView>
|
|
1006
|
+
| Stream,
|
|
980
1007
|
options?:
|
|
981
1008
|
| (ObjectEncodingOptions & {
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1009
|
+
mode?: Mode | undefined;
|
|
1010
|
+
flag?: OpenMode | undefined;
|
|
1011
|
+
} & Abortable)
|
|
985
1012
|
| BufferEncoding
|
|
986
|
-
| null
|
|
1013
|
+
| null,
|
|
987
1014
|
): Promise<void>;
|
|
988
1015
|
/**
|
|
989
1016
|
* Asynchronously append data to a file, creating the file if it does not yet
|
|
@@ -999,7 +1026,11 @@ declare module 'fs/promises' {
|
|
|
999
1026
|
* @param path filename or {FileHandle}
|
|
1000
1027
|
* @return Fulfills with `undefined` upon success.
|
|
1001
1028
|
*/
|
|
1002
|
-
function appendFile(
|
|
1029
|
+
function appendFile(
|
|
1030
|
+
path: PathLike | FileHandle,
|
|
1031
|
+
data: string | Uint8Array,
|
|
1032
|
+
options?: (ObjectEncodingOptions & FlagAndOpenMode & { flush?: boolean | undefined }) | BufferEncoding | null,
|
|
1033
|
+
): Promise<void>;
|
|
1003
1034
|
/**
|
|
1004
1035
|
* Asynchronously reads the entire contents of a file.
|
|
1005
1036
|
*
|
|
@@ -1060,10 +1091,10 @@ declare module 'fs/promises' {
|
|
|
1060
1091
|
path: PathLike | FileHandle,
|
|
1061
1092
|
options?:
|
|
1062
1093
|
| ({
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
| null
|
|
1094
|
+
encoding?: null | undefined;
|
|
1095
|
+
flag?: OpenMode | undefined;
|
|
1096
|
+
} & Abortable)
|
|
1097
|
+
| null,
|
|
1067
1098
|
): Promise<Buffer>;
|
|
1068
1099
|
/**
|
|
1069
1100
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1076,10 +1107,10 @@ declare module 'fs/promises' {
|
|
|
1076
1107
|
path: PathLike | FileHandle,
|
|
1077
1108
|
options:
|
|
1078
1109
|
| ({
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
| BufferEncoding
|
|
1110
|
+
encoding: BufferEncoding;
|
|
1111
|
+
flag?: OpenMode | undefined;
|
|
1112
|
+
} & Abortable)
|
|
1113
|
+
| BufferEncoding,
|
|
1083
1114
|
): Promise<string>;
|
|
1084
1115
|
/**
|
|
1085
1116
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1091,12 +1122,15 @@ declare module 'fs/promises' {
|
|
|
1091
1122
|
function readFile(
|
|
1092
1123
|
path: PathLike | FileHandle,
|
|
1093
1124
|
options?:
|
|
1094
|
-
| (
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1125
|
+
| (
|
|
1126
|
+
& ObjectEncodingOptions
|
|
1127
|
+
& Abortable
|
|
1128
|
+
& {
|
|
1129
|
+
flag?: OpenMode | undefined;
|
|
1130
|
+
}
|
|
1131
|
+
)
|
|
1098
1132
|
| BufferEncoding
|
|
1099
|
-
| null
|
|
1133
|
+
| null,
|
|
1100
1134
|
): Promise<string | Buffer>;
|
|
1101
1135
|
/**
|
|
1102
1136
|
* 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.
|
|
@@ -1161,9 +1195,9 @@ declare module 'fs/promises' {
|
|
|
1161
1195
|
filename: PathLike,
|
|
1162
1196
|
options:
|
|
1163
1197
|
| (WatchOptions & {
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
|
1198
|
+
encoding: "buffer";
|
|
1199
|
+
})
|
|
1200
|
+
| "buffer",
|
|
1167
1201
|
): AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1168
1202
|
/**
|
|
1169
1203
|
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
|
@@ -1182,7 +1216,10 @@ declare module 'fs/promises' {
|
|
|
1182
1216
|
* If `persistent` is not supplied, the default of `true` is used.
|
|
1183
1217
|
* If `recursive` is not supplied, the default of `false` is used.
|
|
1184
1218
|
*/
|
|
1185
|
-
function watch(
|
|
1219
|
+
function watch(
|
|
1220
|
+
filename: PathLike,
|
|
1221
|
+
options: WatchOptions | string,
|
|
1222
|
+
): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
|
|
1186
1223
|
/**
|
|
1187
1224
|
* Asynchronously copies the entire directory structure from `src` to `dest`,
|
|
1188
1225
|
* including subdirectories and files.
|
|
@@ -1197,6 +1234,6 @@ declare module 'fs/promises' {
|
|
|
1197
1234
|
*/
|
|
1198
1235
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
|
1199
1236
|
}
|
|
1200
|
-
declare module
|
|
1201
|
-
export * from
|
|
1237
|
+
declare module "node:fs/promises" {
|
|
1238
|
+
export * from "fs/promises";
|
|
1202
1239
|
}
|