cdk-common 1.0.1186 → 1.0.1188
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/.jsii +36 -6
- package/API.md +30 -0
- package/lib/main.js +1 -1
- package/lib/managed-policies.d.ts +1351 -1346
- package/lib/managed-policies.js +6 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/async_hooks.d.ts +64 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.buffer.d.ts +2 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.d.ts +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +18 -15
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +93 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/globals.d.ts +140 -280
- package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +22 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +14 -8
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/querystring.d.ts +2 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream/web.d.ts +3 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +2 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +13 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +20 -5
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +64 -0
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.buffer.d.ts +2 -0
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
- package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +18 -15
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +93 -9
- package/node_modules/@types/form-data/node_modules/@types/node/globals.d.ts +140 -280
- package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +22 -1
- package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +14 -8
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +2 -3
- package/node_modules/@types/form-data/node_modules/@types/node/stream/web.d.ts +3 -3
- package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +2 -0
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +13 -0
- package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +20 -5
- package/node_modules/@types/qs/README.md +1 -1
- package/node_modules/@types/qs/index.d.ts +1 -0
- package/node_modules/@types/qs/package.json +3 -3
- package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/index.js +3 -0
- package/node_modules/{string_decoder → form-data}/node_modules/safe-buffer/package.json +18 -4
- package/node_modules/safe-buffer/index.js +0 -3
- package/node_modules/safe-buffer/package.json +4 -18
- package/package.json +10 -10
- package/node_modules/readable-stream/node_modules/safe-buffer/package.json +0 -37
- package/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/string_decoder/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/string_decoder/node_modules/safe-buffer/index.js +0 -62
- /package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/LICENSE +0 -0
- /package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/README.md +0 -0
- /package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/index.d.ts +0 -0
- /package/node_modules/{form-data/node_modules/mime-db → mime-db}/HISTORY.md +0 -0
- /package/node_modules/{form-data/node_modules/mime-db → mime-db}/LICENSE +0 -0
- /package/node_modules/{form-data/node_modules/mime-db → mime-db}/README.md +0 -0
- /package/node_modules/{form-data/node_modules/mime-db → mime-db}/db.json +0 -0
- /package/node_modules/{form-data/node_modules/mime-db → mime-db}/index.js +0 -0
- /package/node_modules/{form-data/node_modules/mime-db → mime-db}/package.json +0 -0
- /package/node_modules/{form-data/node_modules/mime-types → mime-types}/HISTORY.md +0 -0
- /package/node_modules/{form-data/node_modules/mime-types → mime-types}/LICENSE +0 -0
- /package/node_modules/{form-data/node_modules/mime-types → mime-types}/README.md +0 -0
- /package/node_modules/{form-data/node_modules/mime-types → mime-types}/index.js +0 -0
- /package/node_modules/{form-data/node_modules/mime-types → mime-types}/package.json +0 -0
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 14 May 2025 04:37:31 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -533,6 +533,70 @@ declare module "async_hooks" {
|
|
|
533
533
|
*/
|
|
534
534
|
enterWith(store: T): void;
|
|
535
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* @since v17.2.0, v16.14.0
|
|
538
|
+
* @return A map of provider types to the corresponding numeric id.
|
|
539
|
+
* This map contains all the event types that might be emitted by the `async_hooks.init()` event.
|
|
540
|
+
*/
|
|
541
|
+
namespace asyncWrapProviders {
|
|
542
|
+
const NONE: number;
|
|
543
|
+
const DIRHANDLE: number;
|
|
544
|
+
const DNSCHANNEL: number;
|
|
545
|
+
const ELDHISTOGRAM: number;
|
|
546
|
+
const FILEHANDLE: number;
|
|
547
|
+
const FILEHANDLECLOSEREQ: number;
|
|
548
|
+
const FIXEDSIZEBLOBCOPY: number;
|
|
549
|
+
const FSEVENTWRAP: number;
|
|
550
|
+
const FSREQCALLBACK: number;
|
|
551
|
+
const FSREQPROMISE: number;
|
|
552
|
+
const GETADDRINFOREQWRAP: number;
|
|
553
|
+
const GETNAMEINFOREQWRAP: number;
|
|
554
|
+
const HEAPSNAPSHOT: number;
|
|
555
|
+
const HTTP2SESSION: number;
|
|
556
|
+
const HTTP2STREAM: number;
|
|
557
|
+
const HTTP2PING: number;
|
|
558
|
+
const HTTP2SETTINGS: number;
|
|
559
|
+
const HTTPINCOMINGMESSAGE: number;
|
|
560
|
+
const HTTPCLIENTREQUEST: number;
|
|
561
|
+
const JSSTREAM: number;
|
|
562
|
+
const JSUDPWRAP: number;
|
|
563
|
+
const MESSAGEPORT: number;
|
|
564
|
+
const PIPECONNECTWRAP: number;
|
|
565
|
+
const PIPESERVERWRAP: number;
|
|
566
|
+
const PIPEWRAP: number;
|
|
567
|
+
const PROCESSWRAP: number;
|
|
568
|
+
const PROMISE: number;
|
|
569
|
+
const QUERYWRAP: number;
|
|
570
|
+
const SHUTDOWNWRAP: number;
|
|
571
|
+
const SIGNALWRAP: number;
|
|
572
|
+
const STATWATCHER: number;
|
|
573
|
+
const STREAMPIPE: number;
|
|
574
|
+
const TCPCONNECTWRAP: number;
|
|
575
|
+
const TCPSERVERWRAP: number;
|
|
576
|
+
const TCPWRAP: number;
|
|
577
|
+
const TTYWRAP: number;
|
|
578
|
+
const UDPSENDWRAP: number;
|
|
579
|
+
const UDPWRAP: number;
|
|
580
|
+
const SIGINTWATCHDOG: number;
|
|
581
|
+
const WORKER: number;
|
|
582
|
+
const WORKERHEAPSNAPSHOT: number;
|
|
583
|
+
const WRITEWRAP: number;
|
|
584
|
+
const ZLIB: number;
|
|
585
|
+
const CHECKPRIMEREQUEST: number;
|
|
586
|
+
const PBKDF2REQUEST: number;
|
|
587
|
+
const KEYPAIRGENREQUEST: number;
|
|
588
|
+
const KEYGENREQUEST: number;
|
|
589
|
+
const KEYEXPORTREQUEST: number;
|
|
590
|
+
const CIPHERREQUEST: number;
|
|
591
|
+
const DERIVEBITSREQUEST: number;
|
|
592
|
+
const HASHREQUEST: number;
|
|
593
|
+
const RANDOMBYTESREQUEST: number;
|
|
594
|
+
const RANDOMPRIMEREQUEST: number;
|
|
595
|
+
const SCRYPTREQUEST: number;
|
|
596
|
+
const SIGNREQUEST: number;
|
|
597
|
+
const TLSWRAP: number;
|
|
598
|
+
const VERIFYREQUEST: number;
|
|
599
|
+
}
|
|
536
600
|
}
|
|
537
601
|
declare module "node:async_hooks" {
|
|
538
602
|
export * from "async_hooks";
|
|
@@ -451,6 +451,8 @@ declare module "buffer" {
|
|
|
451
451
|
*/
|
|
452
452
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
|
453
453
|
}
|
|
454
|
+
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
|
455
|
+
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
454
456
|
}
|
|
455
457
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
456
458
|
var SlowBuffer: {
|
|
@@ -69,7 +69,7 @@ declare module "buffer" {
|
|
|
69
69
|
* @param input The input to validate.
|
|
70
70
|
*/
|
|
71
71
|
export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
72
|
-
export
|
|
72
|
+
export let INSPECT_MAX_BYTES: number;
|
|
73
73
|
export const kMaxLength: number;
|
|
74
74
|
export const kStringMaxLength: number;
|
|
75
75
|
export const constants: {
|
|
@@ -122,7 +122,7 @@ declare module "buffer" {
|
|
|
122
122
|
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
|
123
123
|
*/
|
|
124
124
|
export function resolveObjectURL(id: string): Blob | undefined;
|
|
125
|
-
export { Buffer };
|
|
125
|
+
export { type AllowSharedBuffer, Buffer, type NonSharedBuffer };
|
|
126
126
|
/**
|
|
127
127
|
* @experimental
|
|
128
128
|
*/
|
|
@@ -266,7 +266,7 @@ declare module "cluster" {
|
|
|
266
266
|
* @since v0.7.7
|
|
267
267
|
* @return A reference to `worker`.
|
|
268
268
|
*/
|
|
269
|
-
disconnect():
|
|
269
|
+
disconnect(): this;
|
|
270
270
|
/**
|
|
271
271
|
* This function returns `true` if the worker is connected to its primary via its
|
|
272
272
|
* IPC channel, `false` otherwise. A worker is connected to its primary after it
|
|
@@ -259,7 +259,7 @@ declare module "diagnostics_channel" {
|
|
|
259
259
|
* @param store The store to unbind from the channel.
|
|
260
260
|
* @return `true` if the store was found, `false` otherwise.
|
|
261
261
|
*/
|
|
262
|
-
unbindStore(store:
|
|
262
|
+
unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
|
|
263
263
|
/**
|
|
264
264
|
* Applies the given data to any AsyncLocalStorage instances bound to the channel
|
|
265
265
|
* for the duration of the given function, then publishes to the channel within
|
|
@@ -547,6 +547,25 @@ declare module "diagnostics_channel" {
|
|
|
547
547
|
thisArg?: any,
|
|
548
548
|
...args: Parameters<Fn>
|
|
549
549
|
): void;
|
|
550
|
+
/**
|
|
551
|
+
* `true` if any of the individual channels has a subscriber, `false` if not.
|
|
552
|
+
*
|
|
553
|
+
* This is a helper method available on a {@link TracingChannel} instance to check
|
|
554
|
+
* if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers.
|
|
555
|
+
* A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise.
|
|
556
|
+
*
|
|
557
|
+
* ```js
|
|
558
|
+
* const diagnostics_channel = require('node:diagnostics_channel');
|
|
559
|
+
*
|
|
560
|
+
* const channels = diagnostics_channel.tracingChannel('my-channel');
|
|
561
|
+
*
|
|
562
|
+
* if (channels.hasSubscribers) {
|
|
563
|
+
* // Do something
|
|
564
|
+
* }
|
|
565
|
+
* ```
|
|
566
|
+
* @since v22.0.0, v20.13.0
|
|
567
|
+
*/
|
|
568
|
+
readonly hasSubscribers: boolean;
|
|
550
569
|
}
|
|
551
570
|
}
|
|
552
571
|
declare module "node:diagnostics_channel" {
|
|
@@ -277,36 +277,26 @@ declare module "fs/promises" {
|
|
|
277
277
|
* data will be a string.
|
|
278
278
|
*/
|
|
279
279
|
readFile(
|
|
280
|
-
options?:
|
|
281
|
-
encoding?: null | undefined
|
|
282
|
-
|
|
283
|
-
} | null,
|
|
280
|
+
options?:
|
|
281
|
+
| ({ encoding?: null | undefined } & Abortable)
|
|
282
|
+
| null,
|
|
284
283
|
): Promise<Buffer>;
|
|
285
284
|
/**
|
|
286
285
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
287
286
|
* The `FileHandle` must have been opened for reading.
|
|
288
|
-
* @param options An object that may contain an optional flag.
|
|
289
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
290
287
|
*/
|
|
291
288
|
readFile(
|
|
292
289
|
options:
|
|
293
|
-
| {
|
|
294
|
-
encoding: BufferEncoding;
|
|
295
|
-
flag?: OpenMode | undefined;
|
|
296
|
-
}
|
|
290
|
+
| ({ encoding: BufferEncoding } & Abortable)
|
|
297
291
|
| BufferEncoding,
|
|
298
292
|
): Promise<string>;
|
|
299
293
|
/**
|
|
300
294
|
* Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
|
|
301
295
|
* The `FileHandle` must have been opened for reading.
|
|
302
|
-
* @param options An object that may contain an optional flag.
|
|
303
|
-
* If a flag is not provided, it defaults to `'r'`.
|
|
304
296
|
*/
|
|
305
297
|
readFile(
|
|
306
298
|
options?:
|
|
307
|
-
| (ObjectEncodingOptions &
|
|
308
|
-
flag?: OpenMode | undefined;
|
|
309
|
-
})
|
|
299
|
+
| (ObjectEncodingOptions & Abortable)
|
|
310
300
|
| BufferEncoding
|
|
311
301
|
| null,
|
|
312
302
|
): Promise<string | Buffer>;
|
|
@@ -728,6 +718,19 @@ declare module "fs/promises" {
|
|
|
728
718
|
recursive?: boolean | undefined;
|
|
729
719
|
},
|
|
730
720
|
): Promise<Dirent[]>;
|
|
721
|
+
/**
|
|
722
|
+
* Asynchronous readdir(3) - read a directory.
|
|
723
|
+
* @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
|
|
724
|
+
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
|
725
|
+
*/
|
|
726
|
+
function readdir(
|
|
727
|
+
path: PathLike,
|
|
728
|
+
options: {
|
|
729
|
+
encoding: "buffer";
|
|
730
|
+
withFileTypes: true;
|
|
731
|
+
recursive?: boolean | undefined;
|
|
732
|
+
},
|
|
733
|
+
): Promise<Dirent<Buffer>[]>;
|
|
731
734
|
/**
|
|
732
735
|
* 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
|
|
733
736
|
* fulfilled with the`linkString` upon success.
|
|
@@ -198,7 +198,7 @@ declare module "fs" {
|
|
|
198
198
|
* the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
|
|
199
199
|
* @since v10.10.0
|
|
200
200
|
*/
|
|
201
|
-
export class Dirent {
|
|
201
|
+
export class Dirent<Name extends string | Buffer = string> {
|
|
202
202
|
/**
|
|
203
203
|
* Returns `true` if the `fs.Dirent` object describes a regular file.
|
|
204
204
|
* @since v10.10.0
|
|
@@ -241,7 +241,7 @@ declare module "fs" {
|
|
|
241
241
|
* value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
|
|
242
242
|
* @since v10.10.0
|
|
243
243
|
*/
|
|
244
|
-
name:
|
|
244
|
+
name: Name;
|
|
245
245
|
/**
|
|
246
246
|
* The base path that this `fs.Dirent` object refers to.
|
|
247
247
|
* @since v20.12.0
|
|
@@ -2040,6 +2040,20 @@ declare module "fs" {
|
|
|
2040
2040
|
},
|
|
2041
2041
|
callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
|
|
2042
2042
|
): void;
|
|
2043
|
+
/**
|
|
2044
|
+
* Asynchronous readdir(3) - read a directory.
|
|
2045
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2046
|
+
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
|
2047
|
+
*/
|
|
2048
|
+
export function readdir(
|
|
2049
|
+
path: PathLike,
|
|
2050
|
+
options: {
|
|
2051
|
+
encoding: "buffer";
|
|
2052
|
+
withFileTypes: true;
|
|
2053
|
+
recursive?: boolean | undefined;
|
|
2054
|
+
},
|
|
2055
|
+
callback: (err: NodeJS.ErrnoException | null, files: Dirent<Buffer>[]) => void,
|
|
2056
|
+
): void;
|
|
2043
2057
|
export namespace readdir {
|
|
2044
2058
|
/**
|
|
2045
2059
|
* Asynchronous readdir(3) - read a directory.
|
|
@@ -2099,6 +2113,19 @@ declare module "fs" {
|
|
|
2099
2113
|
recursive?: boolean | undefined;
|
|
2100
2114
|
},
|
|
2101
2115
|
): Promise<Dirent[]>;
|
|
2116
|
+
/**
|
|
2117
|
+
* Asynchronous readdir(3) - read a directory.
|
|
2118
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2119
|
+
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
|
2120
|
+
*/
|
|
2121
|
+
function __promisify__(
|
|
2122
|
+
path: PathLike,
|
|
2123
|
+
options: {
|
|
2124
|
+
encoding: "buffer";
|
|
2125
|
+
withFileTypes: true;
|
|
2126
|
+
recursive?: boolean | undefined;
|
|
2127
|
+
},
|
|
2128
|
+
): Promise<Dirent<Buffer>[]>;
|
|
2102
2129
|
}
|
|
2103
2130
|
/**
|
|
2104
2131
|
* Reads the contents of the directory.
|
|
@@ -2166,6 +2193,19 @@ declare module "fs" {
|
|
|
2166
2193
|
recursive?: boolean | undefined;
|
|
2167
2194
|
},
|
|
2168
2195
|
): Dirent[];
|
|
2196
|
+
/**
|
|
2197
|
+
* Synchronous readdir(3) - read a directory.
|
|
2198
|
+
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2199
|
+
* @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
|
|
2200
|
+
*/
|
|
2201
|
+
export function readdirSync(
|
|
2202
|
+
path: PathLike,
|
|
2203
|
+
options: {
|
|
2204
|
+
encoding: "buffer";
|
|
2205
|
+
withFileTypes: true;
|
|
2206
|
+
recursive?: boolean | undefined;
|
|
2207
|
+
},
|
|
2208
|
+
): Dirent<Buffer>[];
|
|
2169
2209
|
/**
|
|
2170
2210
|
* Closes the file descriptor. No arguments other than a possible exception are
|
|
2171
2211
|
* given to the completion callback.
|
|
@@ -2319,6 +2359,20 @@ declare module "fs" {
|
|
|
2319
2359
|
* @since v0.1.96
|
|
2320
2360
|
*/
|
|
2321
2361
|
export function fsyncSync(fd: number): void;
|
|
2362
|
+
export interface WriteOptions {
|
|
2363
|
+
/**
|
|
2364
|
+
* @default 0
|
|
2365
|
+
*/
|
|
2366
|
+
offset?: number | undefined;
|
|
2367
|
+
/**
|
|
2368
|
+
* @default `buffer.byteLength - offset`
|
|
2369
|
+
*/
|
|
2370
|
+
length?: number | undefined;
|
|
2371
|
+
/**
|
|
2372
|
+
* @default null
|
|
2373
|
+
*/
|
|
2374
|
+
position?: number | undefined | null;
|
|
2375
|
+
}
|
|
2322
2376
|
/**
|
|
2323
2377
|
* Write `buffer` to the file specified by `fd`.
|
|
2324
2378
|
*
|
|
@@ -2387,6 +2441,20 @@ declare module "fs" {
|
|
|
2387
2441
|
buffer: TBuffer,
|
|
2388
2442
|
callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
|
|
2389
2443
|
): void;
|
|
2444
|
+
/**
|
|
2445
|
+
* Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
|
|
2446
|
+
* @param fd A file descriptor.
|
|
2447
|
+
* @param options An object with the following properties:
|
|
2448
|
+
* * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
|
|
2449
|
+
* * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
|
|
2450
|
+
* * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
2451
|
+
*/
|
|
2452
|
+
export function write<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2453
|
+
fd: number,
|
|
2454
|
+
buffer: TBuffer,
|
|
2455
|
+
options: WriteOptions,
|
|
2456
|
+
callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
|
|
2457
|
+
): void;
|
|
2390
2458
|
/**
|
|
2391
2459
|
* Asynchronously writes `string` to the file referenced by the supplied file descriptor.
|
|
2392
2460
|
* @param fd A file descriptor.
|
|
@@ -2441,6 +2509,22 @@ declare module "fs" {
|
|
|
2441
2509
|
bytesWritten: number;
|
|
2442
2510
|
buffer: TBuffer;
|
|
2443
2511
|
}>;
|
|
2512
|
+
/**
|
|
2513
|
+
* Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
|
|
2514
|
+
* @param fd A file descriptor.
|
|
2515
|
+
* @param options An object with the following properties:
|
|
2516
|
+
* * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
|
|
2517
|
+
* * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
|
|
2518
|
+
* * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
|
|
2519
|
+
*/
|
|
2520
|
+
function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
|
|
2521
|
+
fd: number,
|
|
2522
|
+
buffer?: TBuffer,
|
|
2523
|
+
options?: WriteOptions,
|
|
2524
|
+
): Promise<{
|
|
2525
|
+
bytesWritten: number;
|
|
2526
|
+
buffer: TBuffer;
|
|
2527
|
+
}>;
|
|
2444
2528
|
/**
|
|
2445
2529
|
* Asynchronously writes `string` to the file referenced by the supplied file descriptor.
|
|
2446
2530
|
* @param fd A file descriptor.
|
|
@@ -2684,7 +2768,7 @@ declare module "fs" {
|
|
|
2684
2768
|
} & Abortable)
|
|
2685
2769
|
| undefined
|
|
2686
2770
|
| null,
|
|
2687
|
-
callback: (err: NodeJS.ErrnoException | null, data:
|
|
2771
|
+
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
2688
2772
|
): void;
|
|
2689
2773
|
/**
|
|
2690
2774
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -2719,7 +2803,7 @@ declare module "fs" {
|
|
|
2719
2803
|
| BufferEncoding
|
|
2720
2804
|
| undefined
|
|
2721
2805
|
| null,
|
|
2722
|
-
callback: (err: NodeJS.ErrnoException | null, data: string |
|
|
2806
|
+
callback: (err: NodeJS.ErrnoException | null, data: string | NonSharedBuffer) => void,
|
|
2723
2807
|
): void;
|
|
2724
2808
|
/**
|
|
2725
2809
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -2728,7 +2812,7 @@ declare module "fs" {
|
|
|
2728
2812
|
*/
|
|
2729
2813
|
export function readFile(
|
|
2730
2814
|
path: PathOrFileDescriptor,
|
|
2731
|
-
callback: (err: NodeJS.ErrnoException | null, data:
|
|
2815
|
+
callback: (err: NodeJS.ErrnoException | null, data: NonSharedBuffer) => void,
|
|
2732
2816
|
): void;
|
|
2733
2817
|
export namespace readFile {
|
|
2734
2818
|
/**
|
|
@@ -2744,7 +2828,7 @@ declare module "fs" {
|
|
|
2744
2828
|
encoding?: null | undefined;
|
|
2745
2829
|
flag?: string | undefined;
|
|
2746
2830
|
} | null,
|
|
2747
|
-
): Promise<
|
|
2831
|
+
): Promise<NonSharedBuffer>;
|
|
2748
2832
|
/**
|
|
2749
2833
|
* Asynchronously reads the entire contents of a file.
|
|
2750
2834
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -2778,7 +2862,7 @@ declare module "fs" {
|
|
|
2778
2862
|
})
|
|
2779
2863
|
| BufferEncoding
|
|
2780
2864
|
| null,
|
|
2781
|
-
): Promise<string |
|
|
2865
|
+
): Promise<string | NonSharedBuffer>;
|
|
2782
2866
|
}
|
|
2783
2867
|
/**
|
|
2784
2868
|
* Returns the contents of the `path`.
|
|
@@ -2810,7 +2894,7 @@ declare module "fs" {
|
|
|
2810
2894
|
encoding?: null | undefined;
|
|
2811
2895
|
flag?: string | undefined;
|
|
2812
2896
|
} | null,
|
|
2813
|
-
):
|
|
2897
|
+
): NonSharedBuffer;
|
|
2814
2898
|
/**
|
|
2815
2899
|
* Synchronously reads the entire contents of a file.
|
|
2816
2900
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
@@ -2842,7 +2926,7 @@ declare module "fs" {
|
|
|
2842
2926
|
})
|
|
2843
2927
|
| BufferEncoding
|
|
2844
2928
|
| null,
|
|
2845
|
-
): string |
|
|
2929
|
+
): string | NonSharedBuffer;
|
|
2846
2930
|
export type WriteFileOptions =
|
|
2847
2931
|
| (
|
|
2848
2932
|
& ObjectEncodingOptions
|