@types/node 22.15.30 → 24.0.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 (60) hide show
  1. node/README.md +1 -1
  2. node/assert.d.ts +5 -5
  3. node/async_hooks.d.ts +26 -6
  4. node/buffer.d.ts +1 -2
  5. node/child_process.d.ts +2 -2
  6. node/cluster.d.ts +15 -15
  7. node/console.d.ts +17 -17
  8. node/crypto.d.ts +35 -28
  9. node/dgram.d.ts +1 -1
  10. node/diagnostics_channel.d.ts +1 -1
  11. node/dns.d.ts +16 -16
  12. node/domain.d.ts +1 -1
  13. node/events.d.ts +1 -2
  14. node/fs/promises.d.ts +16 -9
  15. node/fs.d.ts +28 -19
  16. node/globals.d.ts +7 -6
  17. node/globals.typedarray.d.ts +1 -0
  18. node/http.d.ts +2 -2
  19. node/http2.d.ts +6 -3
  20. node/https.d.ts +1 -1
  21. node/index.d.ts +7 -5
  22. node/inspector.d.ts +3 -7
  23. node/module.d.ts +63 -29
  24. node/net.d.ts +2 -5
  25. node/os.d.ts +8 -7
  26. node/package.json +13 -3
  27. node/path.d.ts +1 -1
  28. node/perf_hooks.d.ts +8 -8
  29. node/process.d.ts +21 -11
  30. node/punycode.d.ts +1 -1
  31. node/querystring.d.ts +1 -1
  32. node/readline/promises.d.ts +0 -1
  33. node/readline.d.ts +13 -13
  34. node/repl.d.ts +14 -16
  35. node/sea.d.ts +1 -1
  36. node/sqlite.d.ts +182 -2
  37. node/stream.d.ts +8 -19
  38. node/string_decoder.d.ts +1 -1
  39. node/test.d.ts +53 -15
  40. node/timers/promises.d.ts +1 -1
  41. node/timers.d.ts +1 -1
  42. node/tls.d.ts +2 -48
  43. node/trace_events.d.ts +6 -6
  44. node/{compatibility → ts5.1/compatibility}/disposable.d.ts +0 -4
  45. node/ts5.1/index.d.ts +98 -0
  46. node/ts5.6/compatibility/float16array.d.ts +71 -0
  47. node/ts5.6/globals.typedarray.d.ts +1 -0
  48. node/ts5.6/index.d.ts +9 -5
  49. node/ts5.7/compatibility/float16array.d.ts +72 -0
  50. node/ts5.7/index.d.ts +96 -0
  51. node/tty.d.ts +1 -1
  52. node/url.d.ts +52 -19
  53. node/util.d.ts +16 -295
  54. node/v8.d.ts +29 -32
  55. node/vm.d.ts +17 -10
  56. node/wasi.d.ts +1 -1
  57. node/worker_threads.d.ts +34 -18
  58. node/zlib.d.ts +5 -7
  59. node/compatibility/index.d.ts +0 -9
  60. node/compatibility/indexable.d.ts +0 -23
node/timers/promises.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  * } from 'node:timers/promises';
12
12
  * ```
13
13
  * @since v15.0.0
14
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/timers/promises.js)
14
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers/promises.js)
15
15
  */
16
16
  declare module "timers/promises" {
17
17
  import { TimerOptions } from "node:timers";
node/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/v22.x/lib/timers.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers.js)
10
10
  */
11
11
  declare module "timers" {
12
12
  import { Abortable } from "node:events";
node/tls.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```js
7
7
  * import tls from 'node:tls';
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tls.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tls.js)
10
10
  */
