@types/node 20.12.7 → 20.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node/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/v20.2.0/lib/fs.js)
19
+ * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/fs.js)
20
20
  */
21
21
  declare module "fs" {
22
22
  import * as stream from "node:stream";
@@ -1439,7 +1439,7 @@ declare module "fs" {
1439
1439
  * 2. The maximum number of symbolic links is platform-independent and generally
1440
1440
  * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports.
1441
1441
  *
1442
- * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths.
1442
+ * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths.
1443
1443
  *
1444
1444
  * Only paths that can be converted to UTF8 strings are supported.
1445
1445
  *
@@ -1683,7 +1683,7 @@ declare module "fs" {
1683
1683
  retryDelay?: number | undefined;
1684
1684
  }
1685
1685
  /**
1686
- * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the
1686
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). No arguments other than a possible exception are given to the
1687
1687
  * completion callback.
1688
1688
  * @since v14.14.0
1689
1689
  */
@@ -1696,7 +1696,7 @@ declare module "fs" {
1696
1696
  function __promisify__(path: PathLike, options?: RmOptions): Promise<void>;
1697
1697
  }
1698
1698
  /**
1699
- * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`.
1699
+ * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility). Returns `undefined`.
1700
1700
  * @since v14.14.0
1701
1701
  */
1702
1702
  export function rmSync(path: PathLike, options?: RmOptions): void;
@@ -1721,7 +1721,7 @@ declare module "fs" {
1721
1721
  * created (for instance, if it was previously created).
1722
1722
  *
1723
1723
  * The optional `options` argument can be an integer specifying `mode` (permission
1724
- * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that
1724
+ * and sticky bits), or an object with a `mode` property and a `recursive` property indicating whether parent directories should be created. Calling `fs.mkdir()` when `path` is a directory that
1725
1725
  * exists results in an error only
1726
1726
  * when `recursive` is false. If `recursive` is false and the directory exists,
1727
1727
  * an `EEXIST` error occurs.
@@ -1829,7 +1829,7 @@ declare module "fs" {
1829
1829
  ): Promise<string | undefined>;
1830
1830
  }
1831
1831
  /**
1832
- * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created.
1832
+ * Synchronously creates a directory. Returns `undefined`, or if `recursive` is `true`, the first directory path created.
1833
1833
  * This is the synchronous version of {@link mkdir}.
1834
1834
  *
1835
1835
  * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details.
@@ -1866,7 +1866,7 @@ declare module "fs" {
1866
1866
  /**
1867
1867
  * Creates a unique temporary directory.
1868
1868
  *
1869
- * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform
1869
+ * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. Due to platform
1870
1870
  * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms,
1871
1871
  * notably the BSDs, can return more than six random characters, and replace
1872
1872
  * trailing `X` characters in `prefix` with random characters.
@@ -2003,7 +2003,7 @@ declare module "fs" {
2003
2003
  */
2004
2004
  export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer;
2005
2005
  /**
2006
- * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`.
2006
+ * Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`.
2007
2007
  *
2008
2008
  * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details.
2009
2009
  *
@@ -2297,8 +2297,8 @@ declare module "fs" {
2297
2297
  *
2298
2298
  * The `atime` and `mtime` arguments follow these rules:
2299
2299
  *
2300
- * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`.
2301
- * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown.
2300
+ * * Values can be either numbers representing Unix epoch time in seconds, `Date`s, or a numeric string like `'123456789.0'`.
2301
+ * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or `-Infinity`, an `Error` will be thrown.
2302
2302
  * @since v0.4.2
2303
2303
  */
2304
2304
  export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void;
@@ -2371,7 +2371,7 @@ declare module "fs" {
2371
2371
  * should be written. If `typeof position !== 'number'`, the data will be written
2372
2372
  * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html).
2373
2373
  *
2374
- * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`.
2374
+ * The callback will be given three arguments `(err, bytesWritten, buffer)` where `bytesWritten` specifies how many _bytes_ were written from `buffer`.
2375
2375
  *
2376
2376
  * If this method is invoked as its `util.promisify()` ed version, it returns
2377
2377
  * a promise for an `Object` with `bytesWritten` and `buffer` properties.
@@ -2820,7 +2820,7 @@ declare module "fs" {
2820
2820
  * If the `encoding` option is specified then this function returns a
2821
2821
  * string. Otherwise it returns a buffer.
2822
2822
  *
2823
- * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific.
2823
+ * Similar to {@link readFile}, when the path is a directory, the behavior of `fs.readFileSync()` is platform-specific.
2824
2824
  *
2825
2825
  * ```js
2826
2826
  * import { readFileSync } from 'node:fs';
@@ -2890,7 +2890,7 @@ declare module "fs" {
2890
2890
  * When `file` is a filename, asynchronously writes data to the file, replacing the
2891
2891
  * file if it already exists. `data` can be a string or a buffer.
2892
2892
  *
2893
- * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using
2893
+ * When `file` is a file descriptor, the behavior is similar to calling `fs.write()` directly (which is recommended). See the notes below on using
2894
2894
  * a file descriptor.
2895
2895
  *
2896
2896
  * The `encoding` option is ignored if `data` is a buffer.
@@ -3139,7 +3139,7 @@ declare module "fs" {
3139
3139
  * Watch for changes on `filename`. The callback `listener` will be called each
3140
3140
  * time the file is accessed.
3141
3141
  *
3142
- * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
3142
+ * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates
3143
3143
  * whether the process should continue to run as long as files are being watched.
3144
3144
  * The `options` object may specify an `interval` property indicating how often the
3145
3145
  * target should be polled in milliseconds.
@@ -3168,7 +3168,7 @@ declare module "fs" {
3168
3168
  * again, with the latest stat objects. This is a change in functionality since
3169
3169
  * v0.10.
3170
3170
  *
3171
- * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
3171
+ * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible.
3172
3172
  *
3173
3173
  * When a file being watched by `fs.watchFile()` disappears and reappears,
3174
3174
  * then the contents of `previous` in the second callback event (the file's
@@ -3190,7 +3190,7 @@ declare module "fs" {
3190
3190
  * Watch for changes on `filename`. The callback `listener` will be called each
3191
3191
  * time the file is accessed.
3192
3192
  *
3193
- * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
3193
+ * The `options` argument may be omitted. If provided, it should be an object. The `options` object may contain a boolean named `persistent` that indicates
3194
3194
  * whether the process should continue to run as long as files are being watched.
3195
3195
  * The `options` object may specify an `interval` property indicating how often the
3196
3196
  * target should be polled in milliseconds.
@@ -3219,7 +3219,7 @@ declare module "fs" {
3219
3219
  * again, with the latest stat objects. This is a change in functionality since
3220
3220
  * v0.10.
3221
3221
  *
3222
- * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
3222
+ * Using {@link watch} is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible.
3223
3223
  *
3224
3224
  * When a file being watched by `fs.watchFile()` disappears and reappears,
3225
3225
  * then the contents of `previous` in the second callback event (the file's
@@ -3263,7 +3263,7 @@ declare module "fs" {
3263
3263
  * Calling `fs.unwatchFile()` with a filename that is not being watched is a
3264
3264
  * no-op, not an error.
3265
3265
  *
3266
- * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible.
3266
+ * Using {@link watch} is more efficient than `fs.watchFile()` and `fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()` and `fs.unwatchFile()` when possible.
3267
3267
  * @since v0.1.31
3268
3268
  * @param listener Optional, a listener previously attached using `fs.watchFile()`
3269
3269
  */
@@ -3291,7 +3291,7 @@ declare module "fs" {
3291
3291
  * On most platforms, `'rename'` is emitted whenever a filename appears or
3292
3292
  * disappears in the directory.
3293
3293
  *
3294
- * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`.
3294
+ * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of `eventType`.
3295
3295
  *
3296
3296
  * If a `signal` is passed, aborting the corresponding AbortController will close
3297
3297
  * the returned `fs.FSWatcher`.
@@ -3351,11 +3351,11 @@ declare module "fs" {
3351
3351
  * ```
3352
3352
  *
3353
3353
  * **The parameters for this callback are not consistent with other Node.js**
3354
- * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback
3354
+ * **callbacks.** Normally, the first parameter to a Node.js callback is an `err` parameter, optionally followed by other parameters. The `fs.exists()` callback
3355
3355
  * has only one boolean parameter. This is one reason `fs.access()` is recommended
3356
3356
  * instead of `fs.exists()`.
3357
3357
  *
3358
- * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing
3358
+ * Using `fs.exists()` to check for the existence of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing
3359
3359
  * so introduces a race condition, since other processes may change the file's
3360
3360
  * state between the two calls. Instead, user code should open/read/write the
3361
3361
  * file directly and handle the error raised if the file does not exist.
@@ -3482,7 +3482,7 @@ declare module "fs" {
3482
3482
  * For detailed information, see the documentation of the asynchronous version of
3483
3483
  * this API: {@link exists}.
3484
3484
  *
3485
- * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other
3485
+ * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback` parameter to `fs.exists()` accepts parameters that are inconsistent with other
3486
3486
  * Node.js callbacks. `fs.existsSync()` does not use a callback.
3487
3487
  *
3488
3488
  * ```js
@@ -3611,13 +3611,13 @@ declare module "fs" {
3611
3611
  /**
3612
3612
  * Tests a user's permissions for the file or directory specified by `path`.
3613
3613
  * The `mode` argument is an optional integer that specifies the accessibility
3614
- * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
3614
+ * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and `fs.constants.X_OK`
3615
3615
  * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
3616
3616
  * possible values of `mode`.
3617
3617
  *
3618
3618
  * The final argument, `callback`, is a callback function that is invoked with
3619
3619
  * a possible error argument. If any of the accessibility checks fail, the error
3620
- * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable.
3620
+ * argument will be an `Error` object. The following examples check if `package.json` exists, and if it is readable or writable.
3621
3621
  *
3622
3622
  * ```js
3623
3623
  * import { access, constants } from 'node:fs';
@@ -3645,7 +3645,7 @@ declare module "fs" {
3645
3645
  * });
3646
3646
  * ```
3647
3647
  *
3648
- * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing
3648
+ * Do not use `fs.access()` to check for the accessibility of a file before calling `fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing
3649
3649
  * so introduces a race condition, since other processes may change the file's
3650
3650
  * state between the two calls. Instead, user code should open/read/write the
3651
3651
  * file directly and handle the error raised if the file is not accessible.
@@ -3785,7 +3785,7 @@ declare module "fs" {
3785
3785
  /**
3786
3786
  * Synchronously tests a user's permissions for the file or directory specified
3787
3787
  * by `path`. The `mode` argument is an optional integer that specifies the
3788
- * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and
3788
+ * accessibility checks to be performed. `mode` should be either the value `fs.constants.F_OK` or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`, `fs.constants.W_OK`, and
3789
3789
  * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
3790
3790
  * possible values of `mode`.
3791
3791
  *
@@ -3859,8 +3859,8 @@ declare module "fs" {
3859
3859
  * By default, the stream will emit a `'close'` event after it has been
3860
3860
  * destroyed. Set the `emitClose` option to `false` to change this behavior.
3861
3861
  *
3862
- * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option,
3863
- * 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
3862
+ * By providing the `fs` option, it is possible to override the corresponding `fs` implementations for `open`, `read`, and `close`. When providing the `fs` option,
3863
+ * 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
3864
3864
  * also required.
3865
3865
  *
3866
3866
  * ```js
@@ -3908,7 +3908,7 @@ declare module "fs" {
3908
3908
  * replacing it may require the `flags` option to be set to `r+` rather than the
3909
3909
  * default `w`. The `encoding` can be any one of those accepted by `Buffer`.
3910
3910
  *
3911
- * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
3911
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'` the file descriptor will be closed automatically. If `autoClose` is false,
3912
3912
  * then the file descriptor won't be closed, even if there's an error.
3913
3913
  * It is the application's responsibility to close it and make sure there's no
3914
3914
  * file descriptor leak.
@@ -3916,12 +3916,12 @@ declare module "fs" {
3916
3916
  * By default, the stream will emit a `'close'` event after it has been
3917
3917
  * destroyed. Set the `emitClose` option to `false` to change this behavior.
3918
3918
  *
3919
- * 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
3919
+ * 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
3920
3920
  * performance as some optimizations (`_writev()`)
3921
- * 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
3922
- * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required.
3921
+ * 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
3922
+ * for `open` is also required. If `autoClose` is `true`, an override for `close` is also required.
3923
3923
  *
3924
- * 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
3924
+ * 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
3925
3925
  * emitted. `fd` should be blocking; non-blocking `fd`s
3926
3926
  * should be passed to `net.Socket`.
3927
3927
  *
@@ -4030,15 +4030,15 @@ declare module "fs" {
4030
4030
  */
4031
4031
  export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
4032
4032
  /**
4033
- * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
4033
+ * Write an array of `ArrayBufferView`s to the file specified by `fd` using `writev()`.
4034
4034
  *
4035
4035
  * `position` is the offset from the beginning of the file where this data
4036
4036
  * should be written. If `typeof position !== 'number'`, the data will be written
4037
4037
  * at the current position.
4038
4038
  *
4039
- * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`.
4039
+ * The callback will be given three arguments: `err`, `bytesWritten`, and `buffers`. `bytesWritten` is how many bytes were written from `buffers`.
4040
4040
  *
4041
- * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties.
4041
+ * If this method is `util.promisify()` ed, it returns a promise for an `Object` with `bytesWritten` and `buffers` properties.
4042
4042
  *
4043
4043
  * It is unsafe to use `fs.writev()` multiple times on the same file without
4044
4044
  * waiting for the callback. For this scenario, use {@link createWriteStream}.
@@ -4087,7 +4087,7 @@ declare module "fs" {
4087
4087
  * should be read. If `typeof position !== 'number'`, the data will be read
4088
4088
  * from the current position.
4089
4089
  *
4090
- * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file.
4090
+ * The callback will be given three arguments: `err`, `bytesRead`, and `buffers`. `bytesRead` is how many bytes were read from the file.
4091
4091
  *
4092
4092
  * If this method is invoked as its `util.promisify()` ed version, it returns
4093
4093
  * a promise for an `Object` with `bytesRead` and `buffers` properties.
node/http.d.ts CHANGED
@@ -37,7 +37,7 @@
37
37
  * 'Host', 'example.com',
38
38
  * 'accepT', '*' ]
39
39
  * ```
40
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js)
40
+ * @see [source](https://github.com/nodejs/node/blob/v20.12.2/lib/http.js)
41
41
  */
42
42
  declare module "http" {
43
43
  import * as stream from "node:stream";
@@ -590,12 +590,12 @@ declare module "http" {
590
590
  */
591
591
  setHeader(name: string, value: number | string | readonly string[]): this;
592
592
  /**
593
- * Append a single header value for the header object.
593
+ * Append a single header value to the header object.
594
594
  *
595
- * If the value is an array, this is equivalent of calling this method multiple
595
+ * If the value is an array, this is equivalent to calling this method multiple
596
596
  * times.
597
597
  *
598
- * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`.
598
+ * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`.
599
599
  *
600
600
  * Depending of the value of `options.uniqueHeaders` when the client request or the
601
601
  * server were created, this will end up in the header being sent multiple times or