@types/node 20.19.25 → 24.10.3
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 v20.19 → node v24.10}/README.md +3 -3
- node v24.10/assert/strict.d.ts +111 -0
- {node v20.19 → node v24.10}/assert.d.ts +150 -97
- {node v20.19 → node v24.10}/async_hooks.d.ts +27 -9
- {node v20.19 → node v24.10}/buffer.buffer.d.ts +2 -1
- {node v20.19 → node v24.10}/buffer.d.ts +6 -8
- {node v20.19 → node v24.10}/child_process.d.ts +11 -10
- {node v20.19 → node v24.10}/cluster.d.ts +16 -15
- {node v20.19 → node v24.10}/console.d.ts +19 -18
- {node v20.19 → node v24.10}/crypto.d.ts +1120 -293
- {node v20.19 → node v24.10}/dgram.d.ts +5 -2
- {node v20.19 → node v24.10}/diagnostics_channel.d.ts +1 -3
- {node v20.19 → node v24.10}/dns/promises.d.ts +30 -6
- {node v20.19 → node v24.10}/dns.d.ts +69 -17
- {node v20.19 → node v24.10}/domain.d.ts +1 -1
- {node v20.19 → node v24.10}/events.d.ts +1 -2
- {node v20.19 → node v24.10}/fs/promises.d.ts +85 -38
- {node v20.19 → node v24.10}/fs.d.ts +387 -48
- {node v20.19 → node v24.10}/globals.d.ts +2 -4
- {node v20.19 → node v24.10}/globals.typedarray.d.ts +3 -0
- {node v20.19 → node v24.10}/http.d.ts +90 -5
- {node v20.19 → node v24.10}/http2.d.ts +166 -41
- {node v20.19 → node v24.10}/https.d.ts +4 -3
- {node v20.19 → node v24.10}/index.d.ts +13 -5
- node v24.10/inspector.d.ts +277 -0
- {node v20.19 → node v24.10}/inspector.generated.d.ts +1096 -829
- {node v20.19 → node v24.10}/module.d.ts +403 -48
- {node v20.19 → node v24.10}/net.d.ts +62 -20
- {node v20.19 → node v24.10}/os.d.ts +8 -7
- {node v20.19 → node v24.10}/package.json +18 -3
- {node v20.19 → node v24.10}/path.d.ts +3 -3
- {node v20.19 → node v24.10}/perf_hooks.d.ts +37 -16
- {node v20.19 → node v24.10}/process.d.ts +133 -16
- {node v20.19 → node v24.10}/punycode.d.ts +1 -1
- {node v20.19 → node v24.10}/querystring.d.ts +1 -1
- {node v20.19 → node v24.10}/readline/promises.d.ts +0 -1
- {node v20.19 → node v24.10}/readline.d.ts +19 -14
- {node v20.19 → node v24.10}/repl.d.ts +25 -17
- {node v20.19 → node v24.10}/sea.d.ts +11 -2
- node v24.10/sqlite.d.ts +937 -0
- {node v20.19 → node v24.10}/stream/web.d.ts +85 -45
- {node v20.19 → node v24.10}/stream.d.ts +36 -28
- {node v20.19 → node v24.10}/string_decoder.d.ts +1 -1
- {node v20.19 → node v24.10}/test.d.ts +587 -35
- {node v20.19 → node v24.10}/timers/promises.d.ts +1 -1
- {node v20.19 → node v24.10}/timers.d.ts +4 -5
- {node v20.19 → node v24.10}/tls.d.ts +62 -48
- {node v20.19 → node v24.10}/trace_events.d.ts +6 -6
- node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
- {node v20.19 → node v24.10}/ts5.6/globals.typedarray.d.ts +2 -0
- {node v20.19 → node v24.10}/ts5.6/index.d.ts +15 -5
- node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
- node v24.10/ts5.7/index.d.ts +103 -0
- {node v20.19 → node v24.10}/tty.d.ts +1 -1
- {node v20.19 → node v24.10}/url.d.ts +128 -35
- {node v20.19 → node v24.10}/util.d.ts +384 -390
- {node v20.19 → node v24.10}/v8.d.ts +175 -32
- {node v20.19 → node v24.10}/vm.d.ts +246 -67
- {node v20.19 → node v24.10}/wasi.d.ts +23 -2
- node v24.10/web-globals/crypto.d.ts +32 -0
- {node v20.19 → node v24.10}/web-globals/fetch.d.ts +4 -0
- node v24.10/web-globals/navigator.d.ts +25 -0
- node v24.10/web-globals/storage.d.ts +24 -0
- node v24.10/web-globals/streams.d.ts +22 -0
- {node v20.19 → node v24.10}/worker_threads.d.ts +205 -24
- {node v20.19 → node v24.10}/zlib.d.ts +185 -44
- node v20.19/assert/strict.d.ts +0 -8
- node v20.19/compatibility/disposable.d.ts +0 -16
- node v20.19/compatibility/index.d.ts +0 -9
- node v20.19/compatibility/indexable.d.ts +0 -20
- {node v20.19 → node v24.10}/LICENSE +0 -0
- {node v20.19 → node v24.10}/compatibility/iterators.d.ts +0 -0
- {node v20.19 → node v24.10}/constants.d.ts +0 -0
- {node v20.19 → node v24.10}/stream/consumers.d.ts +0 -0
- {node v20.19 → node v24.10}/stream/promises.d.ts +0 -0
- {node v20.19 → node v24.10}/ts5.6/buffer.buffer.d.ts +0 -0
- {node v20.19 → node v24.10}/web-globals/abortcontroller.d.ts +0 -0
- {node v20.19 → node v24.10}/web-globals/domexception.d.ts +0 -0
- {node v20.19 → node v24.10}/web-globals/events.d.ts +0 -0
|
@@ -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/
|
|
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";
|
|
@@ -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/
|
|
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";
|
|
@@ -60,12 +60,12 @@ declare module "timers" {
|
|
|
60
60
|
/**
|
|
61
61
|
* Cancels the immediate. This is similar to calling `clearImmediate()`.
|
|
62
62
|
* @since v20.5.0, v18.18.0
|
|
63
|
-
* @experimental
|
|
64
63
|
*/
|
|
65
64
|
[Symbol.dispose](): void;
|
|
66
65
|
_onImmediate(...args: any[]): void;
|
|
67
66
|
}
|
|
68
67
|
// Legacy interface used in Node.js v9 and prior
|
|
68
|
+
// TODO: remove in a future major version bump
|
|
69
69
|
/** @deprecated Use `NodeJS.Timeout` instead. */
|
|
70
70
|
interface Timer extends RefCounted {
|
|
71
71
|
hasRef(): boolean;
|
|
@@ -140,7 +140,6 @@ declare module "timers" {
|
|
|
140
140
|
/**
|
|
141
141
|
* Cancels the timeout.
|
|
142
142
|
* @since v20.5.0, v18.18.0
|
|
143
|
-
* @experimental
|
|
144
143
|
*/
|
|
145
144
|
[Symbol.dispose](): void;
|
|
146
145
|
_onTimeout(...args: any[]): void;
|
|
@@ -181,8 +180,8 @@ declare module "timers" {
|
|
|
181
180
|
/**
|
|
182
181
|
* Schedules repeated execution of `callback` every `delay` milliseconds.
|
|
183
182
|
*
|
|
184
|
-
* When `delay` is larger than `2147483647` or less than `1`, the `delay`
|
|
185
|
-
* set to `1`. Non-integer delays are truncated to an integer.
|
|
183
|
+
* When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
|
|
184
|
+
* will be set to `1`. Non-integer delays are truncated to an integer.
|
|
186
185
|
*
|
|
187
186
|
* If `callback` is not a function, a `TypeError` will be thrown.
|
|
188
187
|
*
|
|
@@ -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/
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tls.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module "tls" {
|
|
12
12
|
import { NonSharedBuffer } from "node:buffer";
|
|
@@ -821,13 +821,6 @@ declare module "tls" {
|
|
|
821
821
|
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
822
822
|
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
823
823
|
}
|
|
824
|
-
/**
|
|
825
|
-
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
|
826
|
-
*/
|
|
827
|
-
interface SecurePair {
|
|
828
|
-
encrypted: TLSSocket;
|
|
829
|
-
cleartext: TLSSocket;
|
|
830
|
-
}
|
|
831
824
|
type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";
|
|
832
825
|
interface SecureContextOptions {
|
|
833
826
|
/**
|
|
@@ -881,6 +874,7 @@ declare module "tls" {
|
|
|
881
874
|
ciphers?: string | undefined;
|
|
882
875
|
/**
|
|
883
876
|
* Name of an OpenSSL engine which can provide the client certificate.
|
|
877
|
+
* @deprecated
|
|
884
878
|
*/
|
|
885
879
|
clientCertEngine?: string | undefined;
|
|
886
880
|
/**
|
|
@@ -923,12 +917,14 @@ declare module "tls" {
|
|
|
923
917
|
/**
|
|
924
918
|
* Name of an OpenSSL engine to get private key from. Should be used
|
|
925
919
|
* together with privateKeyIdentifier.
|
|
920
|
+
* @deprecated
|
|
926
921
|
*/
|
|
927
922
|
privateKeyEngine?: string | undefined;
|
|
928
923
|
/**
|
|
929
924
|
* Identifier of a private key managed by an OpenSSL engine. Should be
|
|
930
925
|
* used together with privateKeyEngine. Should not be set together with
|
|
931
926
|
* key, because both options define a private key in different ways.
|
|
927
|
+
* @deprecated
|
|
932
928
|
*/
|
|
933
929
|
privateKeyIdentifier?: string | undefined;
|
|
934
930
|
/**
|
|
@@ -1123,45 +1119,6 @@ declare module "tls" {
|
|
|
1123
1119
|
secureConnectListener?: () => void,
|
|
1124
1120
|
): TLSSocket;
|
|
1125
1121
|
function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
1126
|
-
/**
|
|
1127
|
-
* Creates a new secure pair object with two streams, one of which reads and writes
|
|
1128
|
-
* the encrypted data and the other of which reads and writes the cleartext data.
|
|
1129
|
-
* Generally, the encrypted stream is piped to/from an incoming encrypted data
|
|
1130
|
-
* stream and the cleartext one is used as a replacement for the initial encrypted
|
|
1131
|
-
* stream.
|
|
1132
|
-
*
|
|
1133
|
-
* `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and `encrypted` stream properties.
|
|
1134
|
-
*
|
|
1135
|
-
* Using `cleartext` has the same API as {@link TLSSocket}.
|
|
1136
|
-
*
|
|
1137
|
-
* The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code:
|
|
1138
|
-
*
|
|
1139
|
-
* ```js
|
|
1140
|
-
* pair = tls.createSecurePair(// ... );
|
|
1141
|
-
* pair.encrypted.pipe(socket);
|
|
1142
|
-
* socket.pipe(pair.encrypted);
|
|
1143
|
-
* ```
|
|
1144
|
-
*
|
|
1145
|
-
* can be replaced by:
|
|
1146
|
-
*
|
|
1147
|
-
* ```js
|
|
1148
|
-
* secureSocket = tls.TLSSocket(socket, options);
|
|
1149
|
-
* ```
|
|
1150
|
-
*
|
|
1151
|
-
* where `secureSocket` has the same API as `pair.cleartext`.
|
|
1152
|
-
* @since v0.3.2
|
|
1153
|
-
* @deprecated Since v0.11.3 - Use {@link TLSSocket} instead.
|
|
1154
|
-
* @param context A secure context object as returned by `tls.createSecureContext()`
|
|
1155
|
-
* @param isServer `true` to specify that this TLS connection should be opened as a server.
|
|
1156
|
-
* @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
|
|
1157
|
-
* @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
|
|
1158
|
-
*/
|
|
1159
|
-
function createSecurePair(
|
|
1160
|
-
context?: SecureContext,
|
|
1161
|
-
isServer?: boolean,
|
|
1162
|
-
requestCert?: boolean,
|
|
1163
|
-
rejectUnauthorized?: boolean,
|
|
1164
|
-
): SecurePair;
|
|
1165
1122
|
/**
|
|
1166
1123
|
* `{@link createServer}` sets the default value of the `honorCipherOrder` option
|
|
1167
1124
|
* to `true`, other APIs that create secure contexts leave it unset.
|
|
@@ -1187,13 +1144,38 @@ declare module "tls" {
|
|
|
1187
1144
|
* @since v0.11.13
|
|
1188
1145
|
*/
|
|
1189
1146
|
function createSecureContext(options?: SecureContextOptions): SecureContext;
|
|
1147
|
+
/**
|
|
1148
|
+
* Returns an array containing the CA certificates from various sources, depending on `type`:
|
|
1149
|
+
*
|
|
1150
|
+
* * `"default"`: return the CA certificates that will be used by the Node.js TLS clients by default.
|
|
1151
|
+
* * When `--use-bundled-ca` is enabled (default), or `--use-openssl-ca` is not enabled,
|
|
1152
|
+
* this would include CA certificates from the bundled Mozilla CA store.
|
|
1153
|
+
* * When `--use-system-ca` is enabled, this would also include certificates from the system's
|
|
1154
|
+
* trusted store.
|
|
1155
|
+
* * When `NODE_EXTRA_CA_CERTS` is used, this would also include certificates loaded from the specified
|
|
1156
|
+
* file.
|
|
1157
|
+
* * `"system"`: return the CA certificates that are loaded from the system's trusted store, according
|
|
1158
|
+
* to rules set by `--use-system-ca`. This can be used to get the certificates from the system
|
|
1159
|
+
* when `--use-system-ca` is not enabled.
|
|
1160
|
+
* * `"bundled"`: return the CA certificates from the bundled Mozilla CA store. This would be the same
|
|
1161
|
+
* as `tls.rootCertificates`.
|
|
1162
|
+
* * `"extra"`: return the CA certificates loaded from `NODE_EXTRA_CA_CERTS`. It's an empty array if
|
|
1163
|
+
* `NODE_EXTRA_CA_CERTS` is not set.
|
|
1164
|
+
* @since v22.15.0
|
|
1165
|
+
* @param type The type of CA certificates that will be returned. Valid values
|
|
1166
|
+
* are `"default"`, `"system"`, `"bundled"` and `"extra"`.
|
|
1167
|
+
* **Default:** `"default"`.
|
|
1168
|
+
* @returns An array of PEM-encoded certificates. The array may contain duplicates
|
|
1169
|
+
* if the same certificate is repeatedly stored in multiple sources.
|
|
1170
|
+
*/
|
|
1171
|
+
function getCACertificates(type?: "default" | "system" | "bundled" | "extra"): string[];
|
|
1190
1172
|
/**
|
|
1191
1173
|
* Returns an array with the names of the supported TLS ciphers. The names are
|
|
1192
1174
|
* lower-case for historical reasons, but must be uppercased to be used in
|
|
1193
1175
|
* the `ciphers` option of `{@link createSecureContext}`.
|
|
1194
1176
|
*
|
|
1195
1177
|
* Not all supported ciphers are enabled by default. See
|
|
1196
|
-
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-
|
|
1178
|
+
* [Modifying the default TLS cipher suite](https://nodejs.org/docs/latest-v24.x/api/tls.html#modifying-the-default-tls-cipher-suite).
|
|
1197
1179
|
*
|
|
1198
1180
|
* Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
|
|
1199
1181
|
* TLSv1.2 and below.
|
|
@@ -1204,6 +1186,38 @@ declare module "tls" {
|
|
|
1204
1186
|
* @since v0.10.2
|
|
1205
1187
|
*/
|
|
1206
1188
|
function getCiphers(): string[];
|
|
1189
|
+
/**
|
|
1190
|
+
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
|
1191
|
+
* certificates are parsed successfully, they will become the default CA
|
|
1192
|
+
* certificate list returned by {@link getCACertificates} and used
|
|
1193
|
+
* by subsequent TLS connections that don't specify their own CA certificates.
|
|
1194
|
+
* The certificates will be deduplicated before being set as the default.
|
|
1195
|
+
*
|
|
1196
|
+
* This function only affects the current Node.js thread. Previous
|
|
1197
|
+
* sessions cached by the HTTPS agent won't be affected by this change, so
|
|
1198
|
+
* this method should be called before any unwanted cachable TLS connections are
|
|
1199
|
+
* made.
|
|
1200
|
+
*
|
|
1201
|
+
* To use system CA certificates as the default:
|
|
1202
|
+
*
|
|
1203
|
+
* ```js
|
|
1204
|
+
* import tls from 'node:tls';
|
|
1205
|
+
* tls.setDefaultCACertificates(tls.getCACertificates('system'));
|
|
1206
|
+
* ```
|
|
1207
|
+
*
|
|
1208
|
+
* This function completely replaces the default CA certificate list. To add additional
|
|
1209
|
+
* certificates to the existing defaults, get the current certificates and append to them:
|
|
1210
|
+
*
|
|
1211
|
+
* ```js
|
|
1212
|
+
* import tls from 'node:tls';
|
|
1213
|
+
* const currentCerts = tls.getCACertificates('default');
|
|
1214
|
+
* const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
|
|
1215
|
+
* tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
|
|
1216
|
+
* ```
|
|
1217
|
+
* @since v24.5.0
|
|
1218
|
+
* @param certs An array of CA certificates in PEM format.
|
|
1219
|
+
*/
|
|
1220
|
+
function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
|
|
1207
1221
|
/**
|
|
1208
1222
|
* The default curve name to use for ECDH key agreement in a tls server.
|
|
1209
1223
|
* The default value is `'auto'`. See `{@link createSecureContext()}` for further
|
|
@@ -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-
|
|
13
|
-
* The [`async_hooks`](https://nodejs.org/docs/latest-
|
|
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-
|
|
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-
|
|
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-
|
|
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/
|
|
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
|
/**
|
|
@@ -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;
|
|
@@ -25,6 +26,7 @@ declare global {
|
|
|
25
26
|
type NonSharedInt32Array = Int32Array;
|
|
26
27
|
type NonSharedBigUint64Array = BigUint64Array;
|
|
27
28
|
type NonSharedBigInt64Array = BigInt64Array;
|
|
29
|
+
type NonSharedFloat16Array = Float16Array;
|
|
28
30
|
type NonSharedFloat32Array = Float32Array;
|
|
29
31
|
type NonSharedFloat64Array = Float64Array;
|
|
30
32
|
type NonSharedDataView = DataView;
|
|
@@ -22,24 +22,32 @@
|
|
|
22
22
|
* IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
// NOTE: These definitions support Node.js and TypeScript
|
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 5.2 through 5.6.
|
|
26
26
|
|
|
27
|
-
// Reference required TypeScript
|
|
27
|
+
// Reference required TypeScript libraries:
|
|
28
28
|
/// <reference lib="es2020" />
|
|
29
|
+
/// <reference lib="esnext.disposable" />
|
|
29
30
|
|
|
30
|
-
// TypeScript
|
|
31
|
-
/// <reference path="
|
|
31
|
+
// TypeScript library polyfills required for TypeScript <=5.6:
|
|
32
|
+
/// <reference path="./compatibility/float16array.d.ts" />
|
|
32
33
|
|
|
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.6:
|
|
34
38
|
/// <reference path="./globals.typedarray.d.ts" />
|
|
35
39
|
/// <reference path="./buffer.buffer.d.ts" />
|
|
36
40
|
|
|
37
41
|
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
|
38
42
|
/// <reference path="../globals.d.ts" />
|
|
39
43
|
/// <reference path="../web-globals/abortcontroller.d.ts" />
|
|
44
|
+
/// <reference path="../web-globals/crypto.d.ts" />
|
|
40
45
|
/// <reference path="../web-globals/domexception.d.ts" />
|
|
41
46
|
/// <reference path="../web-globals/events.d.ts" />
|
|
42
47
|
/// <reference path="../web-globals/fetch.d.ts" />
|
|
48
|
+
/// <reference path="../web-globals/navigator.d.ts" />
|
|
49
|
+
/// <reference path="../web-globals/storage.d.ts" />
|
|
50
|
+
/// <reference path="../web-globals/streams.d.ts" />
|
|
43
51
|
/// <reference path="../assert.d.ts" />
|
|
44
52
|
/// <reference path="../assert/strict.d.ts" />
|
|
45
53
|
/// <reference path="../async_hooks.d.ts" />
|
|
@@ -60,6 +68,7 @@
|
|
|
60
68
|
/// <reference path="../http.d.ts" />
|
|
61
69
|
/// <reference path="../http2.d.ts" />
|
|
62
70
|
/// <reference path="../https.d.ts" />
|
|
71
|
+
/// <reference path="../inspector.d.ts" />
|
|
63
72
|
/// <reference path="../inspector.generated.d.ts" />
|
|
64
73
|
/// <reference path="../module.d.ts" />
|
|
65
74
|
/// <reference path="../net.d.ts" />
|
|
@@ -73,6 +82,7 @@
|
|
|
73
82
|
/// <reference path="../readline/promises.d.ts" />
|
|
74
83
|
/// <reference path="../repl.d.ts" />
|
|
75
84
|
/// <reference path="../sea.d.ts" />
|
|
85
|
+
/// <reference path="../sqlite.d.ts" />
|
|
76
86
|
/// <reference path="../stream.d.ts" />
|
|
77
87
|
/// <reference path="../stream/promises.d.ts" />
|
|
78
88
|
/// <reference path="../stream/consumers.d.ts" />
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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="../web-globals/abortcontroller.d.ts" />
|
|
44
|
+
/// <reference path="../web-globals/crypto.d.ts" />
|
|
45
|
+
/// <reference path="../web-globals/domexception.d.ts" />
|
|
46
|
+
/// <reference path="../web-globals/events.d.ts" />
|
|
47
|
+
/// <reference path="../web-globals/fetch.d.ts" />
|
|
48
|
+
/// <reference path="../web-globals/navigator.d.ts" />
|
|
49
|
+
/// <reference path="../web-globals/storage.d.ts" />
|
|
50
|
+
/// <reference path="../web-globals/streams.d.ts" />
|
|
51
|
+
/// <reference path="../assert.d.ts" />
|
|
52
|
+
/// <reference path="../assert/strict.d.ts" />
|
|
53
|
+
/// <reference path="../async_hooks.d.ts" />
|
|
54
|
+
/// <reference path="../buffer.d.ts" />
|
|
55
|
+
/// <reference path="../child_process.d.ts" />
|
|
56
|
+
/// <reference path="../cluster.d.ts" />
|
|
57
|
+
/// <reference path="../console.d.ts" />
|
|
58
|
+
/// <reference path="../constants.d.ts" />
|
|
59
|
+
/// <reference path="../crypto.d.ts" />
|
|
60
|
+
/// <reference path="../dgram.d.ts" />
|
|
61
|
+
/// <reference path="../diagnostics_channel.d.ts" />
|
|
62
|
+
/// <reference path="../dns.d.ts" />
|
|
63
|
+
/// <reference path="../dns/promises.d.ts" />
|
|
64
|
+
/// <reference path="../domain.d.ts" />
|
|
65
|
+
/// <reference path="../events.d.ts" />
|
|
66
|
+
/// <reference path="../fs.d.ts" />
|
|
67
|
+
/// <reference path="../fs/promises.d.ts" />
|
|
68
|
+
/// <reference path="../http.d.ts" />
|
|
69
|
+
/// <reference path="../http2.d.ts" />
|
|
70
|
+
/// <reference path="../https.d.ts" />
|
|
71
|
+
/// <reference path="../inspector.d.ts" />
|
|
72
|
+
/// <reference path="../inspector.generated.d.ts" />
|
|
73
|
+
/// <reference path="../module.d.ts" />
|
|
74
|
+
/// <reference path="../net.d.ts" />
|
|
75
|
+
/// <reference path="../os.d.ts" />
|
|
76
|
+
/// <reference path="../path.d.ts" />
|
|
77
|
+
/// <reference path="../perf_hooks.d.ts" />
|
|
78
|
+
/// <reference path="../process.d.ts" />
|
|
79
|
+
/// <reference path="../punycode.d.ts" />
|
|
80
|
+
/// <reference path="../querystring.d.ts" />
|
|
81
|
+
/// <reference path="../readline.d.ts" />
|
|
82
|
+
/// <reference path="../readline/promises.d.ts" />
|
|
83
|
+
/// <reference path="../repl.d.ts" />
|
|
84
|
+
/// <reference path="../sea.d.ts" />
|
|
85
|
+
/// <reference path="../sqlite.d.ts" />
|
|
86
|
+
/// <reference path="../stream.d.ts" />
|
|
87
|
+
/// <reference path="../stream/promises.d.ts" />
|
|
88
|
+
/// <reference path="../stream/consumers.d.ts" />
|
|
89
|
+
/// <reference path="../stream/web.d.ts" />
|
|
90
|
+
/// <reference path="../string_decoder.d.ts" />
|
|
91
|
+
/// <reference path="../test.d.ts" />
|
|
92
|
+
/// <reference path="../timers.d.ts" />
|
|
93
|
+
/// <reference path="../timers/promises.d.ts" />
|
|
94
|
+
/// <reference path="../tls.d.ts" />
|
|
95
|
+
/// <reference path="../trace_events.d.ts" />
|
|
96
|
+
/// <reference path="../tty.d.ts" />
|
|
97
|
+
/// <reference path="../url.d.ts" />
|
|
98
|
+
/// <reference path="../util.d.ts" />
|
|
99
|
+
/// <reference path="../v8.d.ts" />
|
|
100
|
+
/// <reference path="../vm.d.ts" />
|
|
101
|
+
/// <reference path="../wasi.d.ts" />
|
|
102
|
+
/// <reference path="../worker_threads.d.ts" />
|
|
103
|
+
/// <reference path="../zlib.d.ts" />
|
|
@@ -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/
|
|
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";
|