11
11
  declare module "tls" {
12
12
  import { X509Certificate } from "node:crypto";
@@ -797,13 +797,6 @@ declare module "tls" {
797
797
  prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
798
798
  prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
799
799
  }
800
- /**
801
- * @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
802
- */
803
- interface SecurePair {
804
- encrypted: TLSSocket;
805
- cleartext: TLSSocket;
806
- }
807
800
  type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
808
801
  interface SecureContextOptions {
809
802
  /**
@@ -1102,45 +1095,6 @@ declare module "tls" {
1102
1095
  secureConnectListener?: () => void,
1103
1096
  ): TLSSocket;
1104
1097
  function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
1105
- /**
1106
- * Creates a new secure pair object with two streams, one of which reads and writes
1107
- * the encrypted data and the other of which reads and writes the cleartext data.
1108
- * Generally, the encrypted stream is piped to/from an incoming encrypted data
1109
- * stream and the cleartext one is used as a replacement for the initial encrypted
1110
- * stream.
1111
- *
1112
- * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties.
1113
- *
1114
- * Using `cleartext` has the same API as {@link TLSSocket}.
1115
- *
1116
- * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
1117
- *
1118
- * ```js
1119
- * pair = tls.createSecurePair(// ... );
1120
- * pair.encrypted.pipe(socket);
1121
- * socket.pipe(pair.encrypted);
1122
- * ```
1123
- *
1124
- * can be replaced by:
1125
- *
1126
- * ```js
1127
- * secureSocket = tls.TLSSocket(socket, options);
1128
- * ```
1129
- *
1130
- * where `secureSocket` has the same API as `pair.cleartext`.
1131
- * @since v0.3.2
1132
- * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
1133
- * @param context A secure context object as returned by `tls.createSecureContext()`
1134
- * @param isServer `true` to specify that this TLS connection should be opened as a server.
1135
- * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
1136
- * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
1137
- */
1138
- function createSecurePair(
1139
- context?: SecureContext,
1140
- isServer?: boolean,
1141
- requestCert?: boolean,
1142
- rejectUnauthorized?: boolean,
1143
- ): SecurePair;
1144
1098
  /**
1145
1099
  * `{@link createServer}` sets the default value of the `honorCipherOrder` option
1146
1100
  * to `true`, other APIs that create secure contexts leave it unset.
@@ -1197,7 +1151,7 @@ declare module "tls" {
1197
1151
  * the `ciphers` option of `{@link createSecureContext}`.
1198
1152
  *
1199
1153
  * Not all supported ciphers are enabled by default. See
1200
- * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v22.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1154
+ * [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v24.x/api/tls.html#modifying-the-default-tls-cipher-suite).
1201
1155
  *
1202
1156
  * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
1203
1157
  * TLSv1.2 and below.
node/trace_events.d.ts CHANGED
@@ -9,8 +9,8 @@
9
9
  * The available categories are:
10
10
  *
11
11
  * * `node`: An empty placeholder.
12
- * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) trace data.
13
- * The [`async_hooks`](https://nodejs.org/docs/latest-v22.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
12
+ * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) trace data.
13
+ * The [`async_hooks`](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html) 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
16
  * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
@@ -22,7 +22,7 @@
22
22
  * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
23
23
  * * `node.fs.async`: Enables capture of trace data for file system async methods.
24
24
  * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
25
- * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v22.x/api/perf_hooks.html) measurements.
25
+ * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v24.x/api/perf_hooks.html) measurements.
26
26
  * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
27
27
  * measures and marks.
28
28
  * * `node.perf.timerify`: Enables capture of only Performance API timerify
@@ -30,7 +30,7 @@
30
30
  * * `node.promises.rejections`: Enables capture of trace data tracking the number
31
31
  * of unhandled Promise rejections and handled-after-rejections.
32
32
  * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
33
- * * `v8`: The [V8](https://nodejs.org/docs/latest-v22.x/api/v8.html) events are GC, compiling, and execution related.
33
+ * * `v8`: The [V8](https://nodejs.org/docs/latest-v24.x/api/v8.html) events are GC, compiling, and execution related.
34
34
  * * `node.http`: Enables capture of trace data for http request / response.
35
35
  *
36
36
  * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
@@ -88,9 +88,9 @@
88
88
  * However the trace-event timestamps are expressed in microseconds,
89
89
  * unlike `process.hrtime()` which returns nanoseconds.
90
90
  *
91
- * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html#class-worker) threads.
91
+ * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v24.x/api/worker_threads.html#class-worker) threads.
92
92
  * @experimental
93
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/trace_events.js)
93
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/trace_events.js)
94
94
  */
95
95
  declare module "trace_events" {
96
96
  /**
@@ -1,7 +1,3 @@
1
- // Polyfills for the explicit resource management types added in TypeScript 5.2.
2
- // TODO: remove once this package no longer supports TS 5.1, and replace with a
3
- // <reference> to TypeScript's disposable library in index.d.ts.
4
-
5
1
  interface SymbolConstructor {
6
2
  readonly dispose: unique symbol;
7
3
  readonly asyncDispose: unique symbol;
node/ts5.1/index.d.ts ADDED
@@ -0,0 +1,98 @@
1
+ /**
2
+ * License for programmatically and manually incorporated
3
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
4
+ *
5
+ * Copyright Node.js contributors. All rights reserved.
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to
8
+ * deal in the Software without restriction, including without limitation the
9
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
+ * sell copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ * IN THE SOFTWARE.
23
+ */
24
+
25
+ // NOTE: These definitions support Node.js and TypeScript 5.1.
26
+
27
+ // Reference required TypeScript libraries:
28
+ /// <reference lib="es2020" />
29
+
30
+ // TypeScript library polyfills required for TypeScript <=5.1:
31
+ /// <reference path="./compatibility/disposable.d.ts" />
32
+
33
+ // TypeScript library polyfills required for TypeScript <=5.6:
34
+ /// <reference path="../ts5.6/compatibility/float16array.d.ts" />
35
+
36
+ // Iterator definitions required for compatibility with TypeScript <5.6:
37
+ /// <reference path="../compatibility/iterators.d.ts" />
38
+
39
+ // Definitions for Node.js modules specific to TypeScript <=5.6:
40
+ /// <reference path="../ts5.6/globals.typedarray.d.ts" />
41
+ /// <reference path="../ts5.6/buffer.buffer.d.ts" />
42
+
43
+ // Definitions for Node.js modules that are not specific to any version of TypeScript:
44
+ /// <reference path="../globals.d.ts" />
45
+ /// <reference path="../assert.d.ts" />
46
+ /// <reference path="../assert/strict.d.ts" />
47
+ /// <reference path="../async_hooks.d.ts" />
48
+ /// <reference path="../buffer.d.ts" />
49
+ /// <reference path="../child_process.d.ts" />
50
+ /// <reference path="../cluster.d.ts" />
51
+ /// <reference path="../console.d.ts" />
52
+ /// <reference path="../constants.d.ts" />
53
+ /// <reference path="../crypto.d.ts" />
54
+ /// <reference path="../dgram.d.ts" />
55
+ /// <reference path="../diagnostics_channel.d.ts" />
56
+ /// <reference path="../dns.d.ts" />
57
+ /// <reference path="../dns/promises.d.ts" />
58
+ /// <reference path="../dns/promises.d.ts" />
59
+ /// <reference path="../domain.d.ts" />
60
+ /// <reference path="../dom-events.d.ts" />
61
+ /// <reference path="../events.d.ts" />
62
+ /// <reference path="../fs.d.ts" />
63
+ /// <reference path="../fs/promises.d.ts" />
64
+ /// <reference path="../http.d.ts" />
65
+ /// <reference path="../http2.d.ts" />
66
+ /// <reference path="../https.d.ts" />
67
+ /// <reference path="../inspector.d.ts" />
68
+ /// <reference path="../module.d.ts" />
69
+ /// <reference path="../net.d.ts" />
70
+ /// <reference path="../os.d.ts" />
71
+ /// <reference path="../path.d.ts" />
72
+ /// <reference path="../perf_hooks.d.ts" />
73
+ /// <reference path="../process.d.ts" />
74
+ /// <reference path="../punycode.d.ts" />
75
+ /// <reference path="../querystring.d.ts" />
76
+ /// <reference path="../readline.d.ts" />
77
+ /// <reference path="../readline/promises.d.ts" />
78
+ /// <reference path="../repl.d.ts" />
79
+ /// <reference path="../sea.d.ts" />
80
+ /// <reference path="../sqlite.d.ts" />
81
+ /// <reference path="../stream.d.ts" />
82
+ /// <reference path="../stream/promises.d.ts" />
83
+ /// <reference path="../stream/consumers.d.ts" />
84
+ /// <reference path="../stream/web.d.ts" />
85
+ /// <reference path="../string_decoder.d.ts" />
86
+ /// <reference path="../test.d.ts" />
87
+ /// <reference path="../timers.d.ts" />
88
+ /// <reference path="../timers/promises.d.ts" />
89
+ /// <reference path="../tls.d.ts" />
90
+ /// <reference path="../trace_events.d.ts" />
91
+ /// <reference path="../tty.d.ts" />
92
+ /// <reference path="../url.d.ts" />
93
+ /// <reference path="../util.d.ts" />
94
+ /// <reference path="../v8.d.ts" />
95
+ /// <reference path="../vm.d.ts" />
96
+ /// <reference path="../wasi.d.ts" />
97
+ /// <reference path="../worker_threads.d.ts" />
98
+ /// <reference path="../zlib.d.ts" />
@@ -0,0 +1,71 @@
1
+ // Interface declaration for Float16Array, required in @types/node v24+.
2
+ // These definitions are specific to TS <=5.6.
3
+
4
+ // This needs all of the "common" properties/methods of the TypedArrays,
5
+ // otherwise the type unions `TypedArray` and `ArrayBufferView` will be
6
+ // empty objects.
7
+ interface Float16Array extends Pick<Float32Array, typeof Symbol.iterator | "entries" | "keys" | "values"> {
8
+ readonly BYTES_PER_ELEMENT: number;
9
+ readonly buffer: ArrayBufferLike;
10
+ readonly byteLength: number;
11
+ readonly byteOffset: number;
12
+ readonly length: number;
13
+ readonly [Symbol.toStringTag]: "Float16Array";
14
+ at(index: number): number | undefined;
15
+ copyWithin(target: number, start: number, end?: number): this;
16
+ every(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): boolean;
17
+ fill(value: number, start?: number, end?: number): this;
18
+ filter(predicate: (value: number, index: number, array: Float16Array) => any, thisArg?: any): Float16Array;
19
+ find(predicate: (value: number, index: number, obj: Float16Array) => boolean, thisArg?: any): number | undefined;
20
+ findIndex(predicate: (value: number, index: number, obj: Float16Array) => boolean, thisArg?: any): number;
21
+ findLast<S extends number>(
22
+ predicate: (value: number, index: number, array: Float16Array) => value is S,
23
+ thisArg?: any,
24
+ ): S | undefined;
25
+ findLast(
26
+ predicate: (value: number, index: number, array: Float16Array) => unknown,
27
+ thisArg?: any,
28
+ ): number | undefined;
29
+ findLastIndex(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): number;
30
+ forEach(callbackfn: (value: number, index: number, array: Float16Array) => void, thisArg?: any): void;
31
+ includes(searchElement: number, fromIndex?: number): boolean;
32
+ indexOf(searchElement: number, fromIndex?: number): number;
33
+ join(separator?: string): string;
34
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
35
+ map(callbackfn: (value: number, index: number, array: Float16Array) => number, thisArg?: any): Float16Array;
36
+ reduce(
37
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
38
+ ): number;
39
+ reduce(
40
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
41
+ initialValue: number,
42
+ ): number;
43
+ reduce<U>(
44
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float16Array) => U,
45
+ initialValue: U,
46
+ ): U;
47
+ reduceRight(
48
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
49
+ ): number;
50
+ reduceRight(
51
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float16Array) => number,
52
+ initialValue: number,
53
+ ): number;
54
+ reduceRight<U>(
55
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float16Array) => U,
56
+ initialValue: U,
57
+ ): U;
58
+ reverse(): Float16Array;
59
+ set(array: ArrayLike<number>, offset?: number): void;
60
+ slice(start?: number, end?: number): Float16Array;
61
+ some(predicate: (value: number, index: number, array: Float16Array) => unknown, thisArg?: any): boolean;
62
+ sort(compareFn?: (a: number, b: number) => number): this;
63
+ subarray(begin?: number, end?: number): Float16Array;
64
+ toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
65
+ toReversed(): Float16Array;
66
+ toSorted(compareFn?: (a: number, b: number) => number): Float16Array;
67
+ toString(): string;
68
+ valueOf(): Float16Array;
69
+ with(index: number, value: number): Float16Array;
70
+ [index: number]: number;
71
+ }
@@ -12,6 +12,7 @@ declare global {
12
12
  | Int32Array
13
13
  | BigUint64Array
14
14
  | BigInt64Array
15
+ | Float16Array
15
16
  | Float32Array
16
17
  | Float64Array;
17
18
  type ArrayBufferView = TypedArray | DataView;
node/ts5.6/index.d.ts CHANGED
@@ -22,15 +22,19 @@
22
22
  * IN THE SOFTWARE.
23
23
  */
24
24
 
25
- // NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
25
+ // NOTE: These definitions support Node.js and TypeScript 5.2 through 5.6.
26
26
 
27
- // Reference required TypeScript libs:
27
+ // Reference required TypeScript libraries:
28
28
  /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
29
30
 
30
- // TypeScript backwards-compatibility definitions:
31
- /// <reference path="../compatibility/index.d.ts" />
31
+ // TypeScript library polyfills required for TypeScript <=5.6:
32
+ /// <reference path="./compatibility/float16array.d.ts" />
32
33
 
33
- // Definitions specific to TypeScript 4.9 through 5.6:
34
+ // Iterator definitions required for compatibility with TypeScript <5.6:
35
+ /// <reference path="../compatibility/iterators.d.ts" />
36
+
37
+ // Definitions for Node.js modules specific to TypeScript <=5.6:
34
38
  /// <reference path="./globals.typedarray.d.ts" />
35
39
  /// <reference path="./buffer.buffer.d.ts" />
36
40
 
@@ -0,0 +1,72 @@
1
+ // Interface declaration for Float16Array, required in @types/node v24+.
2
+ // These definitions are specific to TS 5.7.
3
+
4
+ // This needs all of the "common" properties/methods of the TypedArrays,
5
+ // otherwise the type unions `TypedArray` and `ArrayBufferView` will be
6
+ // empty objects.
7
+ interface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
8
+ readonly BYTES_PER_ELEMENT: number;
9
+ readonly buffer: TArrayBuffer;
10
+ readonly byteLength: number;
11
+ readonly byteOffset: number;
12
+ readonly length: number;
13
+ readonly [Symbol.toStringTag]: "Float16Array";
14
+ at(index: number): number | undefined;
15
+ copyWithin(target: number, start: number, end?: number): this;
16
+ entries(): ArrayIterator<[number, number]>;
17
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
18
+ fill(value: number, start?: number, end?: number): this;
19
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;
20
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
21
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
22
+ findLast<S extends number>(
23
+ predicate: (value: number, index: number, array: this) => value is S,
24
+ thisArg?: any,
25
+ ): S | undefined;
26
+ findLast(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number | undefined;
27
+ findLastIndex(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number;
28
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
29
+ includes(searchElement: number, fromIndex?: number): boolean;
30
+ indexOf(searchElement: number, fromIndex?: number): number;
31
+ join(separator?: string): string;
32
+ keys(): ArrayIterator<number>;
33
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
34
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;
35
+ reduce(
36
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
37
+ ): number;
38
+ reduce(
39
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
40
+ initialValue: number,
41
+ ): number;
42
+ reduce<U>(
43
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
44
+ initialValue: U,
45
+ ): U;
46
+ reduceRight(
47
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
48
+ ): number;
49
+ reduceRight(
50
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
51
+ initialValue: number,
52
+ ): number;
53
+ reduceRight<U>(
54
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
55
+ initialValue: U,
56
+ ): U;
57
+ reverse(): this;
58
+ set(array: ArrayLike<number>, offset?: number): void;
59
+ slice(start?: number, end?: number): Float16Array<ArrayBuffer>;
60
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
61
+ sort(compareFn?: (a: number, b: number) => number): this;
62
+ subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;
63
+ toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
64
+ toReversed(): Float16Array<ArrayBuffer>;
65
+ toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;
66
+ toString(): string;
67
+ valueOf(): this;
68
+ values(): ArrayIterator<number>;
69
+ with(index: number, value: number): Float16Array<ArrayBuffer>;
70
+ [Symbol.iterator](): ArrayIterator<number>;
71
+ [index: number]: number;
72
+ }
node/ts5.7/index.d.ts ADDED
@@ -0,0 +1,96 @@
1
+ /**
2
+ * License for programmatically and manually incorporated
3
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
4
+ *
5
+ * Copyright Node.js contributors. All rights reserved.
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to
8
+ * deal in the Software without restriction, including without limitation the
9
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
+ * sell copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ * IN THE SOFTWARE.
23
+ */
24
+
25
+ // NOTE: These definitions support Node.js and TypeScript 5.7.
26
+
27
+ // Reference required TypeScript libraries:
28
+ /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
30
+
31
+ // TypeScript library polyfills required for TypeScript 5.7:
32
+ /// <reference path="./compatibility/float16array.d.ts" />
33
+
34
+ // Iterator definitions required for compatibility with TypeScript <5.6:
35
+ /// <reference path="../compatibility/iterators.d.ts" />
36
+
37
+ // Definitions for Node.js modules specific to TypeScript 5.7+:
38
+ /// <reference path="../globals.typedarray.d.ts" />
39
+ /// <reference path="../buffer.buffer.d.ts" />
40
+
41
+ // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
+ /// <reference path="../globals.d.ts" />
43
+ /// <reference path="../assert.d.ts" />
44
+ /// <reference path="../assert/strict.d.ts" />
45
+ /// <reference path="../async_hooks.d.ts" />
46
+ /// <reference path="../buffer.d.ts" />
47
+ /// <reference path="../child_process.d.ts" />
48
+ /// <reference path="../cluster.d.ts" />
49
+ /// <reference path="../console.d.ts" />
50
+ /// <reference path="../constants.d.ts" />
51
+ /// <reference path="../crypto.d.ts" />
52
+ /// <reference path="../dgram.d.ts" />
53
+ /// <reference path="../diagnostics_channel.d.ts" />
54
+ /// <reference path="../dns.d.ts" />
55
+ /// <reference path="../dns/promises.d.ts" />
56
+ /// <reference path="../dns/promises.d.ts" />
57
+ /// <reference path="../domain.d.ts" />
58
+ /// <reference path="../dom-events.d.ts" />
59
+ /// <reference path="../events.d.ts" />
60
+ /// <reference path="../fs.d.ts" />
61
+ /// <reference path="../fs/promises.d.ts" />
62
+ /// <reference path="../http.d.ts" />
63
+ /// <reference path="../http2.d.ts" />
64
+ /// <reference path="../https.d.ts" />
65
+ /// <reference path="../inspector.d.ts" />
66
+ /// <reference path="../module.d.ts" />
67
+ /// <reference path="../net.d.ts" />
68
+ /// <reference path="../os.d.ts" />
69
+ /// <reference path="../path.d.ts" />
70
+ /// <reference path="../perf_hooks.d.ts" />
71
+ /// <reference path="../process.d.ts" />
72
+ /// <reference path="../punycode.d.ts" />
73
+ /// <reference path="../querystring.d.ts" />
74
+ /// <reference path="../readline.d.ts" />
75
+ /// <reference path="../readline/promises.d.ts" />
76
+ /// <reference path="../repl.d.ts" />
77
+ /// <reference path="../sea.d.ts" />
78
+ /// <reference path="../sqlite.d.ts" />
79
+ /// <reference path="../stream.d.ts" />
80
+ /// <reference path="../stream/promises.d.ts" />
81
+ /// <reference path="../stream/consumers.d.ts" />
82
+ /// <reference path="../stream/web.d.ts" />
83
+ /// <reference path="../string_decoder.d.ts" />
84
+ /// <reference path="../test.d.ts" />
85
+ /// <reference path="../timers.d.ts" />
86
+ /// <reference path="../timers/promises.d.ts" />
87
+ /// <reference path="../tls.d.ts" />
88
+ /// <reference path="../trace_events.d.ts" />
89
+ /// <reference path="../tty.d.ts" />
90
+ /// <reference path="../url.d.ts" />
91
+ /// <reference path="../util.d.ts" />
92
+ /// <reference path="../v8.d.ts" />
93
+ /// <reference path="../vm.d.ts" />
94
+ /// <reference path="../wasi.d.ts" />
95
+ /// <reference path="../worker_threads.d.ts" />
96
+ /// <reference path="../zlib.d.ts" />
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/v22.x/lib/tty.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/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/v22.x/lib/url.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/url.js)
9
9
  */
10
10
  declare module "url" {
11
11
  import { Blob as NodeBlob } from "node:buffer";
@@ -420,14 +420,12 @@ declare module "url" {
420
420
  * Threads, `Blob` objects registered within one Worker will not be available
421
421
  * to other workers or the main thread.
422
422
  * @since v16.7.0
423
- * @experimental
424
423
  */
425
424
  static createObjectURL(blob: NodeBlob): string;
426
425
  /**
427
426
  * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
428
427
  * ID that isn't registered will silently fail.
429
428
  * @since v16.7.0
430
- * @experimental
431
429
  * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
432
430
  */
433
431
  static revokeObjectURL(id: string): void;
@@ -757,6 +755,45 @@ declare module "url" {
757
755
  */
758
756
  toJSON(): string;
759
757
  }
758
+ interface URLPatternComponentResult {
759
+ input: string;
760
+ groups: Record<string, string | undefined>;
761
+ }
762
+ interface URLPatternInit {
763
+ protocol?: string;
764
+ username?: string;
765
+ password?: string;
766
+ hostname?: string;
767
+ port?: string;
768
+ pathname?: string;
769
+ search?: string;
770
+ hash?: string;
771
+ baseURL?: string;
772
+ }
773
+ interface URLPatternOptions {
774
+ ignoreCase?: boolean;
775
+ }
776
+ interface URLPatternResult {
777
+ inputs: (string | URLPatternInit)[];
778
+ protocol: URLPatternComponentResult;
779
+ username: URLPatternComponentResult;
780
+ password: URLPatternComponentResult;
781
+ hostname: URLPatternComponentResult;
782
+ port: URLPatternComponentResult;
783
+ pathname: URLPatternComponentResult;
784
+ search: URLPatternComponentResult;
785
+ hash: URLPatternComponentResult;
786
+ }
787
+ /**
788
+ * @since v23.8.0
789
+ * @experimental
790
+ */
791
+ class URLPattern {
792
+ constructor(input: string | URLPatternInit, baseURL: string, options?: URLPatternOptions);
793
+ constructor(input?: string | URLPatternInit, options?: URLPatternOptions);
794
+ exec(input: string | URLPatternInit, baseURL?: string): URLPatternResult | null;
795
+ test(input: string | URLPatternInit, baseURL?: string): boolean;
796
+ }
760
797
  interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
761
798
  [Symbol.iterator](): URLSearchParamsIterator<T>;
762
799
  }
@@ -937,34 +974,30 @@ declare module "url" {
937
974
  values(): URLSearchParamsIterator<string>;
938
975
  [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
939
976
  }
940
- import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
977
+ import {
978
+ URL as _URL,
979
+ URLPattern as _URLPattern,
980
+ URLPatternInit as _URLPatternInit,
981
+ URLPatternResult as _URLPatternResult,
982
+ URLSearchParams as _URLSearchParams,
983
+ } from "url";
941
984
  global {
942
- interface URLSearchParams extends _URLSearchParams {}
943
985
  interface URL extends _URL {}
944
- interface Global {
945
- URL: typeof _URL;
946
- URLSearchParams: typeof _URLSearchParams;
947
- }
948
- /**
949
- * `URL` class is a global reference for `import { URL } from 'url'`
950
- * https://nodejs.org/api/url.html#the-whatwg-url-api
951
- * @since v10.0.0
952
- */
953
986
  var URL: typeof globalThis extends {
954
987
  onmessage: any;
955
988
  URL: infer T;
956
989
  } ? T
957
990
  : typeof _URL;
958
- /**
959
- * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'`
960
- * https://nodejs.org/api/url.html#class-urlsearchparams
961
- * @since v10.0.0
962
- */
991
+ interface URLSearchParams extends _URLSearchParams {}
963
992
  var URLSearchParams: typeof globalThis extends {
964
993
  onmessage: any;
965
994
  URLSearchParams: infer T;
966
995
  } ? T
967
996
  : typeof _URLSearchParams;
997
+ interface URLPatternInit extends _URLPatternInit {}
998
+ interface URLPatternResult extends _URLPatternResult {}
999
+ interface URLPattern extends _URLPattern {}
1000
+ var URLPattern: typeof _URLPattern;
968
1001
  }
969
1002
  }
970
1003
  declare module "node:url" {