@types/node 20.0.0 → 20.1.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.
Files changed (84) hide show
  1. node/README.md +1 -1
  2. node/assert.d.ts +4 -3
  3. node/async_hooks.d.ts +1 -1
  4. node/buffer.d.ts +6 -6
  5. node/child_process.d.ts +1 -1
  6. node/cluster.d.ts +1 -1
  7. node/console.d.ts +1 -1
  8. node/crypto.d.ts +1 -1
  9. node/dgram.d.ts +1 -1
  10. node/diagnostics_channel.d.ts +1 -1
  11. node/dns.d.ts +9 -1
  12. node/domain.d.ts +2 -2
  13. node/events.d.ts +1 -1
  14. node/fs/promises.d.ts +4 -0
  15. node/fs.d.ts +27 -1
  16. node/http.d.ts +12 -4
  17. node/http2.d.ts +1 -1
  18. node/https.d.ts +1 -1
  19. node/index.d.ts +1 -1
  20. node/inspector.d.ts +1 -1
  21. node/net.d.ts +1 -1
  22. node/os.d.ts +1 -1
  23. node/package.json +2 -2
  24. node/path.d.ts +1 -1
  25. node/perf_hooks.d.ts +1 -1
  26. node/punycode.d.ts +1 -1
  27. node/querystring.d.ts +1 -1
  28. node/readline.d.ts +1 -1
  29. node/repl.d.ts +1 -1
  30. node/stream.d.ts +15 -1
  31. node/string_decoder.d.ts +1 -1
  32. node/test.d.ts +423 -110
  33. node/timers.d.ts +1 -1
  34. node/tls.d.ts +3 -2
  35. node/trace_events.d.ts +1 -1
  36. node/ts4.8/assert.d.ts +5 -4
  37. node/ts4.8/async_hooks.d.ts +5 -13
  38. node/ts4.8/buffer.d.ts +6 -6
  39. node/ts4.8/child_process.d.ts +1 -1
  40. node/ts4.8/cluster.d.ts +1 -1
  41. node/ts4.8/console.d.ts +1 -1
  42. node/ts4.8/crypto.d.ts +1 -1
  43. node/ts4.8/dgram.d.ts +1 -1
  44. node/ts4.8/diagnostics_channel.d.ts +1 -1
  45. node/ts4.8/dns.d.ts +9 -1
  46. node/ts4.8/domain.d.ts +2 -2
  47. node/ts4.8/events.d.ts +1 -1
  48. node/ts4.8/fs/promises.d.ts +24 -0
  49. node/ts4.8/fs.d.ts +123 -1
  50. node/ts4.8/globals.d.ts +29 -28
  51. node/ts4.8/http.d.ts +67 -2
  52. node/ts4.8/http2.d.ts +1 -1
  53. node/ts4.8/https.d.ts +1 -1
  54. node/ts4.8/inspector.d.ts +1 -1
  55. node/ts4.8/net.d.ts +7 -7
  56. node/ts4.8/os.d.ts +1 -1
  57. node/ts4.8/path.d.ts +1 -1
  58. node/ts4.8/perf_hooks.d.ts +1 -1
  59. node/ts4.8/punycode.d.ts +1 -1
  60. node/ts4.8/querystring.d.ts +1 -1
  61. node/ts4.8/readline.d.ts +1 -1
  62. node/ts4.8/repl.d.ts +1 -1
  63. node/ts4.8/stream.d.ts +15 -1
  64. node/ts4.8/string_decoder.d.ts +1 -1
  65. node/ts4.8/test.d.ts +423 -111
  66. node/ts4.8/timers.d.ts +8 -1
  67. node/ts4.8/tls.d.ts +3 -2
  68. node/ts4.8/trace_events.d.ts +1 -1
  69. node/ts4.8/tty.d.ts +1 -1
  70. node/ts4.8/url.d.ts +1 -1
  71. node/ts4.8/util.d.ts +2 -2
  72. node/ts4.8/v8.d.ts +4 -1
  73. node/ts4.8/vm.d.ts +1 -1
  74. node/ts4.8/wasi.d.ts +6 -6
  75. node/ts4.8/worker_threads.d.ts +1 -1
  76. node/ts4.8/zlib.d.ts +1 -1
  77. node/tty.d.ts +1 -1
  78. node/url.d.ts +1 -1
  79. node/util.d.ts +2 -2
  80. node/v8.d.ts +1 -1
  81. node/vm.d.ts +1 -1
  82. node/wasi.d.ts +6 -6
  83. node/worker_threads.d.ts +1 -1
  84. node/zlib.d.ts +1 -1
