@types/node 16.4.3 → 16.4.7
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/README.md +1 -1
- node/assert.d.ts +0 -2
- node/async_hooks.d.ts +2 -2
- node/buffer.d.ts +6 -6
- node/child_process.d.ts +7 -7
- node/cluster.d.ts +3 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +40 -51
- node/diagnostics_channel.d.ts +2 -2
- node/domain.d.ts +2 -2
- node/events.d.ts +17 -17
- node/fs/promises.d.ts +37 -2
- node/fs.d.ts +7 -31
- node/http.d.ts +1 -4
- node/http2.d.ts +65 -6
- node/https.d.ts +0 -2
- node/module.d.ts +3 -0
- node/net.d.ts +9 -11
- node/os.d.ts +0 -4
- node/package.json +2 -2
- node/process.d.ts +3 -3
- node/repl.d.ts +1 -1
- node/stream.d.ts +3 -3
- node/tls.d.ts +7 -9
- node/tty.d.ts +4 -8
- node/url.d.ts +7 -11
- node/util.d.ts +7 -3
- node/v8.d.ts +2 -2
- node/vm.d.ts +4 -4
- node/worker_threads.d.ts +1 -1
node/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 29 Jul 2021 13:01:18 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
|
14
14
|
|
node/assert.d.ts
CHANGED
|
@@ -12,8 +12,6 @@ declare module 'assert' {
|
|
|
12
12
|
function assert(value: unknown, message?: string | Error): asserts value;
|
|
13
13
|
namespace assert {
|
|
14
14
|
/**
|
|
15
|
-
* * Extends: `<errors.Error>`
|
|
16
|
-
*
|
|
17
15
|
* Indicates the failure of an assertion. All errors thrown by the `assert` module
|
|
18
16
|
* will be instances of the `AssertionError` class.
|
|
19
17
|
*/
|
node/async_hooks.d.ts
CHANGED
|
@@ -197,7 +197,7 @@ declare module 'async_hooks' {
|
|
|
197
197
|
* @param callbacks The `Hook Callbacks` to register
|
|
198
198
|
* @return Instance used for disabling and enabling hooks
|
|
199
199
|
*/
|
|
200
|
-
function createHook(
|
|
200
|
+
function createHook(callbacks: HookCallbacks): AsyncHook;
|
|
201
201
|
interface AsyncResourceOptions {
|
|
202
202
|
/**
|
|
203
203
|
* The ID of the execution context that created this async event.
|
|
@@ -298,7 +298,7 @@ declare module 'async_hooks' {
|
|
|
298
298
|
* @since v9.6.0
|
|
299
299
|
* @param fn The function to call in the execution context of this async resource.
|
|
300
300
|
* @param thisArg The receiver to be used for the function call.
|
|
301
|
-
* @param
|
|
301
|
+
* @param args Optional arguments to pass to the function.
|
|
302
302
|
*/
|
|
303
303
|
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
|
304
304
|
/**
|
node/buffer.d.ts
CHANGED
|
@@ -471,7 +471,7 @@ declare module 'buffer' {
|
|
|
471
471
|
* @param sourceStart The offset within `buf` at which to begin comparison.
|
|
472
472
|
* @param sourceEnd The offset within `buf` at which to end comparison (not inclusive).
|
|
473
473
|
*/
|
|
474
|
-
compare(
|
|
474
|
+
compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
475
475
|
/**
|
|
476
476
|
* Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
|
|
477
477
|
*
|
|
@@ -521,7 +521,7 @@ declare module 'buffer' {
|
|
|
521
521
|
* @param sourceEnd The offset within `buf` at which to stop copying (not inclusive).
|
|
522
522
|
* @return The number of bytes copied.
|
|
523
523
|
*/
|
|
524
|
-
copy(
|
|
524
|
+
copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
|
525
525
|
/**
|
|
526
526
|
* Returns a new `Buffer` that references the same memory as the original, but
|
|
527
527
|
* offset and cropped by the `start` and `end` indices.
|
|
@@ -546,7 +546,7 @@ declare module 'buffer' {
|
|
|
546
546
|
* @param start Where the new `Buffer` will start.
|
|
547
547
|
* @param end Where the new `Buffer` will end (not inclusive).
|
|
548
548
|
*/
|
|
549
|
-
slice(
|
|
549
|
+
slice(start?: number, end?: number): Buffer;
|
|
550
550
|
/**
|
|
551
551
|
* Returns a new `Buffer` that references the same memory as the original, but
|
|
552
552
|
* offset and cropped by the `start` and `end` indices.
|
|
@@ -602,7 +602,7 @@ declare module 'buffer' {
|
|
|
602
602
|
* @param start Where the new `Buffer` will start.
|
|
603
603
|
* @param end Where the new `Buffer` will end (not inclusive).
|
|
604
604
|
*/
|
|
605
|
-
subarray(
|
|
605
|
+
subarray(start?: number, end?: number): Buffer;
|
|
606
606
|
/**
|
|
607
607
|
* Writes `value` to `buf` at the specified `offset` as big-endian.
|
|
608
608
|
*
|
|
@@ -1761,7 +1761,7 @@ declare module 'buffer' {
|
|
|
1761
1761
|
* @deprecated Use `Buffer.from(data, 'base64')` instead.
|
|
1762
1762
|
* @param data The Base64-encoded input string.
|
|
1763
1763
|
*/
|
|
1764
|
-
function atob(
|
|
1764
|
+
function atob(data: string): string;
|
|
1765
1765
|
/**
|
|
1766
1766
|
* Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
|
|
1767
1767
|
* into a string using Base64.
|
|
@@ -1777,7 +1777,7 @@ declare module 'buffer' {
|
|
|
1777
1777
|
* @deprecated Use `buf.toString('base64')` instead.
|
|
1778
1778
|
* @param data An ASCII (Latin1) string.
|
|
1779
1779
|
*/
|
|
1780
|
-
function btoa(
|
|
1780
|
+
function btoa(data: string): string;
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
1783
|
declare module 'node:buffer' {
|
node/child_process.d.ts
CHANGED
|
@@ -1342,13 +1342,13 @@ declare module 'child_process' {
|
|
|
1342
1342
|
* @param args List of string arguments.
|
|
1343
1343
|
* @return The stdout from the command.
|
|
1344
1344
|
*/
|
|
1345
|
-
function execFileSync(
|
|
1346
|
-
function execFileSync(
|
|
1347
|
-
function execFileSync(
|
|
1348
|
-
function execFileSync(
|
|
1349
|
-
function execFileSync(
|
|
1350
|
-
function execFileSync(
|
|
1351
|
-
function execFileSync(
|
|
1345
|
+
function execFileSync(file: string): Buffer;
|
|
1346
|
+
function execFileSync(file: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
|
1347
|
+
function execFileSync(file: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
|
1348
|
+
function execFileSync(file: string, options?: ExecFileSyncOptions): Buffer;
|
|
1349
|
+
function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
|
1350
|
+
function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
|
1351
|
+
function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
|
|
1352
1352
|
}
|
|
1353
1353
|
declare module 'node:child_process' {
|
|
1354
1354
|
export * from 'child_process';
|
node/cluster.d.ts
CHANGED
|
@@ -116,7 +116,9 @@ declare module 'cluster' {
|
|
|
116
116
|
* @since v0.7.0
|
|
117
117
|
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
|
|
118
118
|
*/
|
|
119
|
-
send(message: child.Serializable,
|
|
119
|
+
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
|
120
|
+
send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean;
|
|
121
|
+
send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean;
|
|
120
122
|
/**
|
|
121
123
|
* This function will kill the worker. In the primary, it does this
|
|
122
124
|
* by disconnecting the `worker.process`, and once disconnected, killing
|
node/console.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ declare module 'node:console' {
|
|
|
83
83
|
* ```
|
|
84
84
|
* @since v0.1.101
|
|
85
85
|
* @param value The value tested for being truthy.
|
|
86
|
-
* @param
|
|
86
|
+
* @param message All arguments besides `value` are used as error message.
|
|
87
87
|
*/
|
|
88
88
|
assert(value: any, message?: string, ...optionalParams: any[]): void;
|
|
89
89
|
/**
|
node/crypto.d.ts
CHANGED
|
@@ -320,8 +320,6 @@ declare module 'crypto' {
|
|
|
320
320
|
type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
|
|
321
321
|
type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
|
|
322
322
|
/**
|
|
323
|
-
* * Extends: `<stream.Transform>`
|
|
324
|
-
*
|
|
325
323
|
* The `Hash` class is a utility for creating hash digests of data. It can be
|
|
326
324
|
* used in one of two ways:
|
|
327
325
|
*
|
|
@@ -491,7 +489,7 @@ declare module 'crypto' {
|
|
|
491
489
|
* @since v13.1.0
|
|
492
490
|
* @param options `stream.transform` options
|
|
493
491
|
*/
|
|
494
|
-
copy(): Hash;
|
|
492
|
+
copy(options?: stream.TransformOptions): Hash;
|
|
495
493
|
/**
|
|
496
494
|
* Updates the hash content with the given `data`, the encoding of which
|
|
497
495
|
* is given in `inputEncoding`.
|
|
@@ -503,7 +501,7 @@ declare module 'crypto' {
|
|
|
503
501
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
504
502
|
*/
|
|
505
503
|
update(data: BinaryLike): Hash;
|
|
506
|
-
update(data: string,
|
|
504
|
+
update(data: string, inputEncoding: Encoding): Hash;
|
|
507
505
|
/**
|
|
508
506
|
* Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method).
|
|
509
507
|
* If `encoding` is provided a string will be returned; otherwise
|
|
@@ -518,8 +516,6 @@ declare module 'crypto' {
|
|
|
518
516
|
digest(encoding: BinaryToTextEncoding): string;
|
|
519
517
|
}
|
|
520
518
|
/**
|
|
521
|
-
* * Extends: `<stream.Transform>`
|
|
522
|
-
*
|
|
523
519
|
* The `Hmac` class is a utility for creating cryptographic HMAC digests. It can
|
|
524
520
|
* be used in one of two ways:
|
|
525
521
|
*
|
|
@@ -648,7 +644,7 @@ declare module 'crypto' {
|
|
|
648
644
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
649
645
|
*/
|
|
650
646
|
update(data: BinaryLike): Hmac;
|
|
651
|
-
update(data: string,
|
|
647
|
+
update(data: string, inputEncoding: Encoding): Hmac;
|
|
652
648
|
/**
|
|
653
649
|
* Calculates the HMAC digest of all of the data passed using `hmac.update()`.
|
|
654
650
|
* If `encoding` is
|
|
@@ -878,8 +874,6 @@ declare module 'crypto' {
|
|
|
878
874
|
function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike | null, options?: CipherGCMOptions): CipherGCM;
|
|
879
875
|
function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher;
|
|
880
876
|
/**
|
|
881
|
-
* * Extends: `<stream.Transform>`
|
|
882
|
-
*
|
|
883
877
|
* Instances of the `Cipher` class are used to encrypt data. The class can be
|
|
884
878
|
* used in one of two ways:
|
|
885
879
|
*
|
|
@@ -1114,9 +1108,9 @@ declare module 'crypto' {
|
|
|
1114
1108
|
* @param outputEncoding The `encoding` of the return value.
|
|
1115
1109
|
*/
|
|
1116
1110
|
update(data: BinaryLike): Buffer;
|
|
1117
|
-
update(data: string,
|
|
1118
|
-
update(data: NodeJS.ArrayBufferView,
|
|
1119
|
-
update(data: string,
|
|
1111
|
+
update(data: string, inputEncoding: Encoding): Buffer;
|
|
1112
|
+
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
1113
|
+
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
1120
1114
|
/**
|
|
1121
1115
|
* Once the `cipher.final()` method has been called, the `Cipher` object can no
|
|
1122
1116
|
* longer be used to encrypt data. Attempts to call `cipher.final()` more than
|
|
@@ -1126,7 +1120,7 @@ declare module 'crypto' {
|
|
|
1126
1120
|
* @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
1127
1121
|
*/
|
|
1128
1122
|
final(): Buffer;
|
|
1129
|
-
final(
|
|
1123
|
+
final(outputEncoding: BufferEncoding): string;
|
|
1130
1124
|
/**
|
|
1131
1125
|
* When using block encryption algorithms, the `Cipher` class will automatically
|
|
1132
1126
|
* add padding to the input data to the appropriate block size. To disable the
|
|
@@ -1141,7 +1135,7 @@ declare module 'crypto' {
|
|
|
1141
1135
|
* @since v0.7.1
|
|
1142
1136
|
* @return for method chaining.
|
|
1143
1137
|
*/
|
|
1144
|
-
setAutoPadding(
|
|
1138
|
+
setAutoPadding(autoPadding?: boolean): this;
|
|
1145
1139
|
}
|
|
1146
1140
|
interface CipherCCM extends Cipher {
|
|
1147
1141
|
setAAD(
|
|
@@ -1219,8 +1213,6 @@ declare module 'crypto' {
|
|
|
1219
1213
|
function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike | null, options?: CipherGCMOptions): DecipherGCM;
|
|
1220
1214
|
function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
|
|
1221
1215
|
/**
|
|
1222
|
-
* * Extends: `<stream.Transform>`
|
|
1223
|
-
*
|
|
1224
1216
|
* Instances of the `Decipher` class are used to decrypt data. The class can be
|
|
1225
1217
|
* used in one of two ways:
|
|
1226
1218
|
*
|
|
@@ -1427,9 +1419,9 @@ declare module 'crypto' {
|
|
|
1427
1419
|
* @param outputEncoding The `encoding` of the return value.
|
|
1428
1420
|
*/
|
|
1429
1421
|
update(data: NodeJS.ArrayBufferView): Buffer;
|
|
1430
|
-
update(data: string,
|
|
1431
|
-
update(data: NodeJS.ArrayBufferView,
|
|
1432
|
-
update(data: string,
|
|
1422
|
+
update(data: string, inputEncoding: Encoding): Buffer;
|
|
1423
|
+
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
1424
|
+
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
1433
1425
|
/**
|
|
1434
1426
|
* Once the `decipher.final()` method has been called, the `Decipher` object can
|
|
1435
1427
|
* no longer be used to decrypt data. Attempts to call `decipher.final()` more
|
|
@@ -1439,7 +1431,7 @@ declare module 'crypto' {
|
|
|
1439
1431
|
* @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
|
|
1440
1432
|
*/
|
|
1441
1433
|
final(): Buffer;
|
|
1442
|
-
final(
|
|
1434
|
+
final(outputEncoding: BufferEncoding): string;
|
|
1443
1435
|
/**
|
|
1444
1436
|
* When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
|
|
1445
1437
|
* removing padding.
|
|
@@ -1551,6 +1543,7 @@ declare module 'crypto' {
|
|
|
1551
1543
|
* @param encoding The string encoding when `key` is a string.
|
|
1552
1544
|
*/
|
|
1553
1545
|
function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
|
|
1546
|
+
function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
|
|
1554
1547
|
/**
|
|
1555
1548
|
* Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms.
|
|
1556
1549
|
* Optional `options` argument controls the `stream.Writable` behavior.
|
|
@@ -1583,8 +1576,6 @@ declare module 'crypto' {
|
|
|
1583
1576
|
}
|
|
1584
1577
|
type KeyLike = string | Buffer | KeyObject;
|
|
1585
1578
|
/**
|
|
1586
|
-
* * Extends: `<stream.Writable>`
|
|
1587
|
-
*
|
|
1588
1579
|
* The `Sign` class is a utility for generating signatures. It can be used in one
|
|
1589
1580
|
* of two ways:
|
|
1590
1581
|
*
|
|
@@ -1706,7 +1697,7 @@ declare module 'crypto' {
|
|
|
1706
1697
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1707
1698
|
*/
|
|
1708
1699
|
update(data: BinaryLike): this;
|
|
1709
|
-
update(data: string,
|
|
1700
|
+
update(data: string, inputEncoding: Encoding): this;
|
|
1710
1701
|
/**
|
|
1711
1702
|
* Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
|
|
1712
1703
|
*
|
|
@@ -1719,8 +1710,8 @@ declare module 'crypto' {
|
|
|
1719
1710
|
* called. Multiple calls to `sign.sign()` will result in an error being thrown.
|
|
1720
1711
|
* @since v0.1.92
|
|
1721
1712
|
*/
|
|
1722
|
-
sign(
|
|
1723
|
-
sign(
|
|
1713
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
|
|
1714
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string;
|
|
1724
1715
|
}
|
|
1725
1716
|
/**
|
|
1726
1717
|
* Creates and returns a `Verify` object that uses the given algorithm.
|
|
@@ -1737,8 +1728,6 @@ declare module 'crypto' {
|
|
|
1737
1728
|
*/
|
|
1738
1729
|
function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
|
|
1739
1730
|
/**
|
|
1740
|
-
* * Extends: `<stream.Writable>`
|
|
1741
|
-
*
|
|
1742
1731
|
* The `Verify` class is a utility for verifying signatures. It can be used in one
|
|
1743
1732
|
* of two ways:
|
|
1744
1733
|
*
|
|
@@ -1765,7 +1754,7 @@ declare module 'crypto' {
|
|
|
1765
1754
|
* @param inputEncoding The `encoding` of the `data` string.
|
|
1766
1755
|
*/
|
|
1767
1756
|
update(data: BinaryLike): Verify;
|
|
1768
|
-
update(data: string,
|
|
1757
|
+
update(data: string, inputEncoding: Encoding): Verify;
|
|
1769
1758
|
/**
|
|
1770
1759
|
* Verifies the provided data using the given `object` and `signature`.
|
|
1771
1760
|
*
|
|
@@ -1803,11 +1792,11 @@ declare module 'crypto' {
|
|
|
1803
1792
|
* @param primeEncoding The `encoding` of the `prime` string.
|
|
1804
1793
|
* @param generatorEncoding The `encoding` of the `generator` string.
|
|
1805
1794
|
*/
|
|
1806
|
-
function createDiffieHellman(
|
|
1795
|
+
function createDiffieHellman(primeLength: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
|
|
1807
1796
|
function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
|
|
1808
|
-
function createDiffieHellman(prime: string,
|
|
1809
|
-
function createDiffieHellman(prime: string,
|
|
1810
|
-
function createDiffieHellman(prime: string,
|
|
1797
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding): DiffieHellman;
|
|
1798
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
|
|
1799
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
|
|
1811
1800
|
/**
|
|
1812
1801
|
* The `DiffieHellman` class is a utility for creating Diffie-Hellman key
|
|
1813
1802
|
* exchanges.
|
|
@@ -1886,10 +1875,10 @@ declare module 'crypto' {
|
|
|
1886
1875
|
* @param inputEncoding The `encoding` of an `otherPublicKey` string.
|
|
1887
1876
|
* @param outputEncoding The `encoding` of the return value.
|
|
1888
1877
|
*/
|
|
1889
|
-
computeSecret(
|
|
1890
|
-
computeSecret(
|
|
1891
|
-
computeSecret(
|
|
1892
|
-
computeSecret(
|
|
1878
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
|
|
1879
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
|
|
1880
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
1881
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
|
|
1893
1882
|
/**
|
|
1894
1883
|
* Returns the Diffie-Hellman prime in the specified `encoding`.
|
|
1895
1884
|
* If `encoding` is provided a string is
|
|
@@ -1933,8 +1922,8 @@ declare module 'crypto' {
|
|
|
1933
1922
|
* @since v0.5.0
|
|
1934
1923
|
* @param encoding The `encoding` of the `publicKey` string.
|
|
1935
1924
|
*/
|
|
1936
|
-
setPublicKey(
|
|
1937
|
-
setPublicKey(
|
|
1925
|
+
setPublicKey(publicKey: NodeJS.ArrayBufferView): void;
|
|
1926
|
+
setPublicKey(publicKey: string, encoding: BufferEncoding): void;
|
|
1938
1927
|
/**
|
|
1939
1928
|
* Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
|
|
1940
1929
|
* to be a string. If no `encoding` is provided, `privateKey` is expected
|
|
@@ -1942,8 +1931,8 @@ declare module 'crypto' {
|
|
|
1942
1931
|
* @since v0.5.0
|
|
1943
1932
|
* @param encoding The `encoding` of the `privateKey` string.
|
|
1944
1933
|
*/
|
|
1945
|
-
setPrivateKey(
|
|
1946
|
-
setPrivateKey(
|
|
1934
|
+
setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
|
|
1935
|
+
setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
|
|
1947
1936
|
/**
|
|
1948
1937
|
* A bit field containing any warnings and/or errors resulting from a check
|
|
1949
1938
|
* performed during initialization of the `DiffieHellman` object.
|
|
@@ -2006,7 +1995,7 @@ declare module 'crypto' {
|
|
|
2006
1995
|
* ```
|
|
2007
1996
|
* @since v0.7.5
|
|
2008
1997
|
*/
|
|
2009
|
-
function getDiffieHellman(
|
|
1998
|
+
function getDiffieHellman(groupName: string): DiffieHellman;
|
|
2010
1999
|
/**
|
|
2011
2000
|
* Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
|
|
2012
2001
|
* implementation. A selected HMAC digest algorithm specified by `digest` is
|
|
@@ -2652,7 +2641,7 @@ declare module 'crypto' {
|
|
|
2652
2641
|
* object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`.
|
|
2653
2642
|
* @since v0.11.14
|
|
2654
2643
|
*/
|
|
2655
|
-
function privateDecrypt(
|
|
2644
|
+
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
|
2656
2645
|
/**
|
|
2657
2646
|
* Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
|
|
2658
2647
|
* the corresponding public key, for example using {@link publicDecrypt}.
|
|
@@ -2661,7 +2650,7 @@ declare module 'crypto' {
|
|
|
2661
2650
|
* object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`.
|
|
2662
2651
|
* @since v1.1.0
|
|
2663
2652
|
*/
|
|
2664
|
-
function privateEncrypt(
|
|
2653
|
+
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
|
2665
2654
|
/**
|
|
2666
2655
|
* ```js
|
|
2667
2656
|
* const {
|
|
@@ -2881,10 +2870,10 @@ declare module 'crypto' {
|
|
|
2881
2870
|
* @param inputEncoding The `encoding` of the `otherPublicKey` string.
|
|
2882
2871
|
* @param outputEncoding The `encoding` of the return value.
|
|
2883
2872
|
*/
|
|
2884
|
-
computeSecret(
|
|
2885
|
-
computeSecret(
|
|
2886
|
-
computeSecret(
|
|
2887
|
-
computeSecret(
|
|
2873
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer;
|
|
2874
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer;
|
|
2875
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
2876
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
|
|
2888
2877
|
/**
|
|
2889
2878
|
* If `encoding` is specified, a string is returned; otherwise a `Buffer` is
|
|
2890
2879
|
* returned.
|
|
@@ -2916,8 +2905,8 @@ declare module 'crypto' {
|
|
|
2916
2905
|
* @since v0.11.14
|
|
2917
2906
|
* @param encoding The `encoding` of the `privateKey` string.
|
|
2918
2907
|
*/
|
|
2919
|
-
setPrivateKey(
|
|
2920
|
-
setPrivateKey(
|
|
2908
|
+
setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
|
|
2909
|
+
setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
|
|
2921
2910
|
}
|
|
2922
2911
|
/**
|
|
2923
2912
|
* Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
|
|
@@ -2926,7 +2915,7 @@ declare module 'crypto' {
|
|
|
2926
2915
|
* and description of each available elliptic curve.
|
|
2927
2916
|
* @since v0.11.14
|
|
2928
2917
|
*/
|
|
2929
|
-
function createECDH(
|
|
2918
|
+
function createECDH(curveName: string): ECDH;
|
|
2930
2919
|
/**
|
|
2931
2920
|
* This function is based on a constant-time algorithm.
|
|
2932
2921
|
* Returns true if `a` is equal to `b`, without leaking timing information that
|
|
@@ -3960,7 +3949,7 @@ declare module 'crypto' {
|
|
|
3960
3949
|
* @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
|
|
3961
3950
|
* @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.
|
|
3962
3951
|
*/
|
|
3963
|
-
function checkPrimeSync(
|
|
3952
|
+
function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
|
|
3964
3953
|
namespace webcrypto {
|
|
3965
3954
|
class CryptoKey {} // placeholder
|
|
3966
3955
|
}
|
node/diagnostics_channel.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ declare module 'diagnostics_channel' {
|
|
|
84
84
|
* ```
|
|
85
85
|
* @param onMessage The handler to receive channel messages
|
|
86
86
|
*/
|
|
87
|
-
subscribe(
|
|
87
|
+
subscribe(onMessage: ChannelListener): void;
|
|
88
88
|
/**
|
|
89
89
|
* Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
|
|
90
90
|
*
|
|
@@ -103,7 +103,7 @@ declare module 'diagnostics_channel' {
|
|
|
103
103
|
* ```
|
|
104
104
|
* @param onMessage The previous subscribed handler to remove
|
|
105
105
|
*/
|
|
106
|
-
unsubscribe(
|
|
106
|
+
unsubscribe(onMessage: ChannelListener): void;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
declare module 'node:diagnostics_channel' {
|
node/domain.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ declare module 'domain' {
|
|
|
127
127
|
* @param callback The callback function
|
|
128
128
|
* @return The bound function
|
|
129
129
|
*/
|
|
130
|
-
bind<T extends Function>(
|
|
130
|
+
bind<T extends Function>(callback: T): T;
|
|
131
131
|
/**
|
|
132
132
|
* This method is almost identical to {@link bind}. However, in
|
|
133
133
|
* addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function.
|
|
@@ -160,7 +160,7 @@ declare module 'domain' {
|
|
|
160
160
|
* @param callback The callback function
|
|
161
161
|
* @return The intercepted function
|
|
162
162
|
*/
|
|
163
|
-
intercept<T extends Function>(
|
|
163
|
+
intercept<T extends Function>(callback: T): T;
|
|
164
164
|
}
|
|
165
165
|
function create(): Domain;
|
|
166
166
|
}
|
node/events.d.ts
CHANGED
|
@@ -42,11 +42,11 @@ declare module 'events' {
|
|
|
42
42
|
captureRejections?: boolean | undefined;
|
|
43
43
|
}
|
|
44
44
|
interface NodeEventTarget {
|
|
45
|
-
once(
|
|
45
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
46
46
|
}
|
|
47
47
|
interface DOMEventTarget {
|
|
48
48
|
addEventListener(
|
|
49
|
-
|
|
49
|
+
eventName: string,
|
|
50
50
|
listener: (...args: any[]) => void,
|
|
51
51
|
opts?: {
|
|
52
52
|
once: boolean;
|
|
@@ -72,11 +72,11 @@ declare module 'events' {
|
|
|
72
72
|
*/
|
|
73
73
|
class EventEmitter {
|
|
74
74
|
constructor(options?: EventEmitterOptions);
|
|
75
|
-
static once(emitter: NodeEventTarget,
|
|
76
|
-
static once(emitter: DOMEventTarget,
|
|
77
|
-
static on(emitter: NodeJS.EventEmitter,
|
|
75
|
+
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
76
|
+
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
|
77
|
+
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
|
|
78
78
|
/** @deprecated since v4.0.0 */
|
|
79
|
-
static listenerCount(emitter: NodeJS.EventEmitter,
|
|
79
|
+
static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number;
|
|
80
80
|
/**
|
|
81
81
|
* Returns a list listener for a specific emitter event name.
|
|
82
82
|
*/
|
|
@@ -117,7 +117,7 @@ declare module 'events' {
|
|
|
117
117
|
* Alias for `emitter.on(eventName, listener)`.
|
|
118
118
|
* @since v0.1.26
|
|
119
119
|
*/
|
|
120
|
-
addListener(
|
|
120
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
121
121
|
/**
|
|
122
122
|
* Adds the `listener` function to the end of the listeners array for the
|
|
123
123
|
* event named `eventName`. No checks are made to see if the `listener` has
|
|
@@ -148,7 +148,7 @@ declare module 'events' {
|
|
|
148
148
|
* @param eventName The name of the event.
|
|
149
149
|
* @param listener The callback function
|
|
150
150
|
*/
|
|
151
|
-
on(
|
|
151
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
152
152
|
/**
|
|
153
153
|
* Adds a **one-time**`listener` function for the event named `eventName`. The
|
|
154
154
|
* next time `eventName` is triggered, this listener is removed and then invoked.
|
|
@@ -177,7 +177,7 @@ declare module 'events' {
|
|
|
177
177
|
* @param eventName The name of the event.
|
|
178
178
|
* @param listener The callback function
|
|
179
179
|
*/
|
|
180
|
-
once(
|
|
180
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
181
181
|
/**
|
|
182
182
|
* Removes the specified `listener` from the listener array for the event named`eventName`.
|
|
183
183
|
*
|
|
@@ -257,12 +257,12 @@ declare module 'events' {
|
|
|
257
257
|
* Returns a reference to the `EventEmitter`, so that calls can be chained.
|
|
258
258
|
* @since v0.1.26
|
|
259
259
|
*/
|
|
260
|
-
removeListener(
|
|
260
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
261
261
|
/**
|
|
262
262
|
* Alias for `emitter.removeListener()`.
|
|
263
263
|
* @since v10.0.0
|
|
264
264
|
*/
|
|
265
|
-
off(
|
|
265
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
266
266
|
/**
|
|
267
267
|
* Removes all listeners, or those of the specified `eventName`.
|
|
268
268
|
*
|
|
@@ -302,7 +302,7 @@ declare module 'events' {
|
|
|
302
302
|
* ```
|
|
303
303
|
* @since v0.1.26
|
|
304
304
|
*/
|
|
305
|
-
listeners(
|
|
305
|
+
listeners(eventName: string | symbol): Function[];
|
|
306
306
|
/**
|
|
307
307
|
* Returns a copy of the array of listeners for the event named `eventName`,
|
|
308
308
|
* including any wrappers (such as those created by `.once()`).
|
|
@@ -332,7 +332,7 @@ declare module 'events' {
|
|
|
332
332
|
* ```
|
|
333
333
|
* @since v9.4.0
|
|
334
334
|
*/
|
|
335
|
-
rawListeners(
|
|
335
|
+
rawListeners(eventName: string | symbol): Function[];
|
|
336
336
|
/**
|
|
337
337
|
* Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
|
|
338
338
|
* to each.
|
|
@@ -373,13 +373,13 @@ declare module 'events' {
|
|
|
373
373
|
* ```
|
|
374
374
|
* @since v0.1.26
|
|
375
375
|
*/
|
|
376
|
-
emit(
|
|
376
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
377
377
|
/**
|
|
378
378
|
* Returns the number of listeners listening to the event named `eventName`.
|
|
379
379
|
* @since v3.2.0
|
|
380
380
|
* @param eventName The name of the event being listened for
|
|
381
381
|
*/
|
|
382
|
-
listenerCount(
|
|
382
|
+
listenerCount(eventName: string | symbol): number;
|
|
383
383
|
/**
|
|
384
384
|
* Adds the `listener` function to the _beginning_ of the listeners array for the
|
|
385
385
|
* event named `eventName`. No checks are made to see if the `listener` has
|
|
@@ -397,7 +397,7 @@ declare module 'events' {
|
|
|
397
397
|
* @param eventName The name of the event.
|
|
398
398
|
* @param listener The callback function
|
|
399
399
|
*/
|
|
400
|
-
prependListener(
|
|
400
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
401
401
|
/**
|
|
402
402
|
* Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
|
|
403
403
|
* listener is removed, and then invoked.
|
|
@@ -413,7 +413,7 @@ declare module 'events' {
|
|
|
413
413
|
* @param eventName The name of the event.
|
|
414
414
|
* @param listener The callback function
|
|
415
415
|
*/
|
|
416
|
-
prependOnceListener(
|
|
416
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
417
417
|
/**
|
|
418
418
|
* Returns an array listing the events for which the emitter has registered
|
|
419
419
|
* listeners. The values in the array are strings or `Symbol`s.
|
node/fs/promises.d.ts
CHANGED
|
@@ -229,6 +229,41 @@ declare module 'fs/promises' {
|
|
|
229
229
|
* @since v10.0.0
|
|
230
230
|
*/
|
|
231
231
|
writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Write `buffer` to the file.
|
|
234
|
+
*
|
|
235
|
+
* The promise is resolved with an object containing two properties:
|
|
236
|
+
*
|
|
237
|
+
* It is unsafe to use `filehandle.write()` multiple times on the same file
|
|
238
|
+
* without waiting for the promise to be resolved (or rejected). For this
|
|
239
|
+
* scenario, use `fs.createWriteStream()`.
|
|
240
|
+
*
|
|
241
|
+
* On Linux, positional writes do not work when the file is opened in append mode.
|
|
242
|
+
* The kernel ignores the position argument and always appends the data to
|
|
243
|
+
* the end of the file.
|
|
244
|
+
* @since v10.0.0
|
|
245
|
+
* @param offset The start position from within `buffer` where the data to write begins.
|
|
246
|
+
* @param length The number of bytes from `buffer` to write.
|
|
247
|
+
* @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
|
|
248
|
+
* See the POSIX pwrite(2) documentation for more detail.
|
|
249
|
+
*/
|
|
250
|
+
write<TBuffer extends Uint8Array>(
|
|
251
|
+
buffer: TBuffer,
|
|
252
|
+
offset?: number | null,
|
|
253
|
+
length?: number | null,
|
|
254
|
+
position?: number | null
|
|
255
|
+
): Promise<{
|
|
256
|
+
bytesWritten: number;
|
|
257
|
+
buffer: TBuffer;
|
|
258
|
+
}>;
|
|
259
|
+
write(
|
|
260
|
+
data: string,
|
|
261
|
+
position?: number | null,
|
|
262
|
+
encoding?: BufferEncoding | null
|
|
263
|
+
): Promise<{
|
|
264
|
+
bytesWritten: number;
|
|
265
|
+
buffer: string;
|
|
266
|
+
}>;
|
|
232
267
|
/**
|
|
233
268
|
* Write an array of [<ArrayBufferView>](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView)s to the file.
|
|
234
269
|
*
|
|
@@ -338,7 +373,7 @@ declare module 'fs/promises' {
|
|
|
338
373
|
* `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)
|
|
339
374
|
* @return Fulfills with `undefined` upon success.
|
|
340
375
|
*/
|
|
341
|
-
function copyFile(src: PathLike, dest: PathLike,
|
|
376
|
+
function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise<void>;
|
|
342
377
|
/**
|
|
343
378
|
* Opens a `<FileHandle>`.
|
|
344
379
|
*
|
|
@@ -739,7 +774,7 @@ declare module 'fs/promises' {
|
|
|
739
774
|
* @return Fulfills with `undefined` upon success.
|
|
740
775
|
*/
|
|
741
776
|
function writeFile(
|
|
742
|
-
|
|
777
|
+
file: PathLike | FileHandle,
|
|
743
778
|
data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream,
|
|
744
779
|
options?:
|
|
745
780
|
| (ObjectEncodingOptions & {
|