@types/node 18.16.3 → 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 (96) hide show
  1. node/README.md +1 -1
  2. node/assert.d.ts +71 -75
  3. node/async_hooks.d.ts +62 -42
  4. node/buffer.d.ts +127 -99
  5. node/child_process.d.ts +50 -54
  6. node/cluster.d.ts +12 -12
  7. node/console.d.ts +5 -5
  8. node/crypto.d.ts +209 -220
  9. node/dgram.d.ts +15 -15
  10. node/diagnostics_channel.d.ts +25 -26
  11. node/dns/promises.d.ts +6 -6
  12. node/dns.d.ts +24 -16
  13. node/domain.d.ts +4 -4
  14. node/events.d.ts +60 -60
  15. node/fs/promises.d.ts +78 -48
  16. node/fs.d.ts +117 -81
  17. node/http.d.ts +158 -147
  18. node/http2.d.ts +42 -46
  19. node/https.d.ts +52 -153
  20. node/index.d.ts +1 -1
  21. node/inspector.d.ts +10 -3
  22. node/module.d.ts +5 -4
  23. node/net.d.ts +21 -18
  24. node/os.d.ts +22 -18
  25. node/package.json +2 -2
  26. node/path.d.ts +4 -4
  27. node/perf_hooks.d.ts +28 -15
  28. node/process.d.ts +43 -46
  29. node/punycode.d.ts +1 -1
  30. node/querystring.d.ts +5 -5
  31. node/readline/promises.d.ts +6 -4
  32. node/readline.d.ts +15 -15
  33. node/repl.d.ts +9 -9
  34. node/stream/consumers.d.ts +1 -1
  35. node/stream.d.ts +88 -136
  36. node/string_decoder.d.ts +6 -6
  37. node/test.d.ts +423 -186
  38. node/timers/promises.d.ts +3 -3
  39. node/timers.d.ts +2 -2
  40. node/tls.d.ts +24 -16
  41. node/trace_events.d.ts +20 -9
  42. node/ts4.8/assert.d.ts +71 -75
  43. node/ts4.8/async_hooks.d.ts +62 -42
  44. node/ts4.8/buffer.d.ts +127 -99
  45. node/ts4.8/child_process.d.ts +50 -54
  46. node/ts4.8/cluster.d.ts +12 -12
  47. node/ts4.8/console.d.ts +5 -5
  48. node/ts4.8/crypto.d.ts +209 -220
  49. node/ts4.8/dgram.d.ts +15 -15
  50. node/ts4.8/diagnostics_channel.d.ts +25 -26
  51. node/ts4.8/dns/promises.d.ts +6 -6
  52. node/ts4.8/dns.d.ts +24 -16
  53. node/ts4.8/domain.d.ts +4 -4
  54. node/ts4.8/events.d.ts +60 -60
  55. node/ts4.8/fs/promises.d.ts +96 -45
  56. node/ts4.8/fs.d.ts +203 -67
  57. node/ts4.8/globals.d.ts +29 -28
  58. node/ts4.8/http.d.ts +198 -126
  59. node/ts4.8/http2.d.ts +42 -46
  60. node/ts4.8/https.d.ts +52 -153
  61. node/ts4.8/inspector.d.ts +10 -3
  62. node/ts4.8/module.d.ts +5 -4
  63. node/ts4.8/net.d.ts +24 -21
  64. node/ts4.8/os.d.ts +22 -18
  65. node/ts4.8/path.d.ts +4 -4
  66. node/ts4.8/perf_hooks.d.ts +28 -15
  67. node/ts4.8/process.d.ts +43 -46
  68. node/ts4.8/punycode.d.ts +1 -1
  69. node/ts4.8/querystring.d.ts +5 -5
  70. node/ts4.8/readline/promises.d.ts +6 -4
  71. node/ts4.8/readline.d.ts +15 -15
  72. node/ts4.8/repl.d.ts +9 -9
  73. node/ts4.8/stream/consumers.d.ts +1 -1
  74. node/ts4.8/stream.d.ts +91 -139
  75. node/ts4.8/string_decoder.d.ts +6 -6
  76. node/ts4.8/test.d.ts +423 -186
  77. node/ts4.8/timers/promises.d.ts +3 -3
  78. node/ts4.8/timers.d.ts +9 -2
  79. node/ts4.8/tls.d.ts +24 -16
  80. node/ts4.8/trace_events.d.ts +20 -9
  81. node/ts4.8/tty.d.ts +4 -5
  82. node/ts4.8/url.d.ts +26 -36
  83. node/ts4.8/util.d.ts +143 -116
  84. node/ts4.8/v8.d.ts +110 -16
  85. node/ts4.8/vm.d.ts +292 -42
  86. node/ts4.8/wasi.d.ts +13 -19
  87. node/ts4.8/worker_threads.d.ts +32 -34
  88. node/ts4.8/zlib.d.ts +11 -11
  89. node/tty.d.ts +4 -5
  90. node/url.d.ts +26 -36
  91. node/util.d.ts +146 -111
  92. node/v8.d.ts +110 -16
  93. node/vm.d.ts +292 -42
  94. node/wasi.d.ts +13 -19
  95. node/worker_threads.d.ts +32 -34
  96. node/zlib.d.ts +11 -11
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `timers/promises` API provides an alternative set of timer functions
3
- * that return `Promise` objects. The API is accessible via`require('timers/promises')`.
3
+ * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`.
4
4
  *
5
5
  * ```js