node/ts4.8/timers.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * The timer functions within Node.js implement a similar API as the timers API
7
7
  * provided by Web Browsers but use a different internal implementation that is
8
8
  * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/timers.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/timers.js)
10
10
  */
11
11
  declare module 'timers' {
12
12
  import { Abortable } from 'node:events';
@@ -62,6 +62,13 @@ declare module 'timers' {
62
62
  [Symbol.toPrimitive](): number;
63
63
  }
64
64
  }
65
+ /**
66
+ * Schedules execution of a one-time `callback` after `delay` milliseconds. The `callback` will likely not be invoked in precisely `delay` milliseconds.
67
+ * Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.
68
+ * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be set to `1`. Non-integer delays are truncated to an integer.
69
+ * If `callback` is not a function, a [TypeError](https://nodejs.org/api/errors.html#class-typeerror) will be thrown.
70
+ * @since v0.0.1
71
+ */
65
72
  function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
66
73
  // util.promisify no rest args compability
67
74
  // tslint:disable-next-line void-return
node/ts4.8/tls.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```js
7
7
  * const tls = require('node:tls');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/tls.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/tls.js)
10
10
  */
11
11
  declare module 'tls' {
12
12
  import { X509Certificate } from 'node:crypto';
@@ -637,7 +637,8 @@ declare module 'tls' {
637
637
  * used.
638
638
  * @since v0.5.3
639
639
  * @param hostname A SNI host name or wildcard (e.g. `'*'`)
640
- * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
640
+ * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created
641
+ * with {@link createSecureContext} itself.
641
642
  */
642
643
  addContext(hostname: string, context: SecureContextOptions): void;
643
644
  /**
@@ -94,7 +94,7 @@
94
94
  *
95
95
  * The features from this module are not available in `Worker` threads.
96
96
  * @experimental
97
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/trace_events.js)
97
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/trace_events.js)
98
98
  */
99
99
  declare module 'trace_events' {
100
100
  /**
node/ts4.8/tty.d.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * In most cases, there should be little to no reason for an application to
23
23
  * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
24
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/tty.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/tty.js)
25
25
  */
26
26
  declare module 'tty' {
27
27
  import * as net from 'node:net';
node/ts4.8/url.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * ```js
6
6
  * import url from 'node:url';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/url.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/url.js)
9
9
  */
10
10
  declare module 'url' {
11
11
  import { Blob as NodeBlob } from 'node:buffer';
node/ts4.8/util.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```js
7
7
  * const util = require('node:util');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/util.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/util.js)
10
10
  */
11
11
  declare module 'util' {
12
12
  import * as types from 'node:util/types';
@@ -1834,7 +1834,7 @@ declare module 'util/types' {
1834
1834
  * ```js
1835
1835
  * const vm = require('node:vm');
1836
1836
  * const context = vm.createContext({});
1837
- * const myError = vm.runInContext('new Error', context);
1837
+ * const myError = vm.runInContext('new Error()', context);
1838
1838
  * console.log(util.types.isNativeError(myError)); // true
1839
1839
  * console.log(myError instanceof Error); // false
1840
1840
  * ```
node/ts4.8/v8.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * ```js
5
5
  * const v8 = require('node:v8');
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/v8.js)
8
8
  */
9
9
  declare module 'v8' {
10
10
  import { Readable } from 'node:stream';
@@ -29,6 +29,9 @@ declare module 'v8' {
29
29
  does_zap_garbage: DoesZapCodeSpaceFlag;
30
30
  number_of_native_contexts: number;
31
31
  number_of_detached_contexts: number;
32
+ total_global_handles_size: number;
33
+ used_global_handles_size: number;
34
+ external_memory: number;
32
35
  }
33
36
  interface HeapCodeStatistics {
34
37
  code_and_metadata_size: number;
node/ts4.8/vm.d.ts CHANGED
@@ -34,7 +34,7 @@
34
34
  *
35
35
  * console.log(x); // 1; y is not defined.
36
36
  * ```
37
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/vm.js)
37
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/vm.js)
38
38
  */
39
39
  declare module 'vm' {
40
40
  interface Context extends NodeJS.Dict<any> {}
node/ts4.8/wasi.d.ts CHANGED
@@ -62,7 +62,7 @@
62
62
  * $ wat2wasm demo.wat
63
63
  * ```
64
64
  * @experimental
65
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/wasi.js)
65
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/wasi.js)
66
66
  */
