@types/node 14.18.21 → 14.18.22

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 v14.18/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 07 Jun 2022 19:01:36 GMT
11
+ * Last updated: Wed, 13 Jul 2022 21:02:30 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node v14.18/crypto.d.ts CHANGED
@@ -406,9 +406,9 @@ declare module 'crypto' {
406
406
  private constructor();
407
407
  generateKeys(): Buffer;
408
408
  generateKeys(encoding: BinaryToTextEncoding): string;
409
- computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
410
- computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
411
- computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
409
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer;
410
+ computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer;
411
+ computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string;
412
412
  computeSecret(
413
413
  other_public_key: string,
414
414
  input_encoding: BinaryToTextEncoding,
@@ -428,7 +428,42 @@ declare module 'crypto' {
428
428
  setPrivateKey(private_key: string, encoding: BufferEncoding): void;
429
429
  verifyError: number;
430
430
  }
431
- function getDiffieHellman(group_name: string): DiffieHellman;
431
+ /**
432
+ * The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
433
+ * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
434
+ * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
435
+ *
436
+ * ```js
437
+ * const { createDiffieHellmanGroup } = await import('node:crypto');
438
+ * const dh = createDiffieHellmanGroup('modp1');
439
+ * ```
440
+ * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt):
441
+ * ```bash
442
+ * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
443
+ * modp1 # 768 bits
444
+ * modp2 # 1024 bits
445
+ * modp5 # 1536 bits
446
+ * modp14 # 2048 bits
447
+ * modp15 # etc.
448
+ * modp16
449
+ * modp17
450
+ * modp18
451
+ * ```
452
+ * @since v0.7.5
453
+ */
454
+ const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
455
+ interface DiffieHellmanGroupConstructor {
456
+ new(name: string): DiffieHellmanGroup;
457
+ (name: string): DiffieHellmanGroup;
458
+ readonly prototype: DiffieHellmanGroup;
459
+ }
460
+ type DiffieHellmanGroup = Omit<DiffieHellman, 'setPublicKey' | 'setPrivateKey'>;
461
+ function getDiffieHellman(groupName: string): DiffieHellmanGroup;
462
+ /**
463
+ * An alias for {@link getDiffieHellman}
464
+ * @since v0.9.3
465
+ */
466
+ function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
432
467
  function pbkdf2(
433
468
  password: BinaryLike,
434
469
  salt: BinaryLike,
@@ -531,6 +566,12 @@ declare module 'crypto' {
531
566
  function getCiphers(): string[];
532
567
  function getCurves(): string[];
533
568
  function getFips(): 1 | 0;
569
+ /**
570
+ * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. Throws an error if FIPS mode is not available.
571
+ * @since v10.0.0
572
+ * @param bool `true` to enable FIPS mode.
573
+ */
574
+ function setFips(bool: boolean): void;
534
575
  function getHashes(): string[];
535
576
  class ECDH {
536
577
  private constructor();
@@ -1207,6 +1248,35 @@ declare module 'crypto' {
1207
1248
  * 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES).
1208
1249
  */
1209
1250
  function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
1251
+ /**
1252
+ * Load and set the `engine` for some or all OpenSSL functions (selected by flags).
1253
+ *
1254
+ * `engine` could be either an id or a path to the engine's shared library.
1255
+ *
1256
+ * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default.
1257
+ * The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`):
1258
+ *
1259
+ * - `crypto.constants.ENGINE_METHOD_RSA`
1260
+ * - `crypto.constants.ENGINE_METHOD_DSA`
1261
+ * - `crypto.constants.ENGINE_METHOD_DH`
1262
+ * - `crypto.constants.ENGINE_METHOD_RAND`
1263
+ * - `crypto.constants.ENGINE_METHOD_EC`
1264
+ * - `crypto.constants.ENGINE_METHOD_CIPHERS`
1265
+ * - `crypto.constants.ENGINE_METHOD_DIGESTS`
1266
+ * - `crypto.constants.ENGINE_METHOD_PKEY_METHS`
1267
+ * - `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS`
1268
+ * - `crypto.constants.ENGINE_METHOD_ALL`
1269
+ * - `crypto.constants.ENGINE_METHOD_NONE`
1270
+ *
1271
+ * The flags below are deprecated in OpenSSL-1.1.0.
1272
+ *
1273
+ * - `crypto.constants.ENGINE_METHOD_ECDH`
1274
+ * - `crypto.constants.ENGINE_METHOD_ECDSA`
1275
+ * - `crypto.constants.ENGINE_METHOD_STORE`
1276
+ * @since v0.11.11
1277
+ * @param [flags=crypto.constants.ENGINE_METHOD_ALL]
1278
+ */
1279
+ function setEngine(engine: string, flags?: number): void;
1210
1280
  }
1211
1281
  declare module 'node:crypto' {
1212
1282
  export * from 'crypto';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.18.21",
3
+ "version": "14.18.22",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "0e120850d2efd3c212686946890a557c78b49f575a98e7575b49a55b2ddd9e90",
224
- "typeScriptVersion": "3.9"
223
+ "typesPublisherContentHash": "b495f890b1a6f312d85381156410dad61b7c727726953839266da2804b5b1f4d",
224
+ "typeScriptVersion": "4.0"
225
225
  }