@types/node 16.9.3 → 16.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node/README.md +1 -1
- node/assert.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +3 -3
- node/child_process.d.ts +30 -20
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +83 -19
- node/dgram.d.ts +2 -2
- node/diagnostics_channel.d.ts +1 -1
- node/dns/promises.d.ts +1 -1
- node/dns.d.ts +2 -2
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -2
- node/fs/promises.d.ts +19 -12
- node/fs.d.ts +52 -27
- node/http.d.ts +14 -4
- node/http2.d.ts +2 -2
- node/https.d.ts +1 -1
- node/index.d.ts +1 -1
- node/inspector.d.ts +2 -2
- node/net.d.ts +1 -1
- node/os.d.ts +5 -5
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +2 -2
- node/process.d.ts +3 -3
- node/punycode.d.ts +3 -3
- node/querystring.d.ts +9 -9
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +38 -7
- node/string_decoder.d.ts +1 -1
- node/timers.d.ts +1 -1
- node/tls.d.ts +6 -6
- node/trace_events.d.ts +2 -2
- node/tty.d.ts +2 -4
- node/url.d.ts +1 -1
- node/util.d.ts +11 -12
- node/v8.d.ts +2 -2
- node/vm.d.ts +3 -4
- node/wasi.d.ts +9 -4
- node/worker_threads.d.ts +4 -4
- node/zlib.d.ts +1 -1
node/fs/promises.d.ts
CHANGED
|
@@ -92,7 +92,7 @@ declare module 'fs/promises' {
|
|
|
92
92
|
chmod(mode: Mode): Promise<void>;
|
|
93
93
|
/**
|
|
94
94
|
* Forces all currently queued I/O operations associated with the file to the
|
|
95
|
-
* operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
|
|
95
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
|
|
96
96
|
*
|
|
97
97
|
* Unlike `filehandle.sync` this method does not flush modified metadata.
|
|
98
98
|
* @since v10.0.0
|
|
@@ -114,8 +114,8 @@ declare module 'fs/promises' {
|
|
|
114
114
|
* number of bytes read is zero.
|
|
115
115
|
* @since v10.0.0
|
|
116
116
|
* @param buffer A buffer that will be filled with the file data read.
|
|
117
|
-
* @param
|
|
118
|
-
* @param
|
|
117
|
+
* @param offset The location in the buffer at which to start filling.
|
|
118
|
+
* @param length The number of bytes to read.
|
|
119
119
|
* @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an
|
|
120
120
|
* integer, the current file position will remain unchanged.
|
|
121
121
|
* @return Fulfills upon success with an object with two properties:
|
|
@@ -220,7 +220,10 @@ declare module 'fs/promises' {
|
|
|
220
220
|
*/
|
|
221
221
|
utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
|
222
222
|
/**
|
|
223
|
-
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer,
|
|
223
|
+
* Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
|
|
224
|
+
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
|
|
225
|
+
* [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
|
|
226
|
+
* object with an own `toString` function
|
|
224
227
|
* property. The promise is resolved with no arguments upon success.
|
|
225
228
|
*
|
|
226
229
|
* If `options` is a string, then it specifies the `encoding`.
|
|
@@ -274,7 +277,7 @@ declare module 'fs/promises' {
|
|
|
274
277
|
buffer: string;
|
|
275
278
|
}>;
|
|
276
279
|
/**
|
|
277
|
-
* Write an array of [
|
|
280
|
+
* Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
|
|
278
281
|
*
|
|
279
282
|
* The promise is resolved with an object containing a two properties:
|
|
280
283
|
*
|
|
@@ -290,7 +293,7 @@ declare module 'fs/promises' {
|
|
|
290
293
|
*/
|
|
291
294
|
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
|
292
295
|
/**
|
|
293
|
-
* Read from a file and write to an array of [
|
|
296
|
+
* Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
|
|
294
297
|
* @since v13.13.0, v12.17.0
|
|
295
298
|
* @param position 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.
|
|
296
299
|
* @return Fulfills upon success an object containing two properties:
|
|
@@ -324,7 +327,7 @@ declare module 'fs/promises' {
|
|
|
324
327
|
*
|
|
325
328
|
* If the accessibility check is successful, the promise is resolved with no
|
|
326
329
|
* value. If any of the accessibility checks fail, the promise is rejected
|
|
327
|
-
* with an [
|
|
330
|
+
* 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
|
|
328
331
|
* written by the current process.
|
|
329
332
|
*
|
|
330
333
|
* ```js
|
|
@@ -391,7 +394,7 @@ declare module 'fs/promises' {
|
|
|
391
394
|
*
|
|
392
395
|
* Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
|
|
393
396
|
* by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
|
|
394
|
-
* a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
397
|
+
* a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
395
398
|
* @since v10.0.0
|
|
396
399
|
* @param [flags='r'] See `support of file system `flags``.
|
|
397
400
|
* @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created.
|
|
@@ -539,7 +542,7 @@ declare module 'fs/promises' {
|
|
|
539
542
|
}
|
|
540
543
|
): Promise<Dirent[]>;
|
|
541
544
|
/**
|
|
542
|
-
* 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
|
|
545
|
+
* 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
|
|
543
546
|
* resolved with the`linkString` upon success.
|
|
544
547
|
*
|
|
545
548
|
* The optional `options` argument can be a string specifying an encoding, or an
|
|
@@ -611,7 +614,7 @@ declare module 'fs/promises' {
|
|
|
611
614
|
): Promise<BigIntStats>;
|
|
612
615
|
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
|
613
616
|
/**
|
|
614
|
-
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
|
617
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail.
|
|
615
618
|
* @since v10.0.0
|
|
616
619
|
* @return Fulfills with `undefined` upon success.
|
|
617
620
|
*/
|
|
@@ -619,7 +622,7 @@ declare module 'fs/promises' {
|
|
|
619
622
|
/**
|
|
620
623
|
* If `path` refers to a symbolic link, then the link is removed without affecting
|
|
621
624
|
* the file or directory to which that link refers. If the `path` refers to a file
|
|
622
|
-
* path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html)documentation for more detail.
|
|
625
|
+
* path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail.
|
|
623
626
|
* @since v10.0.0
|
|
624
627
|
* @return Fulfills with `undefined` upon success.
|
|
625
628
|
*/
|
|
@@ -746,6 +749,8 @@ declare module 'fs/promises' {
|
|
|
746
749
|
*
|
|
747
750
|
* If `options` is a string, then it specifies the encoding.
|
|
748
751
|
*
|
|
752
|
+
* The `mode` option only affects the newly created file. See `fs.open()` for more details.
|
|
753
|
+
*
|
|
749
754
|
* Any specified `FileHandle` has to support writing.
|
|
750
755
|
*
|
|
751
756
|
* It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
|
|
@@ -802,6 +807,8 @@ declare module 'fs/promises' {
|
|
|
802
807
|
*
|
|
803
808
|
* If `options` is a string, then it specifies the `encoding`.
|
|
804
809
|
*
|
|
810
|
+
* The `mode` option only affects the newly created file. See `fs.open()` for more details.
|
|
811
|
+
*
|
|
805
812
|
* The `path` may be specified as a `FileHandle` that has been opened
|
|
806
813
|
* for appending (using `fsPromises.open()`).
|
|
807
814
|
* @since v10.0.0
|
|
@@ -894,7 +901,7 @@ declare module 'fs/promises' {
|
|
|
894
901
|
| null
|
|
895
902
|
): Promise<string | Buffer>;
|
|
896
903
|
/**
|
|
897
|
-
* 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.
|
|
904
|
+
* 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.
|
|
898
905
|
*
|
|
899
906
|
* Creates an `fs.Dir`, which contains all further functions for reading from
|
|
900
907
|
* and cleaning up the directory.
|
node/fs.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* All file system operations have synchronous, callback, and promise-based
|
|
18
18
|
* forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
|
|
19
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
19
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/fs.js)
|
|
20
20
|
*/
|
|
21
21
|
declare module 'fs' {
|
|
22
22
|
import * as stream from 'node:stream';
|
|
@@ -904,42 +904,42 @@ declare module 'fs' {
|
|
|
904
904
|
): Promise<BigIntStats>;
|
|
905
905
|
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
|
|
906
906
|
}
|
|
907
|
-
export interface StatSyncFn
|
|
908
|
-
(path:
|
|
907
|
+
export interface StatSyncFn extends Function {
|
|
908
|
+
(path: PathLike, options?: undefined): Stats;
|
|
909
909
|
(
|
|
910
|
-
path:
|
|
911
|
-
options?:
|
|
910
|
+
path: PathLike,
|
|
911
|
+
options?: StatSyncOptions & {
|
|
912
912
|
bigint?: false | undefined;
|
|
913
913
|
throwIfNoEntry: false;
|
|
914
914
|
}
|
|
915
915
|
): Stats | undefined;
|
|
916
916
|
(
|
|
917
|
-
path:
|
|
918
|
-
options:
|
|
917
|
+
path: PathLike,
|
|
918
|
+
options: StatSyncOptions & {
|
|
919
919
|
bigint: true;
|
|
920
920
|
throwIfNoEntry: false;
|
|
921
921
|
}
|
|
922
922
|
): BigIntStats | undefined;
|
|
923
923
|
(
|
|
924
|
-
path:
|
|
925
|
-
options?:
|
|
924
|
+
path: PathLike,
|
|
925
|
+
options?: StatSyncOptions & {
|
|
926
926
|
bigint?: false | undefined;
|
|
927
927
|
}
|
|
928
928
|
): Stats;
|
|
929
929
|
(
|
|
930
|
-
path:
|
|
931
|
-
options:
|
|
930
|
+
path: PathLike,
|
|
931
|
+
options: StatSyncOptions & {
|
|
932
932
|
bigint: true;
|
|
933
933
|
}
|
|
934
934
|
): BigIntStats;
|
|
935
935
|
(
|
|
936
|
-
path:
|
|
937
|
-
options:
|
|
936
|
+
path: PathLike,
|
|
937
|
+
options: StatSyncOptions & {
|
|
938
938
|
bigint: boolean;
|
|
939
939
|
throwIfNoEntry?: false | undefined;
|
|
940
940
|
}
|
|
941
941
|
): Stats | BigIntStats;
|
|
942
|
-
(path:
|
|
942
|
+
(path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined;
|
|
943
943
|
}
|
|
944
944
|
/**
|
|
945
945
|
* Synchronous stat(2) - Get file status.
|
|
@@ -993,7 +993,20 @@ declare module 'fs' {
|
|
|
993
993
|
* Synchronous fstat(2) - Get file status.
|
|
994
994
|
* @param fd A file descriptor.
|
|
995
995
|
*/
|
|
996
|
-
export
|
|
996
|
+
export function fstatSync(
|
|
997
|
+
fd: number,
|
|
998
|
+
options?: StatOptions & {
|
|
999
|
+
bigint?: false | undefined;
|
|
1000
|
+
}
|
|
1001
|
+
): Stats;
|
|
1002
|
+
export function fstatSync(
|
|
1003
|
+
fd: number,
|
|
1004
|
+
options: StatOptions & {
|
|
1005
|
+
bigint: true;
|
|
1006
|
+
}
|
|
1007
|
+
): BigIntStats;
|
|
1008
|
+
export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
|
|
1009
|
+
|
|
997
1010
|
/**
|
|
998
1011
|
* Retrieves the `fs.Stats` for the symbolic link referred to by the path.
|
|
999
1012
|
* The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
|
|
@@ -1045,8 +1058,8 @@ declare module 'fs' {
|
|
|
1045
1058
|
*/
|
|
1046
1059
|
export const lstatSync: StatSyncFn;
|
|
1047
1060
|
/**
|
|
1048
|
-
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than
|
|
1049
|
-
* possible
|
|
1061
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than
|
|
1062
|
+
* a possible
|
|
1050
1063
|
* exception are given to the completion callback.
|
|
1051
1064
|
* @since v0.1.31
|
|
1052
1065
|
*/
|
|
@@ -1060,7 +1073,7 @@ declare module 'fs' {
|
|
|
1060
1073
|
function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
|
1061
1074
|
}
|
|
1062
1075
|
/**
|
|
1063
|
-
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`.
|
|
1076
|
+
* Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`.
|
|
1064
1077
|
* @since v0.1.31
|
|
1065
1078
|
*/
|
|
1066
1079
|
export function linkSync(existingPath: PathLike, newPath: PathLike): void;
|
|
@@ -1456,7 +1469,7 @@ declare module 'fs' {
|
|
|
1456
1469
|
* Asynchronously creates a directory.
|
|
1457
1470
|
*
|
|
1458
1471
|
* The callback is given a possible exception and, if `recursive` is `true`, the
|
|
1459
|
-
* first directory path created, `(err,
|
|
1472
|
+
* first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was
|
|
1460
1473
|
* created.
|
|
1461
1474
|
*
|
|
1462
1475
|
* The optional `options` argument can be an integer specifying `mode` (permission
|
|
@@ -1949,7 +1962,7 @@ declare module 'fs' {
|
|
|
1949
1962
|
*
|
|
1950
1963
|
* Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented
|
|
1951
1964
|
* by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains
|
|
1952
|
-
* a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
1965
|
+
* a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams).
|
|
1953
1966
|
*
|
|
1954
1967
|
* Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc.
|
|
1955
1968
|
* @since v0.0.2
|
|
@@ -2202,9 +2215,9 @@ declare module 'fs' {
|
|
|
2202
2215
|
* If this method is invoked as its `util.promisify()` ed version, it returns
|
|
2203
2216
|
* a promise for an `Object` with `bytesRead` and `buffer` properties.
|
|
2204
2217
|
* @since v0.0.2
|
|
2205
|
-
* @param
|
|
2206
|
-
* @param
|
|
2207
|
-
* @param
|
|
2218
|
+
* @param buffer The buffer that the data will be written to.
|
|
2219
|
+
* @param offset The position in `buffer` to write the data to.
|
|
2220
|
+
* @param length The number of bytes to read.
|
|
2208
2221
|
* @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If
|
|
2209
2222
|
* `position` is an integer, the file position will be unchanged.
|
|
2210
2223
|
*/
|
|
@@ -2510,6 +2523,8 @@ declare module 'fs' {
|
|
|
2510
2523
|
*
|
|
2511
2524
|
* The `encoding` option is ignored if `data` is a buffer.
|
|
2512
2525
|
*
|
|
2526
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2527
|
+
*
|
|
2513
2528
|
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2514
2529
|
*
|
|
2515
2530
|
* ```js
|
|
@@ -2590,6 +2605,8 @@ declare module 'fs' {
|
|
|
2590
2605
|
*
|
|
2591
2606
|
* If `data` is a plain object, it must have an own (not inherited) `toString`function property.
|
|
2592
2607
|
*
|
|
2608
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2609
|
+
*
|
|
2593
2610
|
* For detailed information, see the documentation of the asynchronous version of
|
|
2594
2611
|
* this API: {@link writeFile}.
|
|
2595
2612
|
* @since v0.1.29
|
|
@@ -2600,6 +2617,8 @@ declare module 'fs' {
|
|
|
2600
2617
|
* Asynchronously append data to a file, creating the file if it does not yet
|
|
2601
2618
|
* exist. `data` can be a string or a `Buffer`.
|
|
2602
2619
|
*
|
|
2620
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2621
|
+
*
|
|
2603
2622
|
* ```js
|
|
2604
2623
|
* import { appendFile } from 'fs';
|
|
2605
2624
|
*
|
|
@@ -2674,6 +2693,8 @@ declare module 'fs' {
|
|
|
2674
2693
|
* Synchronously append data to a file, creating the file if it does not yet
|
|
2675
2694
|
* exist. `data` can be a string or a `Buffer`.
|
|
2676
2695
|
*
|
|
2696
|
+
* The `mode` option only affects the newly created file. See {@link open} for more details.
|
|
2697
|
+
*
|
|
2677
2698
|
* ```js
|
|
2678
2699
|
* import { appendFileSync } from 'fs';
|
|
2679
2700
|
*
|
|
@@ -3362,7 +3383,8 @@ declare module 'fs' {
|
|
|
3362
3383
|
* destroyed, like most `Readable` streams. Set the `emitClose` option to`false` to change this behavior.
|
|
3363
3384
|
*
|
|
3364
3385
|
* By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option,
|
|
3365
|
-
*
|
|
3386
|
+
* an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is
|
|
3387
|
+
* also required.
|
|
3366
3388
|
*
|
|
3367
3389
|
* ```js
|
|
3368
3390
|
* import { createReadStream } from 'fs';
|
|
@@ -3420,7 +3442,8 @@ declare module 'fs' {
|
|
|
3420
3442
|
*
|
|
3421
3443
|
* By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce
|
|
3422
3444
|
* performance as some optimizations (`_writev()`)
|
|
3423
|
-
* will be disabled. When providing the `fs` option,
|
|
3445
|
+
* will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override
|
|
3446
|
+
* for `open` is also required. If `autoClose` is `true`, an override for `close`is also required.
|
|
3424
3447
|
*
|
|
3425
3448
|
* Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be
|
|
3426
3449
|
* emitted. `fd` should be blocking; non-blocking `fd`s
|
|
@@ -3433,7 +3456,7 @@ declare module 'fs' {
|
|
|
3433
3456
|
export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream;
|
|
3434
3457
|
/**
|
|
3435
3458
|
* Forces all currently queued I/O operations associated with the file to the
|
|
3436
|
-
* operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
|
|
3459
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other
|
|
3437
3460
|
* than a possible
|
|
3438
3461
|
* exception are given to the completion callback.
|
|
3439
3462
|
* @since v0.1.96
|
|
@@ -3448,7 +3471,7 @@ declare module 'fs' {
|
|
|
3448
3471
|
}
|
|
3449
3472
|
/**
|
|
3450
3473
|
* Forces all currently queued I/O operations associated with the file to the
|
|
3451
|
-
* operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
|
|
3474
|
+
* operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`.
|
|
3452
3475
|
* @since v0.1.96
|
|
3453
3476
|
*/
|
|
3454
3477
|
export function fdatasyncSync(fd: number): void;
|
|
@@ -3654,6 +3677,8 @@ declare module 'fs' {
|
|
|
3654
3677
|
}
|
|
3655
3678
|
export interface StatOptions {
|
|
3656
3679
|
bigint?: boolean | undefined;
|
|
3680
|
+
}
|
|
3681
|
+
export interface StatSyncOptions extends StatOptions {
|
|
3657
3682
|
throwIfNoEntry?: boolean | undefined;
|
|
3658
3683
|
}
|
|
3659
3684
|
export interface CopyOptions {
|
node/http.d.ts
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* 'Host', 'mysite.com',
|
|
38
38
|
* 'accepT', '*' ]
|
|
39
39
|
* ```
|
|
40
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
40
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/http.js)
|
|
41
41
|
*/
|
|
42
42
|
declare module 'http' {
|
|
43
43
|
import * as stream from 'node:stream';
|
|
@@ -183,6 +183,18 @@ declare module 'http' {
|
|
|
183
183
|
* @since v0.7.0
|
|
184
184
|
*/
|
|
185
185
|
maxHeadersCount: number | null;
|
|
186
|
+
/**
|
|
187
|
+
* The maximum number of requests socket can handle
|
|
188
|
+
* before closing keep alive connection.
|
|
189
|
+
*
|
|
190
|
+
* A value of `null` will disable the limit.
|
|
191
|
+
*
|
|
192
|
+
* When limit is reach it will set `Connection` header value to `closed`,
|
|
193
|
+
* but will not actually close the connection, subsequent requests sent
|
|
194
|
+
* after the limit is reached will get `503 Service Unavailable` as a response.
|
|
195
|
+
* @since v16.10.0
|
|
196
|
+
*/
|
|
197
|
+
maxRequestsPerSocket: number | null;
|
|
186
198
|
/**
|
|
187
199
|
* The number of milliseconds of inactivity before a socket is presumed
|
|
188
200
|
* to have timed out.
|
|
@@ -341,11 +353,9 @@ declare module 'http' {
|
|
|
341
353
|
readonly socket: Socket | null;
|
|
342
354
|
constructor();
|
|
343
355
|
/**
|
|
344
|
-
* occurs, Same as binding to the `timeout` event.
|
|
345
|
-
*
|
|
346
356
|
* Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter.
|
|
347
357
|
* @since v0.9.12
|
|
348
|
-
* @param callback Optional function to be called when a timeout
|
|
358
|
+
* @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
|
|
349
359
|
*/
|
|
350
360
|
setTimeout(msecs: number, callback?: () => void): this;
|
|
351
361
|
/**
|
node/http2.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* const http2 = require('http2');
|
|
7
7
|
* ```
|
|
8
8
|
* @since v8.4.0
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/http2.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'http2' {
|
|
12
12
|
import EventEmitter = require('node:events');
|
|
@@ -2014,7 +2014,7 @@ declare module 'http2' {
|
|
|
2014
2014
|
/**
|
|
2015
2015
|
* Returns a `net.Server` instance that creates and manages `Http2Session`instances.
|
|
2016
2016
|
*
|
|
2017
|
-
* Since there are no browsers known that support[unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
|
|
2017
|
+
* Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when
|
|
2018
2018
|
* communicating
|
|
2019
2019
|
* with browser clients.
|
|
2020
2020
|
*
|
node/https.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
3
3
|
* separate module.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/https.js)
|
|
5
5
|
*/
|
|
6
6
|
declare module 'https' {
|
|
7
7
|
import { Duplex } from 'node:stream';
|
node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for non-npm package Node.js 16.
|
|
1
|
+
// Type definitions for non-npm package Node.js 16.10
|
|
2
2
|
// Project: https://nodejs.org/
|
|
3
3
|
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
4
|
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
node/inspector.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ```js
|
|
16
16
|
* const inspector = require('inspector');
|
|
17
17
|
* ```
|
|
18
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
18
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/inspector.js)
|
|
19
19
|
*/
|
|
20
20
|
declare module 'inspector' {
|
|
21
21
|
import EventEmitter = require('node:events');
|
|
@@ -1797,7 +1797,7 @@ declare module 'inspector' {
|
|
|
1797
1797
|
* // Output: { type: 'number', value: 4, description: '4' }
|
|
1798
1798
|
* ```
|
|
1799
1799
|
*
|
|
1800
|
-
* The latest version of the V8 inspector protocol is published on the[Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
|
|
1800
|
+
* The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/).
|
|
1801
1801
|
*
|
|
1802
1802
|
* Node.js inspector supports all the Chrome DevTools Protocol domains declared
|
|
1803
1803
|
* by V8\. Chrome DevTools Protocol domain provides an interface for interacting
|
node/net.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ```js
|
|
11
11
|
* const net = require('net');
|
|
12
12
|
* ```
|
|
13
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
13
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/net.js)
|
|
14
14
|
*/
|
|
15
15
|
declare module 'net' {
|
|
16
16
|
import * as stream from 'node:stream';
|
node/os.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ```js
|
|
6
6
|
* const os = require('os');
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/os.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module 'os' {
|
|
11
11
|
interface CpuInfo {
|
|
@@ -143,8 +143,8 @@ declare module 'os' {
|
|
|
143
143
|
/**
|
|
144
144
|
* Returns the operating system as a string.
|
|
145
145
|
*
|
|
146
|
-
* On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used.
|
|
147
|
-
*
|
|
146
|
+
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
|
|
147
|
+
* [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
148
148
|
* @since v0.3.3
|
|
149
149
|
*/
|
|
150
150
|
function release(): string;
|
|
@@ -396,8 +396,8 @@ declare module 'os' {
|
|
|
396
396
|
/**
|
|
397
397
|
* Returns a string identifying the kernel version.
|
|
398
398
|
*
|
|
399
|
-
* On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
|
400
|
-
* available, `GetVersionExW()` will be used. See[https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
399
|
+
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
|
400
|
+
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
|
401
401
|
* @since v13.11.0, v12.17.0
|
|
402
402
|
*/
|
|
403
403
|
function version(): string;
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.10.0",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -230,6 +230,6 @@
|
|
|
230
230
|
},
|
|
231
231
|
"scripts": {},
|
|
232
232
|
"dependencies": {},
|
|
233
|
-
"typesPublisherContentHash": "
|
|
233
|
+
"typesPublisherContentHash": "5fa1a7b33cabd00801ddd427f980e693ed01b2f38a3561caec3527de8e700c4d",
|
|
234
234
|
"typeScriptVersion": "3.7"
|
|
235
235
|
}
|
node/path.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare module 'path/win32' {
|
|
|
13
13
|
* ```js
|
|
14
14
|
* const path = require('path');
|
|
15
15
|
* ```
|
|
16
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/path.js)
|
|
17
17
|
*/
|
|
18
18
|
declare module 'path' {
|
|
19
19
|
namespace path {
|
node/perf_hooks.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This module provides an implementation of a subset of the W3C[Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
|
|
2
|
+
* This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
|
|
3
3
|
* Node.js-specific performance measurements.
|
|
4
4
|
*
|
|
5
5
|
* Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* performance.measure('A to B', 'A', 'B');
|
|
27
27
|
* });
|
|
28
28
|
* ```
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
29
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/perf_hooks.js)
|
|
30
30
|
*/
|
|
31
31
|
declare module 'perf_hooks' {
|
|
32
32
|
import { AsyncResource } from 'node:async_hooks';
|
node/process.d.ts
CHANGED
|
@@ -639,7 +639,7 @@ declare module 'process' {
|
|
|
639
639
|
*/
|
|
640
640
|
getgid(): number;
|
|
641
641
|
/**
|
|
642
|
-
* The `process.setgid()` method sets the group identity of the process. (See[`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
|
|
642
|
+
* The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
|
|
643
643
|
* numeric ID or a group name
|
|
644
644
|
* string. If a group name is specified, this method blocks while resolving the
|
|
645
645
|
* associated numeric ID.
|
|
@@ -683,7 +683,7 @@ declare module 'process' {
|
|
|
683
683
|
*/
|
|
684
684
|
getuid(): number;
|
|
685
685
|
/**
|
|
686
|
-
* The `process.setuid(id)` method sets the user identity of the process. (See[`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
|
|
686
|
+
* The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
|
|
687
687
|
* numeric ID or a username string.
|
|
688
688
|
* If a username is specified, the method blocks while resolving the associated
|
|
689
689
|
* numeric ID.
|
|
@@ -1067,7 +1067,7 @@ declare module 'process' {
|
|
|
1067
1067
|
* ```
|
|
1068
1068
|
*
|
|
1069
1069
|
* The value `'android'` may also be returned if the Node.js is built on the
|
|
1070
|
-
* Android operating system. However, Android support in Node.js[is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
|
|
1070
|
+
* Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
|
|
1071
1071
|
* @since v0.1.16
|
|
1072
1072
|
*/
|
|
1073
1073
|
readonly platform: Platform;
|
node/punycode.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* made available to developers as a convenience. Fixes or other modifications to
|
|
25
25
|
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
|
26
26
|
* @deprecated Since v7.0.0 - Deprecated
|
|
27
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
27
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/punycode.js)
|
|
28
28
|
*/
|
|
29
29
|
declare module 'punycode' {
|
|
30
30
|
/**
|
|
@@ -39,7 +39,7 @@ declare module 'punycode' {
|
|
|
39
39
|
*/
|
|
40
40
|
function decode(string: string): string;
|
|
41
41
|
/**
|
|
42
|
-
* The `punycode.encode()` method converts a string of Unicode codepoints to a[Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
|
|
42
|
+
* The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
|
|
43
43
|
*
|
|
44
44
|
* ```js
|
|
45
45
|
* punycode.encode('mañana'); // 'maana-pta'
|
|
@@ -50,7 +50,7 @@ declare module 'punycode' {
|
|
|
50
50
|
function encode(string: string): string;
|
|
51
51
|
/**
|
|
52
52
|
* The `punycode.toUnicode()` method converts a string representing a domain name
|
|
53
|
-
* containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492)encoded parts of the domain name are be
|
|
53
|
+
* containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
|
|
54
54
|
* converted.
|
|
55
55
|
*
|
|
56
56
|
* ```js
|
node/querystring.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* The `querystring` API is considered Legacy. While it is still maintained,
|
|
10
10
|
* new code should use the `URLSearchParams` API instead.
|
|
11
11
|
* @deprecated Legacy
|
|
12
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
12
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/querystring.js)
|
|
13
13
|
*/
|
|
14
14
|
declare module 'querystring' {
|
|
15
15
|
interface StringifyOptions {
|
|
@@ -25,14 +25,14 @@ declare module 'querystring' {
|
|
|
25
25
|
* The `querystring.stringify()` method produces a URL query string from a
|
|
26
26
|
* given `obj` by iterating through the object's "own properties".
|
|
27
27
|
*
|
|
28
|
-
* It serializes the following types of values passed in `obj`:[
|
|
29
|
-
* [
|
|
30
|
-
* [
|
|
31
|
-
* [
|
|
32
|
-
* [
|
|
33
|
-
* [
|
|
34
|
-
* [
|
|
35
|
-
* [
|
|
28
|
+
* It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
|
|
29
|
+
* [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
|
|
30
|
+
* [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
|
|
31
|
+
* [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
|
|
32
|
+
* [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
|
|
33
|
+
* [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
|
|
34
|
+
* [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
|
|
35
|
+
* [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
|
|
36
36
|
* empty strings.
|
|
37
37
|
*
|
|
38
38
|
* ```js
|
node/readline.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
|
|
28
28
|
* received on the `input` stream.
|
|
29
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
29
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/readline.js)
|
|
30
30
|
*/
|
|
31
31
|
declare module 'readline' {
|
|
32
32
|
import { Abortable, EventEmitter } from 'node:events';
|
node/repl.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const repl = require('repl');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/repl.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'repl' {
|
|
12
12
|
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|