@types/node 24.13.5 → 24.19.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.
- {node v24.13 → node v24.19}/README.md +2 -2
- {node v24.13 → node v24.19}/async_hooks.d.ts +18 -22
- {node v24.13 → node v24.19}/buffer.buffer.d.ts +10 -5
- {node v24.13 → node v24.19}/buffer.d.ts +7 -0
- {node v24.13 → node v24.19}/child_process.d.ts +5 -1
- {node v24.13 → node v24.19}/crypto.d.ts +114 -47
- {node v24.13 → node v24.19}/dgram.d.ts +119 -4
- {node v24.13 → node v24.19}/dns/promises.d.ts +5 -5
- {node v24.13 → node v24.19}/dns.d.ts +6 -6
- {node v24.13 → node v24.19}/events.d.ts +13 -22
- {node v24.13 → node v24.19}/fs/promises.d.ts +79 -66
- {node v24.13 → node v24.19}/fs.d.ts +153 -90
- {node v24.13 → node v24.19}/http.d.ts +94 -2
- {node v24.13 → node v24.19}/http2.d.ts +65 -18
- {node v24.13 → node v24.19}/inspector.d.ts +47 -1
- {node v24.13 → node v24.19}/inspector.generated.d.ts +167 -0
- {node v24.13 → node v24.19}/module.d.ts +1 -0
- {node v24.13 → node v24.19}/net.d.ts +139 -15
- {node v24.13 → node v24.19}/os.d.ts +30 -30
- {node v24.13 → node v24.19}/package.json +3 -18
- {node v24.13 → node v24.19}/perf_hooks.d.ts +31 -19
- {node v24.13 → node v24.19}/process.d.ts +42 -43
- {node v24.13 → node v24.19}/sqlite.d.ts +153 -11
- {node v24.13 → node v24.19}/stream/consumers.d.ts +7 -0
- {node v24.13 → node v24.19}/stream/web.d.ts +19 -0
- {node v24.13 → node v24.19}/stream.d.ts +2 -1
- {node v24.13 → node v24.19}/test.d.ts +320 -13
- {node v24.13 → node v24.19}/tls.d.ts +50 -15
- {node v24.13 → node v24.19}/ts5.6/buffer.buffer.d.ts +5 -0
- {node v24.13 → node v24.19}/tty.d.ts +4 -3
- {node v24.13 → node v24.19}/url.d.ts +27 -3
- {node v24.13 → node v24.19}/util.d.ts +42 -2
- {node v24.13 → node v24.19}/v8.d.ts +51 -23
- {node v24.13 → node v24.19}/vm.d.ts +52 -87
- {node v24.13 → node v24.19}/zlib.d.ts +17 -0
- {node v24.13 → node v24.19}/LICENSE +0 -0
- {node v24.13 → node v24.19}/assert/strict.d.ts +0 -0
- {node v24.13 → node v24.19}/assert.d.ts +0 -0
- {node v24.13 → node v24.19}/cluster.d.ts +0 -0
- {node v24.13 → node v24.19}/compatibility/iterators.d.ts +0 -0
- {node v24.13 → node v24.19}/console.d.ts +0 -0
- {node v24.13 → node v24.19}/constants.d.ts +0 -0
- {node v24.13 → node v24.19}/diagnostics_channel.d.ts +0 -0
- {node v24.13 → node v24.19}/domain.d.ts +0 -0
- {node v24.13 → node v24.19}/globals.d.ts +0 -0
- {node v24.13 → node v24.19}/globals.typedarray.d.ts +0 -0
- {node v24.13 → node v24.19}/https.d.ts +0 -0
- {node v24.13 → node v24.19}/index.d.ts +0 -0
- {node v24.13 → node v24.19}/path.d.ts +0 -0
- {node v24.13 → node v24.19}/punycode.d.ts +0 -0
- {node v24.13 → node v24.19}/querystring.d.ts +0 -0
- {node v24.13 → node v24.19}/readline/promises.d.ts +0 -0
- {node v24.13 → node v24.19}/readline.d.ts +0 -0
- {node v24.13 → node v24.19}/repl.d.ts +0 -0
- {node v24.13 → node v24.19}/sea.d.ts +0 -0
- {node v24.13 → node v24.19}/stream/promises.d.ts +0 -0
- {node v24.13 → node v24.19}/string_decoder.d.ts +0 -0
- {node v24.13 → node v24.19}/timers/promises.d.ts +0 -0
- {node v24.13 → node v24.19}/timers.d.ts +0 -0
- {node v24.13 → node v24.19}/trace_events.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.6/compatibility/float16array.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.6/index.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.7/compatibility/float16array.d.ts +0 -0
- {node v24.13 → node v24.19}/ts5.7/index.d.ts +0 -0
- {node v24.13 → node v24.19}/wasi.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/abortcontroller.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/crypto.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/domexception.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/events.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/fetch.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/navigator.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/storage.d.ts +0 -0
- {node v24.13 → node v24.19}/web-globals/streams.d.ts +0 -0
- {node v24.13 → node v24.19}/worker_threads.d.ts +0 -0
|
@@ -8,8 +8,8 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v24.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Fri, 25 Sep 2026 22:04:07 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
15
|
-
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [
|
|
15
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig).
|
|
@@ -123,37 +123,31 @@ declare module "async_hooks" {
|
|
|
123
123
|
function triggerAsyncId(): number;
|
|
124
124
|
interface HookCallbacks {
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @param asyncId A unique ID for the async resource
|
|
128
|
-
* @param type The type of the async resource
|
|
129
|
-
* @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created
|
|
130
|
-
* @param resource Reference to the resource representing the async operation, needs to be released during destroy
|
|
126
|
+
* The [`init` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#initasyncid-type-triggerasyncid-resource).
|
|
131
127
|
*/
|
|
132
128
|
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
|
|
133
129
|
/**
|
|
134
|
-
*
|
|
135
|
-
* The before callback is called just before said callback is executed.
|
|
136
|
-
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
|
|
130
|
+
* The [`before` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#beforeasyncid).
|
|
137
131
|
*/
|
|
138
132
|
before?(asyncId: number): void;
|
|
139
133
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs.
|
|
143
|
-
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
|
|
134
|
+
* The [`after` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#afterasyncid).
|
|
144
135
|
*/
|
|
145
136
|
after?(asyncId: number): void;
|
|
146
137
|
/**
|
|
147
|
-
*
|
|
148
|
-
* as the promise itself.
|
|
149
|
-
* @param asyncId the unique id for the promise that was resolve()d.
|
|
138
|
+
* The [`promiseResolve` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#promiseresolveasyncid).
|
|
150
139
|
*/
|
|
151
140
|
promiseResolve?(asyncId: number): void;
|
|
152
141
|
/**
|
|
153
|
-
*
|
|
154
|
-
* @param asyncId a unique ID for the async resource
|
|
142
|
+
* The [`destroy` callback](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#destroyasyncid).
|
|
155
143
|
*/
|
|
156
144
|
destroy?(asyncId: number): void;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the hook should track `Promise`s. Cannot be `false` if
|
|
147
|
+
* `promiseResolve` is set.
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
trackPromises?: boolean | undefined;
|
|
157
151
|
}
|
|
158
152
|
interface AsyncHook {
|
|
159
153
|
/**
|
|
@@ -174,7 +168,8 @@ declare module "async_hooks" {
|
|
|
174
168
|
*
|
|
175
169
|
* All callbacks are optional. For example, if only resource cleanup needs to
|
|
176
170
|
* be tracked, then only the `destroy` callback needs to be passed. The
|
|
177
|
-
* specifics of all functions that can be passed to `callbacks` is in the
|
|
171
|
+
* specifics of all functions that can be passed to `callbacks` is in the
|
|
172
|
+
* [Hook Callbacks](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#hook-callbacks) section.
|
|
178
173
|
*
|
|
179
174
|
* ```js
|
|
180
175
|
* import { createHook } from 'node:async_hooks';
|
|
@@ -202,12 +197,13 @@ declare module "async_hooks" {
|
|
|
202
197
|
* ```
|
|
203
198
|
*
|
|
204
199
|
* Because promises are asynchronous resources whose lifecycle is tracked
|
|
205
|
-
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
|
|
200
|
+
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
|
|
201
|
+
* `destroy()` callbacks _must not_ be async functions that return promises.
|
|
206
202
|
* @since v8.1.0
|
|
207
|
-
* @param
|
|
208
|
-
* @
|
|
203
|
+
* @param options The [Hook Callbacks](https://nodejs.org/docs/latest-v24.x/api/async_hooks.html#hook-callbacks) to register
|
|
204
|
+
* @returns Instance used for disabling and enabling hooks
|
|
209
205
|
*/
|
|
210
|
-
function createHook(
|
|
206
|
+
function createHook(options: HookCallbacks): AsyncHook;
|
|
211
207
|
interface AsyncResourceOptions {
|
|
212
208
|
/**
|
|
213
209
|
* The ID of the execution context that created this async event.
|
|
@@ -316,11 +316,11 @@ declare module "buffer" {
|
|
|
316
316
|
* such `Buffer` instances with zeroes.
|
|
317
317
|
*
|
|
318
318
|
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
|
|
319
|
-
* allocations
|
|
320
|
-
*
|
|
321
|
-
* individually allocated `Buffer`
|
|
322
|
-
*
|
|
323
|
-
* many individual `ArrayBuffer` objects.
|
|
319
|
+
* allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
|
|
320
|
+
* from a single pre-allocated `Buffer`. This allows applications to avoid the
|
|
321
|
+
* garbage collection overhead of creating many individually allocated `Buffer`
|
|
322
|
+
* instances. This approach improves both performance and memory usage by
|
|
323
|
+
* eliminating the need to track and clean up as many individual `ArrayBuffer` objects.
|
|
324
324
|
*
|
|
325
325
|
* However, in the case where a developer may need to retain a small chunk of
|
|
326
326
|
* memory from a pool for an indeterminate amount of time, it may be appropriate
|
|
@@ -469,4 +469,9 @@ declare module "buffer" {
|
|
|
469
469
|
new(size: number): Buffer<ArrayBuffer>;
|
|
470
470
|
prototype: Buffer;
|
|
471
471
|
};
|
|
472
|
+
/**
|
|
473
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
474
|
+
* TypeScript versions earlier than 5.7.
|
|
475
|
+
*/
|
|
476
|
+
type BufferView<T extends NodeJS.ArrayBufferView> = T extends NodeJS.ArrayBufferView<infer B> ? Buffer<B> : never;
|
|
472
477
|
}
|
|
@@ -204,6 +204,13 @@ declare module "buffer" {
|
|
|
204
204
|
* @since v16.7.0
|
|
205
205
|
*/
|
|
206
206
|
stream(): WebReadableStream;
|
|
207
|
+
/**
|
|
208
|
+
* Returns a new `ReadableStream` that allows the content of the `Blob` to be read
|
|
209
|
+
* as a stream of UTF-8 decoded strings. It is equivalent to piping
|
|
210
|
+
* `blob.stream()` through a `TextDecoderStream` set up with UTF-8.
|
|
211
|
+
* @since v24.19.0
|
|
212
|
+
*/
|
|
213
|
+
textStream(): WebReadableStream<string>;
|
|
207
214
|
}
|
|
208
215
|
export interface FileOptions {
|
|
209
216
|
/**
|
|
@@ -220,6 +220,11 @@ declare module "child_process" {
|
|
|
220
220
|
/**
|
|
221
221
|
* The `subprocess.exitCode` property indicates the exit code of the child process.
|
|
222
222
|
* If the child process is still running, the field will be `null`.
|
|
223
|
+
*
|
|
224
|
+
* When the child process is terminated by a signal, `subprocess.exitCode` will be
|
|
225
|
+
* `null` and `subprocess.signalCode` will be set. To get the corresponding
|
|
226
|
+
* POSIX exit code, use
|
|
227
|
+
* `util.convertProcessSignalToExitCode(subprocess.signalCode)`.
|
|
223
228
|
*/
|
|
224
229
|
readonly exitCode: number | null;
|
|
225
230
|
/**
|
|
@@ -281,7 +286,6 @@ declare module "child_process" {
|
|
|
281
286
|
* new process in a shell or with the use of the `shell` option of `ChildProcess`:
|
|
282
287
|
*
|
|
283
288
|
* ```js
|
|
284
|
-
* 'use strict';
|
|
285
289
|
* import { spawn } from 'node:child_process';
|
|
286
290
|
*
|
|
287
291
|
* const subprocess = spawn(
|
|
@@ -615,30 +615,24 @@ declare module "crypto" {
|
|
|
615
615
|
*/
|
|
616
616
|
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
617
617
|
/**
|
|
618
|
-
* For symmetric keys, the following encoding options can be used:
|
|
619
|
-
*
|
|
620
|
-
* For public keys, the following encoding options can be used:
|
|
621
|
-
*
|
|
622
|
-
* For private keys, the following encoding options can be used:
|
|
623
|
-
*
|
|
624
618
|
* The result type depends on the selected encoding format, when PEM the
|
|
625
619
|
* result is a string, when DER it will be a buffer containing the data
|
|
626
|
-
* encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object.
|
|
627
|
-
*
|
|
628
|
-
* When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are
|
|
629
|
-
* ignored.
|
|
620
|
+
* encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. Raw formats return a
|
|
621
|
+
* `Buffer` containing the raw key material.
|
|
630
622
|
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
* encryption mechanism, PEM-level encryption is not
|
|
636
|
-
* a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption
|
|
637
|
-
* PKCS#1 and SEC1 encryption.
|
|
623
|
+
* Private keys can be encrypted by specifying a `cipher` and `passphrase`.
|
|
624
|
+
* The PKCS#8 `type` supports encryption with both PEM and DER `format` for any
|
|
625
|
+
* key algorithm. PKCS#1 and SEC1 can only be encrypted when the PEM `format` is
|
|
626
|
+
* used. For maximum compatibility, use PKCS#8 for encrypted private keys. Since
|
|
627
|
+
* PKCS#8 defines its own encryption mechanism, PEM-level encryption is not
|
|
628
|
+
* supported when encrypting a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption
|
|
629
|
+
* and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for PKCS#1 and SEC1 encryption.
|
|
638
630
|
* @since v11.6.0
|
|
639
631
|
*/
|
|
640
632
|
export(options: KeyExportOptions<"pem">): string | NonSharedBuffer;
|
|
641
|
-
export(
|
|
633
|
+
export(
|
|
634
|
+
options?: KeyExportOptions<"der"> | { format: "raw-public" | "raw-private" | "raw-seed" },
|
|
635
|
+
): NonSharedBuffer;
|
|
642
636
|
export(options?: JwkKeyExportOptions): JsonWebKey;
|
|
643
637
|
/**
|
|
644
638
|
* Returns `true` or `false` depending on whether the keys have exactly the same
|
|
@@ -1203,17 +1197,29 @@ declare module "crypto" {
|
|
|
1203
1197
|
}
|
|
1204
1198
|
interface PrivateKeyInput {
|
|
1205
1199
|
key: string | Buffer;
|
|
1206
|
-
format?:
|
|
1200
|
+
format?: "pem" | "der" | undefined;
|
|
1207
1201
|
type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
|
|
1208
1202
|
passphrase?: string | Buffer | undefined;
|
|
1209
1203
|
encoding?: string | undefined;
|
|
1210
1204
|
}
|
|
1205
|
+
interface RawPrivateKeyInput {
|
|
1206
|
+
key: Buffer;
|
|
1207
|
+
format: "raw-private" | "raw-seed";
|
|
1208
|
+
asymmetricKeyType: KeyType;
|
|
1209
|
+
namedCurve?: string | undefined;
|
|
1210
|
+
}
|
|
1211
1211
|
interface PublicKeyInput {
|
|
1212
1212
|
key: string | Buffer;
|
|
1213
|
-
format?:
|
|
1213
|
+
format?: "pem" | "der" | undefined;
|
|
1214
1214
|
type?: "pkcs1" | "spki" | undefined;
|
|
1215
1215
|
encoding?: string | undefined;
|
|
1216
1216
|
}
|
|
1217
|
+
interface RawPublicKeyInput {
|
|
1218
|
+
key: Buffer;
|
|
1219
|
+
format: "raw-public";
|
|
1220
|
+
asymmetricKeyType: KeyType;
|
|
1221
|
+
namedCurve?: string | undefined;
|
|
1222
|
+
}
|
|
1217
1223
|
/**
|
|
1218
1224
|
* Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
|
|
1219
1225
|
*
|
|
@@ -1275,7 +1281,14 @@ declare module "crypto" {
|
|
|
1275
1281
|
* of the passphrase is limited to 1024 bytes.
|
|
1276
1282
|
* @since v11.6.0
|
|
1277
1283
|
*/
|
|
1278
|
-
function createPrivateKey(
|
|
1284
|
+
function createPrivateKey(
|
|
1285
|
+
key:
|
|
1286
|
+
| PrivateKeyInput
|
|
1287
|
+
| RawPrivateKeyInput
|
|
1288
|
+
| JsonWebKeyInput
|
|
1289
|
+
| string
|
|
1290
|
+
| NodeJS.ArrayBufferView,
|
|
1291
|
+
): KeyObject;
|
|
1279
1292
|
/**
|
|
1280
1293
|
* Creates and returns a new key object containing a public key. If `key` is a
|
|
1281
1294
|
* string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key;
|
|
@@ -1290,7 +1303,15 @@ declare module "crypto" {
|
|
|
1290
1303
|
* and it will be impossible to extract the private key from the returned object.
|
|
1291
1304
|
* @since v11.6.0
|
|
1292
1305
|
*/
|
|
1293
|
-
function createPublicKey(
|
|
1306
|
+
function createPublicKey(
|
|
1307
|
+
key:
|
|
1308
|
+
| PublicKeyInput
|
|
1309
|
+
| RawPublicKeyInput
|
|
1310
|
+
| JsonWebKeyInput
|
|
1311
|
+
| string
|
|
1312
|
+
| NodeJS.ArrayBufferView
|
|
1313
|
+
| KeyObject,
|
|
1314
|
+
): KeyObject;
|
|
1294
1315
|
/**
|
|
1295
1316
|
* Creates and returns a new key object containing a secret key for symmetric
|
|
1296
1317
|
* encryption or `Hmac`.
|
|
@@ -1324,15 +1345,17 @@ declare module "crypto" {
|
|
|
1324
1345
|
context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
1325
1346
|
}
|
|
1326
1347
|
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
|
1348
|
+
interface SignRawPrivateKeyInput extends RawPrivateKeyInput, SigningOptions {}
|
|
1349
|
+
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1327
1350
|
interface SignKeyObjectInput extends SigningOptions {
|
|
1328
1351
|
key: KeyObject;
|
|
1329
1352
|
}
|
|
1330
|
-
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1331
1353
|
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
|
|
1354
|
+
interface VerifyRawPublicKeyInput extends RawPublicKeyInput, SigningOptions {}
|
|
1355
|
+
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1332
1356
|
interface VerifyKeyObjectInput extends SigningOptions {
|
|
1333
1357
|
key: KeyObject;
|
|
1334
1358
|
}
|
|
1335
|
-
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
|
|
1336
1359
|
type KeyLike = string | Buffer | KeyObject;
|
|
1337
1360
|
/**
|
|
1338
1361
|
* The `Sign` class is a utility for generating signatures. It can be used in one
|
|
@@ -1423,9 +1446,21 @@ declare module "crypto" {
|
|
|
1423
1446
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1424
1447
|
* @since v0.1.92
|
|
1425
1448
|
*/
|
|
1426
|
-
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
1427
1449
|
sign(
|
|
1428
|
-
privateKey:
|
|
1450
|
+
privateKey:
|
|
1451
|
+
| KeyLike
|
|
1452
|
+
| SignKeyObjectInput
|
|
1453
|
+
| SignPrivateKeyInput
|
|
1454
|
+
| SignRawPrivateKeyInput
|
|
1455
|
+
| SignJsonWebKeyInput,
|
|
1456
|
+
): NonSharedBuffer;
|
|
1457
|
+
sign(
|
|
1458
|
+
privateKey:
|
|
1459
|
+
| KeyLike
|
|
1460
|
+
| SignKeyObjectInput
|
|
1461
|
+
| SignPrivateKeyInput
|
|
1462
|
+
| SignRawPrivateKeyInput
|
|
1463
|
+
| SignJsonWebKeyInput,
|
|
1429
1464
|
outputFormat: BinaryToTextEncoding,
|
|
1430
1465
|
): string;
|
|
1431
1466
|
}
|
|
@@ -1472,9 +1507,9 @@ declare module "crypto" {
|
|
|
1472
1507
|
update(data: BinaryLike): Verify;
|
|
1473
1508
|
update(data: string, inputEncoding: Encoding): Verify;
|
|
1474
1509
|
/**
|
|
1475
|
-
* Verifies the provided data using the given `
|
|
1510
|
+
* Verifies the provided data using the given `key` and `signature`.
|
|
1476
1511
|
*
|
|
1477
|
-
* If `
|
|
1512
|
+
* If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an
|
|
1478
1513
|
* object, the following additional properties can be passed:
|
|
1479
1514
|
*
|
|
1480
1515
|
* The `signature` argument is the previously calculated signature for the data, in
|
|
@@ -1491,13 +1526,23 @@ declare module "crypto" {
|
|
|
1491
1526
|
* @since v0.1.92
|
|
1492
1527
|
*/
|
|
1493
1528
|
verify(
|
|
1494
|
-
|
|
1529
|
+
key:
|
|
1530
|
+
| KeyLike
|
|
1531
|
+
| VerifyKeyObjectInput
|
|
1532
|
+
| VerifyPublicKeyInput
|
|
1533
|
+
| VerifyRawPublicKeyInput
|
|
1534
|
+
| VerifyJsonWebKeyInput,
|
|
1495
1535
|
signature: NodeJS.ArrayBufferView,
|
|
1496
1536
|
): boolean;
|
|
1497
1537
|
verify(
|
|
1498
|
-
object:
|
|
1538
|
+
object:
|
|
1539
|
+
| KeyLike
|
|
1540
|
+
| VerifyKeyObjectInput
|
|
1541
|
+
| VerifyPublicKeyInput
|
|
1542
|
+
| VerifyRawPublicKeyInput
|
|
1543
|
+
| VerifyJsonWebKeyInput,
|
|
1499
1544
|
signature: string,
|
|
1500
|
-
|
|
1545
|
+
signatureEncoding?: BinaryToTextEncoding,
|
|
1501
1546
|
): boolean;
|
|
1502
1547
|
}
|
|
1503
1548
|
/**
|
|
@@ -1577,8 +1622,10 @@ declare module "crypto" {
|
|
|
1577
1622
|
* If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
|
|
1578
1623
|
*
|
|
1579
1624
|
* This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
|
|
1580
|
-
* once a private key has been generated or set, calling this function only
|
|
1581
|
-
* the public key
|
|
1625
|
+
* once a private key has been generated or set, calling this function only
|
|
1626
|
+
* recomputes the public key from the existing private key. Since the public key is
|
|
1627
|
+
* determined by the private key, the result will be the same unless the private key
|
|
1628
|
+
* has been changed via `diffieHellman.setPrivateKey()`.
|
|
1582
1629
|
* @since v0.5.0
|
|
1583
1630
|
* @param encoding The `encoding` of the return value.
|
|
1584
1631
|
*/
|
|
@@ -2496,7 +2543,7 @@ declare module "crypto" {
|
|
|
2496
2543
|
| "slh-dsa-shake-256s"
|
|
2497
2544
|
| "x25519"
|
|
2498
2545
|
| "x448";
|
|
2499
|
-
type KeyFormat = "pem" | "der" | "jwk";
|
|
2546
|
+
type KeyFormat = "pem" | "der" | "jwk" | "raw-public" | "raw-private" | "raw-seed";
|
|
2500
2547
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
2501
2548
|
format: T;
|
|
2502
2549
|
cipher?: string | undefined;
|
|
@@ -3859,11 +3906,11 @@ declare module "crypto" {
|
|
|
3859
3906
|
* @since v24.7.0
|
|
3860
3907
|
*/
|
|
3861
3908
|
function decapsulate(
|
|
3862
|
-
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3909
|
+
key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
|
|
3863
3910
|
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3864
3911
|
): NonSharedBuffer;
|
|
3865
3912
|
function decapsulate(
|
|
3866
|
-
key: KeyLike | PrivateKeyInput | JsonWebKeyInput,
|
|
3913
|
+
key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
|
|
3867
3914
|
ciphertext: ArrayBuffer | NodeJS.ArrayBufferView,
|
|
3868
3915
|
callback: (err: Error, sharedKey: NonSharedBuffer) => void,
|
|
3869
3916
|
): void;
|
|
@@ -3875,9 +3922,11 @@ declare module "crypto" {
|
|
|
3875
3922
|
* If the `callback` function is provided this function uses libuv's threadpool.
|
|
3876
3923
|
* @since v13.9.0, v12.17.0
|
|
3877
3924
|
*/
|
|
3878
|
-
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): NonSharedBuffer;
|
|
3879
3925
|
function diffieHellman(
|
|
3880
|
-
options: { privateKey:
|
|
3926
|
+
options: { privateKey: KeyLike | PrivateKeyInput; publicKey: KeyLike | PublicKeyInput },
|
|
3927
|
+
): NonSharedBuffer;
|
|
3928
|
+
function diffieHellman(
|
|
3929
|
+
options: { privateKey: KeyLike | PrivateKeyInput; publicKey: KeyLike | PublicKeyInput },
|
|
3881
3930
|
callback: (err: Error | null, secret: NonSharedBuffer) => void,
|
|
3882
3931
|
): void;
|
|
3883
3932
|
/**
|
|
@@ -3900,10 +3949,10 @@ declare module "crypto" {
|
|
|
3900
3949
|
* @since v24.7.0
|
|
3901
3950
|
*/
|
|
3902
3951
|
function encapsulate(
|
|
3903
|
-
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3952
|
+
key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
|
|
3904
3953
|
): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
|
|
3905
3954
|
function encapsulate(
|
|
3906
|
-
key: KeyLike | PublicKeyInput | JsonWebKeyInput,
|
|
3955
|
+
key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
|
|
3907
3956
|
callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
|
|
3908
3957
|
): void;
|
|
3909
3958
|
interface OneShotDigestOptions {
|
|
@@ -4127,6 +4176,7 @@ declare module "crypto" {
|
|
|
4127
4176
|
*/
|
|
4128
4177
|
disableEntropyCache?: boolean | undefined;
|
|
4129
4178
|
}
|
|
4179
|
+
interface RandomUUIDV7Options extends RandomUUIDOptions {}
|
|
4130
4180
|
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
4131
4181
|
/**
|
|
4132
4182
|
* Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
|
|
@@ -4134,6 +4184,14 @@ declare module "crypto" {
|
|
|
4134
4184
|
* @since v15.6.0, v14.17.0
|
|
4135
4185
|
*/
|
|
4136
4186
|
function randomUUID(options?: RandomUUIDOptions): UUID;
|
|
4187
|
+
/**
|
|
4188
|
+
* Generates a random [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.txt) version 7 UUID. The UUID contains a millisecond
|
|
4189
|
+
* precision Unix timestamp in the most significant 48 bits, followed by
|
|
4190
|
+
* cryptographically secure random bits for the remaining fields, making it
|
|
4191
|
+
* suitable for use as a database key with time-based sorting.
|
|
4192
|
+
* @since v24.16.0
|
|
4193
|
+
*/
|
|
4194
|
+
function randomUUIDv7(options?: RandomUUIDV7Options): UUID;
|
|
4137
4195
|
interface X509CheckOptions {
|
|
4138
4196
|
/**
|
|
4139
4197
|
* @default 'always'
|
|
@@ -4639,7 +4697,6 @@ declare module "crypto" {
|
|
|
4639
4697
|
* ```
|
|
4640
4698
|
* @since v24.7.0
|
|
4641
4699
|
* @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
|
|
4642
|
-
* @experimental
|
|
4643
4700
|
*/
|
|
4644
4701
|
function argon2(
|
|
4645
4702
|
algorithm: Argon2Algorithm,
|
|
@@ -4679,7 +4736,6 @@ declare module "crypto" {
|
|
|
4679
4736
|
* console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
|
|
4680
4737
|
* ```
|
|
4681
4738
|
* @since v24.7.0
|
|
4682
|
-
* @experimental
|
|
4683
4739
|
*/
|
|
4684
4740
|
function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
|
|
4685
4741
|
/**
|
|
@@ -4758,7 +4814,7 @@ declare module "crypto" {
|
|
|
4758
4814
|
interface CShakeParams extends Algorithm {
|
|
4759
4815
|
customization?: BufferSource;
|
|
4760
4816
|
functionName?: BufferSource;
|
|
4761
|
-
|
|
4817
|
+
outputLength: number;
|
|
4762
4818
|
}
|
|
4763
4819
|
interface ContextParams extends Algorithm {
|
|
4764
4820
|
context?: BufferSource;
|
|
@@ -4795,6 +4851,10 @@ declare module "crypto" {
|
|
|
4795
4851
|
hash: HashAlgorithmIdentifier;
|
|
4796
4852
|
length?: number;
|
|
4797
4853
|
}
|
|
4854
|
+
interface KangarooTwelveParams extends Algorithm {
|
|
4855
|
+
customization?: BufferSource;
|
|
4856
|
+
outputLength: number;
|
|
4857
|
+
}
|
|
4798
4858
|
interface JsonWebKey {
|
|
4799
4859
|
alg?: string;
|
|
4800
4860
|
crv?: string;
|
|
@@ -4829,7 +4889,7 @@ declare module "crypto" {
|
|
|
4829
4889
|
}
|
|
4830
4890
|
interface KmacParams extends Algorithm {
|
|
4831
4891
|
customization?: BufferSource;
|
|
4832
|
-
|
|
4892
|
+
outputLength: number;
|
|
4833
4893
|
}
|
|
4834
4894
|
interface Pbkdf2Params extends Algorithm {
|
|
4835
4895
|
hash: HashAlgorithmIdentifier;
|
|
@@ -4864,6 +4924,10 @@ declare module "crypto" {
|
|
|
4864
4924
|
interface RsaPssParams extends Algorithm {
|
|
4865
4925
|
saltLength: number;
|
|
4866
4926
|
}
|
|
4927
|
+
interface TurboShakeParams extends Algorithm {
|
|
4928
|
+
domainSeparation?: number;
|
|
4929
|
+
outputLength: number;
|
|
4930
|
+
}
|
|
4867
4931
|
/**
|
|
4868
4932
|
* Importing the `webcrypto` object (`import { webcrypto } from 'node:crypto'`) gives an instance of the `Crypto` class.
|
|
4869
4933
|
* `Crypto` is a singleton that provides access to the remainder of the crypto API.
|
|
@@ -4997,7 +5061,7 @@ declare module "crypto" {
|
|
|
4997
5061
|
ciphertext: BufferSource,
|
|
4998
5062
|
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
4999
5063
|
extractable: boolean,
|
|
5000
|
-
|
|
5064
|
+
keyUsages: KeyUsage[],
|
|
5001
5065
|
): Promise<CryptoKey>;
|
|
5002
5066
|
/**
|
|
5003
5067
|
* Using the method and parameters specified in `algorithm` and the keying material provided by `key`,
|
|
@@ -5095,7 +5159,10 @@ declare module "crypto" {
|
|
|
5095
5159
|
* If `algorithm` is provided as an `<Object>`, it must have a `name` property whose value is one of the above.
|
|
5096
5160
|
* @since v15.0.0
|
|
5097
5161
|
*/
|
|
5098
|
-
digest(
|
|
5162
|
+
digest(
|
|
5163
|
+
algorithm: AlgorithmIdentifier | CShakeParams | TurboShakeParams | KangarooTwelveParams,
|
|
5164
|
+
data: BufferSource,
|
|
5165
|
+
): Promise<ArrayBuffer>;
|
|
5099
5166
|
/**
|
|
5100
5167
|
* Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.
|
|
5101
5168
|
* This encrypted key is the "encapsulated key" represented as `EncapsulatedBits`.
|
|
@@ -5130,7 +5197,7 @@ declare module "crypto" {
|
|
|
5130
5197
|
encapsulationKey: CryptoKey,
|
|
5131
5198
|
sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
|
|
5132
5199
|
extractable: boolean,
|
|
5133
|
-
|
|
5200
|
+
keyUsages: KeyUsage[],
|
|
5134
5201
|
): Promise<EncapsulatedKey>;
|
|
5135
5202
|
/**
|
|
5136
5203
|
* Using the method and parameters specified by `algorithm` and the keying material provided by `key`,
|