67
67
  declare module 'wasi' {
68
68
  interface WASIOptions {
@@ -85,11 +85,11 @@ declare module 'wasi' {
85
85
  */
86
86
  preopens?: NodeJS.Dict<string> | undefined;
87
87
  /**
88
- * By default, WASI applications terminate the Node.js
89
- * process via the `__wasi_proc_exit()` function. Setting this option to `true`
90
- * causes `wasi.start()` to return the exit code rather than terminate the
91
- * process.
92
- * @default false
88
+ * By default, when WASI applications call `__wasi_proc_exit()`
89
+ * `wasi.start()` will return with the exit code specified rather than terminatng the process.
90
+ * Setting this option to `false` will cause the Node.js process to exit with
91
+ * the specified exit code instead.
92
+ * @default true
93
93
  */
94
94
  returnOnExit?: boolean | undefined;
95
95
  /**
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
51
51
  * specifically `argv` and `execArgv` options.
52
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/worker_threads.js)
52
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/worker_threads.js)
53
53
  */
54
54
  declare module 'worker_threads' {
55
55
  import { Blob } from 'node:buffer';
node/ts4.8/zlib.d.ts CHANGED
@@ -88,7 +88,7 @@
88
88
  * });
89
89
  * ```
90
90
  * @since v0.5.8
91
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/zlib.js)
91
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/zlib.js)
92
92
  */
93
93
  declare module 'zlib' {
94
94
  import * as stream from 'node:stream';
node/tty.d.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * In most cases, there should be little to no reason for an application to
23
23
  * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
24
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/tty.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/tty.js)
25
25
  */
26
26
  declare module 'tty' {
27
27
  import * as net from 'node:net';
node/url.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  * ```js
6
6
  * import url from 'node:url';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/url.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/url.js)
9
9
  */
10
10
  declare module 'url' {
11
11
  import { Blob as NodeBlob } from 'node:buffer';
node/util.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```js
7
7
  * const util = require('node:util');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/util.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/util.js)
10
10
  */
11
11
  declare module 'util' {
12
12
  import * as types from 'node:util/types';
@@ -1842,7 +1842,7 @@ declare module 'util/types' {
1842
1842
  * ```js
1843
1843
  * const vm = require('node:vm');
1844
1844
  * const context = vm.createContext({});
1845
- * const myError = vm.runInContext('new Error', context);
1845
+ * const myError = vm.runInContext('new Error()', context);
1846
1846
  * console.log(util.types.isNativeError(myError)); // true
1847
1847
  * console.log(myError instanceof Error); // false
1848
1848
  * ```
node/v8.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * ```js
5
5
  * const v8 = require('node:v8');
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/v8.js)
8
8
  */
9
9
  declare module 'v8' {
10
10
  import { Readable } from 'node:stream';
node/vm.d.ts CHANGED
@@ -34,7 +34,7 @@
34
34
  *
35
35
  * console.log(x); // 1; y is not defined.
36
36
  * ```
37
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/vm.js)
37
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/vm.js)
38
38
  */
39
39
  declare module 'vm' {
40
40
  interface Context extends NodeJS.Dict<any> {}
node/wasi.d.ts CHANGED
@@ -62,7 +62,7 @@
62
62
  * $ wat2wasm demo.wat
63
63
  * ```
64
64
  * @experimental
65
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/wasi.js)
65
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/wasi.js)
66
66
  */
67
67
  declare module 'wasi' {
68
68
  interface WASIOptions {
@@ -85,11 +85,11 @@ declare module 'wasi' {
85
85
  */
86
86
  preopens?: NodeJS.Dict<string> | undefined;
87
87
  /**
88
- * By default, WASI applications terminate the Node.js
89
- * process via the `__wasi_proc_exit()` function. Setting this option to `true`
90
- * causes `wasi.start()` to return the exit code rather than terminate the
91
- * process.
92
- * @default false
88
+ * By default, when WASI applications call `__wasi_proc_exit()`
89
+ * `wasi.start()` will return with the exit code specified rather than terminatng the process.
90
+ * Setting this option to `false` will cause the Node.js process to exit with
91
+ * the specified exit code instead.
92
+ * @default true
93
93
  */
94
94
  returnOnExit?: boolean | undefined;
95
95
  /**
node/worker_threads.d.ts CHANGED
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
51
51
  * specifically `argv` and `execArgv` options.
52
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/worker_threads.js)
52
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/worker_threads.js)
53
53
  */
54
54
  declare module 'worker_threads' {
55
55
  import { Blob } from 'node:buffer';
node/zlib.d.ts CHANGED
@@ -88,7 +88,7 @@
88
88
  * });
89
89
  * ```
90
90
  * @since v0.5.8
91
- * @see [source](https://github.com/nodejs/node/blob/v20.0.0/lib/zlib.js)
91
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/zlib.js)
92
92
  */
93
93
  declare module 'zlib' {
94
94
  import * as stream from 'node:stream';