6
6
  * import {
@@ -44,6 +44,8 @@ declare module 'timers/promises' {
44
44
  function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
45
45
  /**
46
46
  * Returns an async iterator that generates values in an interval of `delay` ms.
47
+ * If `ref` is `true`, you need to call `next()` of async iterator explicitly
48
+ * or implicitly to keep the event loop alive.
47
49
  *
48
50
  * ```js
49
51
  * import {
@@ -62,7 +64,6 @@ declare module 'timers/promises' {
62
64
  * @since v15.9.0
63
65
  */
64
66
  function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
65
-
66
67
  interface Scheduler {
67
68
  /**
68
69
  * ```js
@@ -85,7 +86,6 @@ declare module 'timers/promises' {
85
86
  */
86
87
  yield: () => Promise<void>;
87
88
  }
88
-
89
89
  const scheduler: Scheduler;
90
90
  }
91
91
  declare module 'node:timers/promises' {
node/ts4.8/timers.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * The `timer` module exposes a global API for scheduling functions to
3
3
  * be called at some future period of time. Because the timer functions are
4
- * globals, there is no need to call `require('timers')` to use the API.
4
+ * globals, there is no need to call `require('node:timers')` to use the API.
5
5
  *
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/v18.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
@@ -1,12 +1,12 @@
1
1
  /**
2
- * The `tls` module provides an implementation of the Transport Layer Security
2
+ * The `node:tls` module provides an implementation of the Transport Layer Security
3
3
  * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
4
4
  * The module can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const tls = require('tls');
7
+ * const tls = require('node:tls');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v18.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';
@@ -212,7 +212,7 @@ declare module 'tls' {
212
212
  *
213
213
  * Instances of `tls.TLSSocket` implement the duplex `Stream` interface.
214
214
  *
215
- * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the
215
+ * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the
216
216
  * connection is open.
217
217
  * @since v0.11.4
218
218
  */
@@ -259,13 +259,13 @@ declare module 'tls' {
259
259
  /**
260
260
  * Returns an object containing information on the negotiated cipher suite.
261
261
  *
262
- * For example:
262
+ * For example, a TLSv1.2 protocol with AES256-SHA cipher:
263
263
  *
264
264
  * ```json
265
265
  * {
266
- * "name": "AES128-SHA256",
267
- * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256",
268
- * "version": "TLSv1.2"
266
+ * "name": "AES256-SHA",
267
+ * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA",
268
+ * "version": "SSLv3"
269
269
  * }
270
270
  * ```
271
271
  *
@@ -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
  /**
@@ -912,14 +913,14 @@ declare module 'tls' {
912
913
  * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is
913
914
  * automatically set as a listener for the `'secureConnection'` event.
914
915
  *
915
- * The `ticketKeys` options is automatically shared between `cluster` module
916
+ * The `ticketKeys` options is automatically shared between `node:cluster` module
916
917
  * workers.
917
918
  *
918
919
  * The following illustrates a simple echo server:
919
920
  *
920
921
  * ```js
921
- * const tls = require('tls');
922
- * const fs = require('fs');
922
+ * const tls = require('node:tls');
923
+ * const fs = require('node:fs');
923
924
  *
924
925
  * const options = {
925
926
  * key: fs.readFileSync('server-key.pem'),
@@ -929,7 +930,7 @@ declare module 'tls' {
929
930
  * requestCert: true,
930
931
  *
931
932
  * // This is necessary only if the client uses a self-signed certificate.
932
- * ca: [ fs.readFileSync('client-cert.pem') ]
933
+ * ca: [ fs.readFileSync('client-cert.pem') ],
933
934
  * };
934
935
  *
935
936
  * const server = tls.createServer(options, (socket) => {
@@ -964,8 +965,8 @@ declare module 'tls' {
964
965
  *
965
966
  * ```js
966
967
  * // Assumes an echo server that is listening on port 8000.
967
- * const tls = require('tls');
968
- * const fs = require('fs');
968
+ * const tls = require('node:tls');
969
+ * const fs = require('node:fs');
969
970
  *
970
971
  * const options = {
971
972
  * // Necessary only if the server requires client certificate authentication.
@@ -1041,12 +1042,19 @@ declare module 'tls' {
1041
1042
  * APIs that create secure contexts have no default value.
1042
1043
  *
1043
1044
  * The `tls.createSecureContext()` method creates a `SecureContext` object. It is
1044
- * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods.
1045
+ * usable as an argument to several `tls` APIs, such as `server.addContext()`,
1046
+ * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option.
1045
1047
  *
1046
1048
  * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it.
1047
1049
  *
1048
1050
  * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of
1049
1051
  * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt).
1052
+ *
1053
+ * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength
1054
+ * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can
1055
+ * be used to create custom parameters. The key length must be greater than or
1056
+ * equal to 1024 bits or else an error will be thrown. Although 1024 bits is
1057
+ * permissible, use 2048 bits or larger for stronger security.
1050
1058
  * @since v0.11.13
1051
1059
  */
1052
1060
  function createSecureContext(options?: SecureContextOptions): SecureContext;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * The `trace_events` module provides a mechanism to centralize tracing information
3
- * generated by V8, Node.js core, and userspace code.
2
+ * The `node:trace_events` module provides a mechanism to centralize tracing
3
+ * information generated by V8, Node.js core, and userspace code.
4
4
  *
5
5
  * Tracing can be enabled with the `--trace-event-categories` command-line flag
6
- * or by using the `trace_events` module. The `--trace-event-categories` flag
6
+ * or by using the `node:trace_events` module. The `--trace-event-categories` flag
7
7
  * accepts a list of comma-separated category names.
8
8
  *
9
9
  * The available categories are:
@@ -13,9 +13,19 @@
13
13
  * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
14
14
  * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
15
15
  * * `node.console`: Enables capture of `console.time()` and `console.count()`output.
16
+ * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool
17
+ * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
18
+ * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool
19
+ * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
16
20
  * * `node.dns.native`: Enables capture of trace data for DNS queries.
21
+ * * `node.net.native`: Enables capture of trace data for network.
17
22
  * * `node.environment`: Enables capture of Node.js Environment milestones.
18
23
  * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
24
+ * * `node.fs_dir.sync`: Enables capture of trace data for file system sync
25
+ * directory methods.
26
+ * * `node.fs.async`: Enables capture of trace data for file system async methods.
27
+ * * `node.fs_dir.async`: Enables capture of trace data for file system async
28
+ * directory methods.
19
29
  * * `node.perf`: Enables capture of `Performance API` measurements.
20
30
  * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
21
31
  * measures and marks.
@@ -23,8 +33,9 @@
23
33
  * measurements.
24
34
  * * `node.promises.rejections`: Enables capture of trace data tracking the number
25
35
  * of unhandled Promise rejections and handled-after-rejections.
26
- * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
36
+ * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
27
37
  * * `v8`: The `V8` events are GC, compiling, and execution related.
38
+ * * `node.http`: Enables capture of trace data for http request / response.
28
39
  *
29
40
  * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
30
41
  *
@@ -43,10 +54,10 @@
43
54
  * node --trace-event-categories v8,node,node.async_hooks
44
55
  * ```
45
56
  *
46
- * Alternatively, trace events may be enabled using the `trace_events` module:
57
+ * Alternatively, trace events may be enabled using the `node:trace_events` module:
47
58
  *
48
59
  * ```js
49
- * const trace_events = require('trace_events');
60
+ * const trace_events = require('node:trace_events');
50
61
  * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
51
62
  * tracing.enable(); // Enable trace event capture for the 'node.perf' category
52
63
  *
@@ -83,7 +94,7 @@
83
94
  *
84
95
  * The features from this module are not available in `Worker` threads.
85
96
  * @experimental
86
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js)
97
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/trace_events.js)
87
98
  */
88
99
  declare module 'trace_events' {
89
100
  /**
@@ -132,7 +143,7 @@ declare module 'trace_events' {
132
143
  * Creates and returns a `Tracing` object for the given set of `categories`.
133
144
  *
134
145
  * ```js
135
- * const trace_events = require('trace_events');
146
+ * const trace_events = require('node:trace_events');
136
147
  * const categories = ['node.perf', 'node.async_hooks'];
137
148
  * const tracing = trace_events.createTracing({ categories });
138
149
  * tracing.enable();
@@ -152,7 +163,7 @@ declare module 'trace_events' {
152
163
  * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
153
164
  *
154
165
  * ```js
155
- * const trace_events = require('trace_events');
166
+ * const trace_events = require('node:trace_events');
156
167
  * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
157
168
  * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
158
169
  * const t3 = trace_events.createTracing({ categories: ['v8'] });
node/ts4.8/tty.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  /**
2
- * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes.
3
- * In most cases, it will not be necessary or possible to use this module directly.
4
- * However, it can be accessed using:
2
+ * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream`classes. In most cases, it will not be necessary or possible to use this module
3
+ * directly. However, it can be accessed using:
5
4
  *
6
5
  * ```js
7
- * const tty = require('tty');
6
+ * const tty = require('node:tty');
8
7
  * ```
9
8
  *
10
9
  * When Node.js detects that it is being run with a text terminal ("TTY")
@@ -22,7 +21,7 @@
22
21
  *
23
22
  * In most cases, there should be little to no reason for an application to
24
23
  * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
25
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tty.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v20.1.0/lib/tty.js)
26
25
  */
27
26
  declare module 'tty' {
28
27
  import * as net from 'node:net';
node/ts4.8/url.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * The `url` module provides utilities for URL resolution and parsing. It can be
3
- * accessed using:
2
+ * The `node:url` module provides utilities for URL resolution and parsing. It can
3
+ * be accessed using:
4
4
  *
5
5
  * ```js
6
- * import url from 'url';
6
+ * import url from 'node:url';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v18.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';
@@ -54,17 +54,11 @@ declare module 'url' {
54
54
  *
55
55
  * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
56
56
  *
57
- * Use of the legacy `url.parse()` method is discouraged. Users should
58
- * use the WHATWG `URL` API. Because the `url.parse()` method uses a
59
- * lenient, non-standard algorithm for parsing URL strings, security
60
- * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and
61
- * incorrect handling of usernames and passwords have been identified.
62
- *
63
- * Deprecation of this API has been shelved for now primarily due to the the
64
- * inability of the [WHATWG API to parse relative URLs](https://github.com/nodejs/node/issues/12682#issuecomment-1154492373).
65
- * [Discussions are ongoing](https://github.com/whatwg/url/issues/531) for the best way to resolve this.
66
- *
57
+ * `url.parse()` uses a lenient, non-standard algorithm for parsing URL
58
+ * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted
59
+ * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead.
67
60
  * @since v0.1.25
61
+ * @deprecated Use the WHATWG URL API instead.
68
62
  * @param urlString The URL string to parse.
69
63
  * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
70
64
  * on the returned URL object will be an unparsed, undecoded string.
@@ -79,15 +73,15 @@ declare module 'url' {
79
73
  * The `url.format()` method returns a formatted URL string derived from`urlObject`.
80
74
  *
81
75
  * ```js
82
- * const url = require('url');
76
+ * const url = require('node:url');
83
77
  * url.format({
84
78
  * protocol: 'https',
85
79
  * hostname: 'example.com',
86
80
  * pathname: '/some/path',
87
81
  * query: {
88
82
  * page: 1,
89
- * format: 'json'
90
- * }
83
+ * format: 'json',
84
+ * },
91
85
  * });
92
86
  *
93
87
  * // => 'https://example.com/some/path?page=1&#x26;format=json'
@@ -208,7 +202,7 @@ declare module 'url' {
208
202
  * manner similar to that of a web browser resolving an anchor tag.
209
203
  *
210
204
  * ```js
211
- * const url = require('url');
205
+ * const url = require('node:url');
212
206
  * url.resolve('/one/two/three', 'four'); // '/one/two/four'
213
207
  * url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
214
208
  * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
@@ -243,10 +237,8 @@ declare module 'url' {
243
237
  *
244
238
  * It performs the inverse operation to {@link domainToUnicode}.
245
239
  *
246
- * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
247
- *
248
240
  * ```js
249
- * import url from 'url';
241
+ * import url from 'node:url';
250
242
  *
251
243
  * console.log(url.domainToASCII('español.com'));
252
244
  * // Prints xn--espaol-zwa.com
@@ -264,10 +256,8 @@ declare module 'url' {
264
256
  *
265
257
  * It performs the inverse operation to {@link domainToASCII}.
266
258
  *
267
- * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged.
268
- *
269
259
  * ```js
270
- * import url from 'url';
260
+ * import url from 'node:url';
271
261
  *
272
262
  * console.log(url.domainToUnicode('xn--espaol-zwa.com'));
273
263
  * // Prints español.com
@@ -284,7 +274,7 @@ declare module 'url' {
284
274
  * well as ensuring a cross-platform valid absolute path string.
285
275
  *
286
276
  * ```js
287
- * import { fileURLToPath } from 'url';
277
+ * import { fileURLToPath } from 'node:url';
288
278
  *
289
279
  * const __filename = fileURLToPath(import.meta.url);
290
280
  *
@@ -310,7 +300,7 @@ declare module 'url' {
310
300
  * control characters are correctly encoded when converting into a File URL.
311
301
  *
312
302
  * ```js
313
- * import { pathToFileURL } from 'url';
303
+ * import { pathToFileURL } from 'node:url';
314
304
  *
315
305
  * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
316
306
  * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
@@ -328,7 +318,7 @@ declare module 'url' {
328
318
  * expected by the `http.request()` and `https.request()` APIs.
329
319
  *
330
320
  * ```js
331
- * import { urlToHttpOptions } from 'url';
321
+ * import { urlToHttpOptions } from 'node:url';
332
322
  * const myURL = new URL('https://a:b@測試?abc#foo');
333
323
  *
334
324
  * console.log(urlToHttpOptions(myURL));
@@ -376,7 +366,7 @@ declare module 'url' {
376
366
  * const {
377
367
  * Blob,
378
368
  * resolveObjectURL,
379
- * } = require('buffer');
369
+ * } = require('node:buffer');
380
370
  *
381
371
  * const blob = new Blob(['hello']);
382
372
  * const id = URL.createObjectURL(blob);
@@ -398,7 +388,7 @@ declare module 'url' {
398
388
  static createObjectURL(blob: NodeBlob): string;
399
389
  /**
400
390
  * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
401
- * ID that isnt registered will silently fail.
391
+ * ID that isn't registered will silently fail.
402
392
  * @since v16.7.0
403
393
  * @experimental
404
394
  * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
@@ -449,7 +439,7 @@ declare module 'url' {
449
439
  * // Prints example.org
450
440
  *
451
441
  * // Setting the hostname does not change the port
452
- * myURL.hostname = 'example.com:82';
442
+ * myURL.hostname = 'example.com';
453
443
  * console.log(myURL.href);
454
444
  * // Prints https://example.com:81/foo
455
445
  *
@@ -512,7 +502,7 @@ declare module 'url' {
512
502
  *
513
503
  * myURL.password = '123';
514
504
  * console.log(myURL.href);
515
- * // Prints https://abc:123@example.com
505
+ * // Prints https://abc:123@example.com/
516
506
  * ```
517
507
  *
518
508
  * Invalid URL characters included in the value assigned to the `password` property
@@ -656,14 +646,14 @@ declare module 'url' {
656
646
  * character, while `URLSearchParams` will always encode it:
657
647
  *
658
648
  * ```js
659
- * const myUrl = new URL('https://example.org/abc?foo=~bar');
649
+ * const myURL = new URL('https://example.org/abc?foo=~bar');
660
650
  *
661
- * console.log(myUrl.search); // prints ?foo=~bar
651
+ * console.log(myURL.search); // prints ?foo=~bar
662
652
  *
663
653
  * // Modify the URL via searchParams...
664
- * myUrl.searchParams.sort();
654
+ * myURL.searchParams.sort();
665
655
  *
666
- * console.log(myUrl.search); // prints ?foo=%7Ebar
656
+ * console.log(myURL.search); // prints ?foo=%7Ebar
667
657
  * ```
668
658
  */
669
659
  readonly searchParams: URLSearchParams;
@@ -835,7 +825,7 @@ declare module 'url' {
835
825
  set(name: string, value: string): void;
836
826
  /**
837
827
  * The total number of parameter entries.
838
- * @since v18.16.0
828
+ * @since v19.8.0
839
829
  */
840
830
  readonly size: number;
841
831
  /**