@types/node 14.14.12 → 14.14.16

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 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: Thu, 10 Dec 2020 08:40:44 GMT
11
+ * Last updated: Wed, 23 Dec 2020 20:23:09 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/assert.d.ts CHANGED
@@ -21,6 +21,7 @@ declare module 'assert' {
21
21
  /** The `operator` property on the error instance. */
22
22
  operator?: string;
23
23
  /** If provided, the generated stack trace omits frames before this function. */
24
+ // tslint:disable-next-line:ban-types
24
25
  stackStartFn?: Function;
25
26
  });
26
27
  }
@@ -52,6 +53,7 @@ declare module 'assert' {
52
53
  expected: any,
53
54
  message?: string | Error,
54
55
  operator?: string,
56
+ // tslint:disable-next-line:ban-types
55
57
  stackStartFn?: Function,
56
58
  ): never;
57
59
  function ok(value: any, message?: string | Error): asserts value;
@@ -71,7 +73,7 @@ declare module 'assert' {
71
73
  function throws(block: () => any, message?: string | Error): void;
72
74
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
75
  function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
76
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75
77
 
76
78
  function ifError(value: any): asserts value is null | undefined;
77
79
 
@@ -84,7 +86,7 @@ declare module 'assert' {
84
86
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85
87
  function doesNotReject(
86
88
  block: (() => Promise<any>) | Promise<any>,
87
- error: RegExp | Function,
89
+ error: AssertPredicate,
88
90
  message?: string | Error,
89
91
  ): Promise<void>;
90
92
 
node/crypto.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- declare module "crypto" {
2
- import * as stream from "stream";
1
+ declare module 'crypto' {
2
+ import * as stream from 'stream';
3
3
 
4
4
  interface Certificate {
5
5
  exportChallenge(spkac: BinaryLike): Buffer;
@@ -7,11 +7,12 @@ declare module "crypto" {
7
7
  verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
8
8
  }
9
9
  const Certificate: {
10
- new(): Certificate;
10
+ new (): Certificate;
11
11
  (): Certificate;
12
12
  };
13
13
 
14
- namespace constants { // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
14
+ namespace constants {
15
+ // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
15
16
  const OPENSSL_VERSION_NUMBER: number;
16
17
 
17
18
  /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
@@ -120,26 +121,29 @@ declare module "crypto" {
120
121
  function createHash(algorithm: string, options?: HashOptions): Hash;
121
122
  function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
122
123
 
123
- type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
124
- type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
125
- type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";
126
- type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
127
- type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
124
+ // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
125
+ type BinaryToTextEncoding = 'base64' | 'hex';
126
+ type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
127
+ type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
128
+
129
+ type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
130
+
131
+ type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
128
132
 
129
133
  class Hash extends stream.Transform {
130
134
  private constructor();
131
135
  copy(): Hash;
132
136
  update(data: BinaryLike): Hash;
133
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
137
+ update(data: string, input_encoding: Encoding): Hash;
134
138
  digest(): Buffer;
135
- digest(encoding: HexBase64Latin1Encoding): string;
139
+ digest(encoding: BinaryToTextEncoding): string;
136
140
  }
137
141
  class Hmac extends stream.Transform {
138
142
  private constructor();
139
143
  update(data: BinaryLike): Hmac;
140
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
144
+ update(data: string, input_encoding: Encoding): Hmac;
141
145
  digest(): Buffer;
142
- digest(encoding: HexBase64Latin1Encoding): string;
146
+ digest(encoding: BinaryToTextEncoding): string;
143
147
  }
144
148
 
145
149
  type KeyObjectType = 'secret' | 'public' | 'private';
@@ -189,24 +193,27 @@ declare module "crypto" {
189
193
  algorithm: CipherCCMTypes,
190
194
  key: CipherKey,
191
195
  iv: BinaryLike | null,
192
- options: CipherCCMOptions
196
+ options: CipherCCMOptions,
193
197
  ): CipherCCM;
194
198
  function createCipheriv(
195
199
  algorithm: CipherGCMTypes,
196
200
  key: CipherKey,
197
201
  iv: BinaryLike | null,
198
- options?: CipherGCMOptions
202
+ options?: CipherGCMOptions,
199
203
  ): CipherGCM;
200
204
  function createCipheriv(
201
- algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions
205
+ algorithm: string,
206
+ key: CipherKey,
207
+ iv: BinaryLike | null,
208
+ options?: stream.TransformOptions,
202
209
  ): Cipher;
203
210
 
204
211
  class Cipher extends stream.Transform {
205
212
  private constructor();
206
213
  update(data: BinaryLike): Buffer;
207
- update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
208
- update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
209
- update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string;
214
+ update(data: string, input_encoding: Encoding): Buffer;
215
+ update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: BinaryToTextEncoding): string;
216
+ update(data: string, input_encoding: Encoding | undefined, output_encoding: BinaryToTextEncoding): string;
210
217
  final(): Buffer;
211
218
  final(output_encoding: BufferEncoding): string;
212
219
  setAutoPadding(auto_padding?: boolean): this;
@@ -240,14 +247,19 @@ declare module "crypto" {
240
247
  iv: BinaryLike | null,
241
248
  options?: CipherGCMOptions,
242
249
  ): DecipherGCM;
243
- function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
250
+ function createDecipheriv(
251
+ algorithm: string,
252
+ key: CipherKey,
253
+ iv: BinaryLike | null,
254
+ options?: stream.TransformOptions,
255
+ ): Decipher;
244
256
 
245
257
  class Decipher extends stream.Transform {
246
258
  private constructor();
247
259
  update(data: NodeJS.ArrayBufferView): Buffer;
248
- update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
249
- update(data: NodeJS.ArrayBufferView, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
250
- update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
260
+ update(data: string, input_encoding: BinaryToTextEncoding): Buffer;
261
+ update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string;
262
+ update(data: string, input_encoding: BinaryToTextEncoding | undefined, output_encoding: Encoding): string;
251
263
  final(): Buffer;
252
264
  final(output_encoding: BufferEncoding): string;
253
265
  setAutoPadding(auto_padding?: boolean): this;
@@ -293,13 +305,11 @@ declare module "crypto" {
293
305
  dsaEncoding?: DSAEncoding;
294
306
  }
295
307
 
296
- interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {
297
- }
308
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
298
309
  interface SignKeyObjectInput extends SigningOptions {
299
310
  key: KeyObject;
300
311
  }
301
- interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {
302
- }
312
+ interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
303
313
  interface VerifyKeyObjectInput extends SigningOptions {
304
314
  key: KeyObject;
305
315
  }
@@ -310,9 +320,12 @@ declare module "crypto" {
310
320
  private constructor();
311
321
 
312
322
  update(data: BinaryLike): Signer;
313
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
323
+ update(data: string, input_encoding: Encoding): Signer;
314
324
  sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
315
- sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, output_format: HexBase64Latin1Encoding): string;
325
+ sign(
326
+ private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
327
+ output_format: BinaryToTextEncoding,
328
+ ): string;
316
329
  }
317
330
 
318
331
  function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
@@ -320,33 +333,53 @@ declare module "crypto" {
320
333
  private constructor();
321
334
 
322
335
  update(data: BinaryLike): Verify;
323
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
324
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
325
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: HexBase64Latin1Encoding): boolean;
336
+ update(data: string, input_encoding: Encoding): Verify;
337
+ verify(
338
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
339
+ signature: NodeJS.ArrayBufferView,
340
+ ): boolean;
341
+ verify(
342
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
343
+ signature: string,
344
+ signature_format?: BinaryToTextEncoding,
345
+ ): boolean;
326
346
  // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
327
347
  // The signature field accepts a TypedArray type, but it is only available starting ES2017
328
348
  }
329
349
  function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
330
350
  function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
331
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
332
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
333
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
351
+ function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding): DiffieHellman;
352
+ function createDiffieHellman(
353
+ prime: string,
354
+ prime_encoding: BinaryToTextEncoding,
355
+ generator: number | NodeJS.ArrayBufferView,
356
+ ): DiffieHellman;
357
+ function createDiffieHellman(
358
+ prime: string,
359
+ prime_encoding: BinaryToTextEncoding,
360
+ generator: string,
361
+ generator_encoding: BinaryToTextEncoding,
362
+ ): DiffieHellman;
334
363
  class DiffieHellman {
335
364
  private constructor();
336
365
  generateKeys(): Buffer;
337
- generateKeys(encoding: HexBase64Latin1Encoding): string;
366
+ generateKeys(encoding: BinaryToTextEncoding): string;
338
367
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
339
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
340
- computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
341
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
368
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
369
+ computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
370
+ computeSecret(
371
+ other_public_key: string,
372
+ input_encoding: BinaryToTextEncoding,
373
+ output_encoding: BinaryToTextEncoding,
374
+ ): string;
342
375
  getPrime(): Buffer;
343
- getPrime(encoding: HexBase64Latin1Encoding): string;
376
+ getPrime(encoding: BinaryToTextEncoding): string;
344
377
  getGenerator(): Buffer;
345
- getGenerator(encoding: HexBase64Latin1Encoding): string;
378
+ getGenerator(encoding: BinaryToTextEncoding): string;
346
379
  getPublicKey(): Buffer;
347
- getPublicKey(encoding: HexBase64Latin1Encoding): string;
380
+ getPublicKey(encoding: BinaryToTextEncoding): string;
348
381
  getPrivateKey(): Buffer;
349
- getPrivateKey(encoding: HexBase64Latin1Encoding): string;
382
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
350
383
  setPublicKey(public_key: NodeJS.ArrayBufferView): void;
351
384
  setPublicKey(public_key: string, encoding: BufferEncoding): void;
352
385
  setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
@@ -362,7 +395,13 @@ declare module "crypto" {
362
395
  digest: string,
363
396
  callback: (err: Error | null, derivedKey: Buffer) => any,
364
397
  ): void;
365
- function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
398
+ function pbkdf2Sync(
399
+ password: BinaryLike,
400
+ salt: BinaryLike,
401
+ iterations: number,
402
+ keylen: number,
403
+ digest: string,
404
+ ): Buffer;
366
405
 
367
406
  function randomBytes(size: number): Buffer;
368
407
  function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
@@ -375,11 +414,26 @@ declare module "crypto" {
375
414
  function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
376
415
 
377
416
  function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
378
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
379
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
380
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
417
+ function randomFill<T extends NodeJS.ArrayBufferView>(
418
+ buffer: T,
419
+ callback: (err: Error | null, buf: T) => void,
420
+ ): void;
421
+ function randomFill<T extends NodeJS.ArrayBufferView>(
422
+ buffer: T,
423
+ offset: number,
424
+ callback: (err: Error | null, buf: T) => void,
425
+ ): void;
426
+ function randomFill<T extends NodeJS.ArrayBufferView>(
427
+ buffer: T,
428
+ offset: number,
429
+ size: number,
430
+ callback: (err: Error | null, buf: T) => void,
431
+ ): void;
381
432
 
382
433
  interface ScryptOptions {
434
+ cost?: number;
435
+ blockSize?: number;
436
+ parallelization?: number;
383
437
  N?: number;
384
438
  r?: number;
385
439
  p?: number;
@@ -388,7 +442,8 @@ declare module "crypto" {
388
442
  function scrypt(
389
443
  password: BinaryLike,
390
444
  salt: BinaryLike,
391
- keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void,
445
+ keylen: number,
446
+ callback: (err: Error | null, derivedKey: Buffer) => void,
392
447
  ): void;
393
448
  function scrypt(
394
449
  password: BinaryLike,
@@ -426,22 +481,26 @@ declare module "crypto" {
426
481
  static convertKey(
427
482
  key: BinaryLike,
428
483
  curve: string,
429
- inputEncoding?: HexBase64Latin1Encoding,
430
- outputEncoding?: "latin1" | "hex" | "base64",
431
- format?: "uncompressed" | "compressed" | "hybrid",
484
+ inputEncoding?: BinaryToTextEncoding,
485
+ outputEncoding?: 'latin1' | 'hex' | 'base64',
486
+ format?: 'uncompressed' | 'compressed' | 'hybrid',
432
487
  ): Buffer | string;
433
488
  generateKeys(): Buffer;
434
- generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
489
+ generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
435
490
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
436
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
437
- computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
438
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
491
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
492
+ computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
493
+ computeSecret(
494
+ other_public_key: string,
495
+ input_encoding: BinaryToTextEncoding,
496
+ output_encoding: BinaryToTextEncoding,
497
+ ): string;
439
498
  getPrivateKey(): Buffer;
440
- getPrivateKey(encoding: HexBase64Latin1Encoding): string;
499
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
441
500
  getPublicKey(): Buffer;
442
- getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
501
+ getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
443
502
  setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
444
- setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
503
+ setPrivateKey(private_key: string, encoding: BinaryToTextEncoding): void;
445
504
  }
446
505
  function createECDH(curve_name: string): ECDH;
447
506
  function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
@@ -475,15 +534,15 @@ declare module "crypto" {
475
534
  }
476
535
 
477
536
  interface X25519KeyPairKeyObjectOptions {
478
- /**
479
- * No options.
480
- */
537
+ /**
538
+ * No options.
539
+ */
481
540
  }
482
541
 
483
542
  interface X448KeyPairKeyObjectOptions {
484
- /**
485
- * No options.
486
- */
543
+ /**
544
+ * No options.
545
+ */
487
546
  }
488
547
 
489
548
  interface ECKeyPairKeyObjectOptions {
@@ -615,132 +674,446 @@ declare module "crypto" {
615
674
  privateKey: T2;
616
675
  }
617
676
 
618
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
619
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
620
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
621
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
677
+ function generateKeyPairSync(
678
+ type: 'rsa',
679
+ options: RSAKeyPairOptions<'pem', 'pem'>,
680
+ ): KeyPairSyncResult<string, string>;
681
+ function generateKeyPairSync(
682
+ type: 'rsa',
683
+ options: RSAKeyPairOptions<'pem', 'der'>,
684
+ ): KeyPairSyncResult<string, Buffer>;
685
+ function generateKeyPairSync(
686
+ type: 'rsa',
687
+ options: RSAKeyPairOptions<'der', 'pem'>,
688
+ ): KeyPairSyncResult<Buffer, string>;
689
+ function generateKeyPairSync(
690
+ type: 'rsa',
691
+ options: RSAKeyPairOptions<'der', 'der'>,
692
+ ): KeyPairSyncResult<Buffer, Buffer>;
622
693
  function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
623
694
 
624
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
625
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
626
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
627
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
695
+ function generateKeyPairSync(
696
+ type: 'dsa',
697
+ options: DSAKeyPairOptions<'pem', 'pem'>,
698
+ ): KeyPairSyncResult<string, string>;
699
+ function generateKeyPairSync(
700
+ type: 'dsa',
701
+ options: DSAKeyPairOptions<'pem', 'der'>,
702
+ ): KeyPairSyncResult<string, Buffer>;
703
+ function generateKeyPairSync(
704
+ type: 'dsa',
705
+ options: DSAKeyPairOptions<'der', 'pem'>,
706
+ ): KeyPairSyncResult<Buffer, string>;
707
+ function generateKeyPairSync(
708
+ type: 'dsa',
709
+ options: DSAKeyPairOptions<'der', 'der'>,
710
+ ): KeyPairSyncResult<Buffer, Buffer>;
628
711
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
629
712
 
630
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
631
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
632
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
633
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
713
+ function generateKeyPairSync(
714
+ type: 'ec',
715
+ options: ECKeyPairOptions<'pem', 'pem'>,
716
+ ): KeyPairSyncResult<string, string>;
717
+ function generateKeyPairSync(
718
+ type: 'ec',
719
+ options: ECKeyPairOptions<'pem', 'der'>,
720
+ ): KeyPairSyncResult<string, Buffer>;
721
+ function generateKeyPairSync(
722
+ type: 'ec',
723
+ options: ECKeyPairOptions<'der', 'pem'>,
724
+ ): KeyPairSyncResult<Buffer, string>;
725
+ function generateKeyPairSync(
726
+ type: 'ec',
727
+ options: ECKeyPairOptions<'der', 'der'>,
728
+ ): KeyPairSyncResult<Buffer, Buffer>;
634
729
  function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
635
730
 
636
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
637
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
638
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
639
- function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
731
+ function generateKeyPairSync(
732
+ type: 'ed25519',
733
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
734
+ ): KeyPairSyncResult<string, string>;
735
+ function generateKeyPairSync(
736
+ type: 'ed25519',
737
+ options: ED25519KeyPairOptions<'pem', 'der'>,
738
+ ): KeyPairSyncResult<string, Buffer>;
739
+ function generateKeyPairSync(
740
+ type: 'ed25519',
741
+ options: ED25519KeyPairOptions<'der', 'pem'>,
742
+ ): KeyPairSyncResult<Buffer, string>;
743
+ function generateKeyPairSync(
744
+ type: 'ed25519',
745
+ options: ED25519KeyPairOptions<'der', 'der'>,
746
+ ): KeyPairSyncResult<Buffer, Buffer>;
640
747
  function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
641
748
 
642
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
643
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
644
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
645
- function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
749
+ function generateKeyPairSync(
750
+ type: 'ed448',
751
+ options: ED448KeyPairOptions<'pem', 'pem'>,
752
+ ): KeyPairSyncResult<string, string>;
753
+ function generateKeyPairSync(
754
+ type: 'ed448',
755
+ options: ED448KeyPairOptions<'pem', 'der'>,
756
+ ): KeyPairSyncResult<string, Buffer>;
757
+ function generateKeyPairSync(
758
+ type: 'ed448',
759
+ options: ED448KeyPairOptions<'der', 'pem'>,
760
+ ): KeyPairSyncResult<Buffer, string>;
761
+ function generateKeyPairSync(
762
+ type: 'ed448',
763
+ options: ED448KeyPairOptions<'der', 'der'>,
764
+ ): KeyPairSyncResult<Buffer, Buffer>;
646
765
  function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
647
766
 
648
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
649
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
650
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
651
- function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
767
+ function generateKeyPairSync(
768
+ type: 'x25519',
769
+ options: X25519KeyPairOptions<'pem', 'pem'>,
770
+ ): KeyPairSyncResult<string, string>;
771
+ function generateKeyPairSync(
772
+ type: 'x25519',
773
+ options: X25519KeyPairOptions<'pem', 'der'>,
774
+ ): KeyPairSyncResult<string, Buffer>;
775
+ function generateKeyPairSync(
776
+ type: 'x25519',
777
+ options: X25519KeyPairOptions<'der', 'pem'>,
778
+ ): KeyPairSyncResult<Buffer, string>;
779
+ function generateKeyPairSync(
780
+ type: 'x25519',
781
+ options: X25519KeyPairOptions<'der', 'der'>,
782
+ ): KeyPairSyncResult<Buffer, Buffer>;
652
783
  function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
653
784
 
654
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
655
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
656
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
657
- function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
785
+ function generateKeyPairSync(
786
+ type: 'x448',
787
+ options: X448KeyPairOptions<'pem', 'pem'>,
788
+ ): KeyPairSyncResult<string, string>;
789
+ function generateKeyPairSync(
790
+ type: 'x448',
791
+ options: X448KeyPairOptions<'pem', 'der'>,
792
+ ): KeyPairSyncResult<string, Buffer>;
793
+ function generateKeyPairSync(
794
+ type: 'x448',
795
+ options: X448KeyPairOptions<'der', 'pem'>,
796
+ ): KeyPairSyncResult<Buffer, string>;
797
+ function generateKeyPairSync(
798
+ type: 'x448',
799
+ options: X448KeyPairOptions<'der', 'der'>,
800
+ ): KeyPairSyncResult<Buffer, Buffer>;
658
801
  function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
659
802
 
660
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
661
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
662
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
663
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
664
- function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
665
-
666
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
667
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
668
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
669
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
670
- function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
671
-
672
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
673
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
674
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
675
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
676
- function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
677
-
678
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
679
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
680
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
681
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
682
- function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
683
-
684
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
685
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
686
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
687
- function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
688
- function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
689
-
690
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
691
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
692
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
693
- function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
694
- function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
695
-
696
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
697
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
698
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
699
- function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
700
- function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
803
+ function generateKeyPair(
804
+ type: 'rsa',
805
+ options: RSAKeyPairOptions<'pem', 'pem'>,
806
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
807
+ ): void;
808
+ function generateKeyPair(
809
+ type: 'rsa',
810
+ options: RSAKeyPairOptions<'pem', 'der'>,
811
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
812
+ ): void;
813
+ function generateKeyPair(
814
+ type: 'rsa',
815
+ options: RSAKeyPairOptions<'der', 'pem'>,
816
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
817
+ ): void;
818
+ function generateKeyPair(
819
+ type: 'rsa',
820
+ options: RSAKeyPairOptions<'der', 'der'>,
821
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
822
+ ): void;
823
+ function generateKeyPair(
824
+ type: 'rsa',
825
+ options: RSAKeyPairKeyObjectOptions,
826
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
827
+ ): void;
828
+
829
+ function generateKeyPair(
830
+ type: 'dsa',
831
+ options: DSAKeyPairOptions<'pem', 'pem'>,
832
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
833
+ ): void;
834
+ function generateKeyPair(
835
+ type: 'dsa',
836
+ options: DSAKeyPairOptions<'pem', 'der'>,
837
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
838
+ ): void;
839
+ function generateKeyPair(
840
+ type: 'dsa',
841
+ options: DSAKeyPairOptions<'der', 'pem'>,
842
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
843
+ ): void;
844
+ function generateKeyPair(
845
+ type: 'dsa',
846
+ options: DSAKeyPairOptions<'der', 'der'>,
847
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
848
+ ): void;
849
+ function generateKeyPair(
850
+ type: 'dsa',
851
+ options: DSAKeyPairKeyObjectOptions,
852
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
853
+ ): void;
854
+
855
+ function generateKeyPair(
856
+ type: 'ec',
857
+ options: ECKeyPairOptions<'pem', 'pem'>,
858
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
859
+ ): void;
860
+ function generateKeyPair(
861
+ type: 'ec',
862
+ options: ECKeyPairOptions<'pem', 'der'>,
863
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
864
+ ): void;
865
+ function generateKeyPair(
866
+ type: 'ec',
867
+ options: ECKeyPairOptions<'der', 'pem'>,
868
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
869
+ ): void;
870
+ function generateKeyPair(
871
+ type: 'ec',
872
+ options: ECKeyPairOptions<'der', 'der'>,
873
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
874
+ ): void;
875
+ function generateKeyPair(
876
+ type: 'ec',
877
+ options: ECKeyPairKeyObjectOptions,
878
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
879
+ ): void;
880
+
881
+ function generateKeyPair(
882
+ type: 'ed25519',
883
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
884
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
885
+ ): void;
886
+ function generateKeyPair(
887
+ type: 'ed25519',
888
+ options: ED25519KeyPairOptions<'pem', 'der'>,
889
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
890
+ ): void;
891
+ function generateKeyPair(
892
+ type: 'ed25519',
893
+ options: ED25519KeyPairOptions<'der', 'pem'>,
894
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
895
+ ): void;
896
+ function generateKeyPair(
897
+ type: 'ed25519',
898
+ options: ED25519KeyPairOptions<'der', 'der'>,
899
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
900
+ ): void;
901
+ function generateKeyPair(
902
+ type: 'ed25519',
903
+ options: ED25519KeyPairKeyObjectOptions | undefined,
904
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
905
+ ): void;
906
+
907
+ function generateKeyPair(
908
+ type: 'ed448',
909
+ options: ED448KeyPairOptions<'pem', 'pem'>,
910
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
911
+ ): void;
912
+ function generateKeyPair(
913
+ type: 'ed448',
914
+ options: ED448KeyPairOptions<'pem', 'der'>,
915
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
916
+ ): void;
917
+ function generateKeyPair(
918
+ type: 'ed448',
919
+ options: ED448KeyPairOptions<'der', 'pem'>,
920
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
921
+ ): void;
922
+ function generateKeyPair(
923
+ type: 'ed448',
924
+ options: ED448KeyPairOptions<'der', 'der'>,
925
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
926
+ ): void;
927
+ function generateKeyPair(
928
+ type: 'ed448',
929
+ options: ED448KeyPairKeyObjectOptions | undefined,
930
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
931
+ ): void;
932
+
933
+ function generateKeyPair(
934
+ type: 'x25519',
935
+ options: X25519KeyPairOptions<'pem', 'pem'>,
936
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
937
+ ): void;
938
+ function generateKeyPair(
939
+ type: 'x25519',
940
+ options: X25519KeyPairOptions<'pem', 'der'>,
941
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
942
+ ): void;
943
+ function generateKeyPair(
944
+ type: 'x25519',
945
+ options: X25519KeyPairOptions<'der', 'pem'>,
946
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
947
+ ): void;
948
+ function generateKeyPair(
949
+ type: 'x25519',
950
+ options: X25519KeyPairOptions<'der', 'der'>,
951
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
952
+ ): void;
953
+ function generateKeyPair(
954
+ type: 'x25519',
955
+ options: X25519KeyPairKeyObjectOptions | undefined,
956
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
957
+ ): void;
958
+
959
+ function generateKeyPair(
960
+ type: 'x448',
961
+ options: X448KeyPairOptions<'pem', 'pem'>,
962
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
963
+ ): void;
964
+ function generateKeyPair(
965
+ type: 'x448',
966
+ options: X448KeyPairOptions<'pem', 'der'>,
967
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
968
+ ): void;
969
+ function generateKeyPair(
970
+ type: 'x448',
971
+ options: X448KeyPairOptions<'der', 'pem'>,
972
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
973
+ ): void;
974
+ function generateKeyPair(
975
+ type: 'x448',
976
+ options: X448KeyPairOptions<'der', 'der'>,
977
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
978
+ ): void;
979
+ function generateKeyPair(
980
+ type: 'x448',
981
+ options: X448KeyPairKeyObjectOptions | undefined,
982
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
983
+ ): void;
701
984
 
702
985
  namespace generateKeyPair {
703
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
704
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
705
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
706
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
707
- function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
708
-
709
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
710
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
711
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
712
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
713
- function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
714
-
715
- function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
716
- function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
717
- function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
718
- function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
719
- function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
720
-
721
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
722
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
723
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
724
- function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
725
- function __promisify__(type: "ed25519", options?: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
726
-
727
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
728
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
729
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
730
- function __promisify__(type: "ed448", options: ED448KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
731
- function __promisify__(type: "ed448", options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
732
-
733
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
734
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
735
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
736
- function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
737
- function __promisify__(type: "x25519", options?: X25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
738
-
739
- function __promisify__(type: "x448", options: X448KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
740
- function __promisify__(type: "x448", options: X448KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
741
- function __promisify__(type: "x448", options: X448KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
742
- function __promisify__(type: "x448", options: X448KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
743
- function __promisify__(type: "x448", options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
986
+ function __promisify__(
987
+ type: 'rsa',
988
+ options: RSAKeyPairOptions<'pem', 'pem'>,
989
+ ): Promise<{ publicKey: string; privateKey: string }>;
990
+ function __promisify__(
991
+ type: 'rsa',
992
+ options: RSAKeyPairOptions<'pem', 'der'>,
993
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
994
+ function __promisify__(
995
+ type: 'rsa',
996
+ options: RSAKeyPairOptions<'der', 'pem'>,
997
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
998
+ function __promisify__(
999
+ type: 'rsa',
1000
+ options: RSAKeyPairOptions<'der', 'der'>,
1001
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1002
+ function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1003
+
1004
+ function __promisify__(
1005
+ type: 'dsa',
1006
+ options: DSAKeyPairOptions<'pem', 'pem'>,
1007
+ ): Promise<{ publicKey: string; privateKey: string }>;
1008
+ function __promisify__(
1009
+ type: 'dsa',
1010
+ options: DSAKeyPairOptions<'pem', 'der'>,
1011
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1012
+ function __promisify__(
1013
+ type: 'dsa',
1014
+ options: DSAKeyPairOptions<'der', 'pem'>,
1015
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1016
+ function __promisify__(
1017
+ type: 'dsa',
1018
+ options: DSAKeyPairOptions<'der', 'der'>,
1019
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1020
+ function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1021
+
1022
+ function __promisify__(
1023
+ type: 'ec',
1024
+ options: ECKeyPairOptions<'pem', 'pem'>,
1025
+ ): Promise<{ publicKey: string; privateKey: string }>;
1026
+ function __promisify__(
1027
+ type: 'ec',
1028
+ options: ECKeyPairOptions<'pem', 'der'>,
1029
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1030
+ function __promisify__(
1031
+ type: 'ec',
1032
+ options: ECKeyPairOptions<'der', 'pem'>,
1033
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1034
+ function __promisify__(
1035
+ type: 'ec',
1036
+ options: ECKeyPairOptions<'der', 'der'>,
1037
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1038
+ function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1039
+
1040
+ function __promisify__(
1041
+ type: 'ed25519',
1042
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
1043
+ ): Promise<{ publicKey: string; privateKey: string }>;
1044
+ function __promisify__(
1045
+ type: 'ed25519',
1046
+ options: ED25519KeyPairOptions<'pem', 'der'>,
1047
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1048
+ function __promisify__(
1049
+ type: 'ed25519',
1050
+ options: ED25519KeyPairOptions<'der', 'pem'>,
1051
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1052
+ function __promisify__(
1053
+ type: 'ed25519',
1054
+ options: ED25519KeyPairOptions<'der', 'der'>,
1055
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1056
+ function __promisify__(
1057
+ type: 'ed25519',
1058
+ options?: ED25519KeyPairKeyObjectOptions,
1059
+ ): Promise<KeyPairKeyObjectResult>;
1060
+
1061
+ function __promisify__(
1062
+ type: 'ed448',
1063
+ options: ED448KeyPairOptions<'pem', 'pem'>,
1064
+ ): Promise<{ publicKey: string; privateKey: string }>;
1065
+ function __promisify__(
1066
+ type: 'ed448',
1067
+ options: ED448KeyPairOptions<'pem', 'der'>,
1068
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1069
+ function __promisify__(
1070
+ type: 'ed448',
1071
+ options: ED448KeyPairOptions<'der', 'pem'>,
1072
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1073
+ function __promisify__(
1074
+ type: 'ed448',
1075
+ options: ED448KeyPairOptions<'der', 'der'>,
1076
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1077
+ function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
1078
+
1079
+ function __promisify__(
1080
+ type: 'x25519',
1081
+ options: X25519KeyPairOptions<'pem', 'pem'>,
1082
+ ): Promise<{ publicKey: string; privateKey: string }>;
1083
+ function __promisify__(
1084
+ type: 'x25519',
1085
+ options: X25519KeyPairOptions<'pem', 'der'>,
1086
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1087
+ function __promisify__(
1088
+ type: 'x25519',
1089
+ options: X25519KeyPairOptions<'der', 'pem'>,
1090
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1091
+ function __promisify__(
1092
+ type: 'x25519',
1093
+ options: X25519KeyPairOptions<'der', 'der'>,
1094
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1095
+ function __promisify__(
1096
+ type: 'x25519',
1097
+ options?: X25519KeyPairKeyObjectOptions,
1098
+ ): Promise<KeyPairKeyObjectResult>;
1099
+
1100
+ function __promisify__(
1101
+ type: 'x448',
1102
+ options: X448KeyPairOptions<'pem', 'pem'>,
1103
+ ): Promise<{ publicKey: string; privateKey: string }>;
1104
+ function __promisify__(
1105
+ type: 'x448',
1106
+ options: X448KeyPairOptions<'pem', 'der'>,
1107
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
1108
+ function __promisify__(
1109
+ type: 'x448',
1110
+ options: X448KeyPairOptions<'der', 'pem'>,
1111
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
1112
+ function __promisify__(
1113
+ type: 'x448',
1114
+ options: X448KeyPairOptions<'der', 'der'>,
1115
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
1116
+ function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
744
1117
  }
745
1118
 
746
1119
  /**
@@ -751,7 +1124,11 @@ declare module "crypto" {
751
1124
  * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
752
1125
  * passed to [`crypto.createPrivateKey()`][].
753
1126
  */
754
- function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
1127
+ function sign(
1128
+ algorithm: string | null | undefined,
1129
+ data: NodeJS.ArrayBufferView,
1130
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
1131
+ ): Buffer;
755
1132
 
756
1133
  /**
757
1134
  * Calculates and returns the signature for `data` using the given private key and
@@ -761,15 +1138,17 @@ declare module "crypto" {
761
1138
  * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
762
1139
  * passed to [`crypto.createPublicKey()`][].
763
1140
  */
764
- function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
1141
+ function verify(
1142
+ algorithm: string | null | undefined,
1143
+ data: NodeJS.ArrayBufferView,
1144
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
1145
+ signature: NodeJS.ArrayBufferView,
1146
+ ): boolean;
765
1147
 
766
1148
  /**
767
1149
  * Computes the Diffie-Hellman secret based on a privateKey and a publicKey.
768
1150
  * Both keys must have the same asymmetricKeyType, which must be one of
769
1151
  * 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES).
770
1152
  */
771
- function diffieHellman(options: {
772
- privateKey: KeyObject;
773
- publicKey: KeyObject
774
- }): Buffer;
1153
+ function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
775
1154
  }
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.12",
3
+ "version": "14.14.16",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -246,6 +246,6 @@
246
246
  },
247
247
  "scripts": {},
248
248
  "dependencies": {},
249
- "typesPublisherContentHash": "2e2a48406ddc98c6044ee8e3edf314e027ba73c4466de68f466bd5fc823c0adf",
249
+ "typesPublisherContentHash": "2d4f09678c547a590a021a003c6ada9c287ace6cba79d28af6b988612252de2d",
250
250
  "typeScriptVersion": "3.3"
251
251
  }
node/ts3.4/assert.d.ts CHANGED
@@ -21,6 +21,7 @@ declare module 'assert' {
21
21
  /** The `operator` property on the error instance. */
22
22
  operator?: string;
23
23
  /** If provided, the generated stack trace omits frames before this function. */
24
+ // tslint:disable-next-line:ban-types
24
25
  stackStartFn?: Function;
25
26
  });
26
27
  }
@@ -52,6 +53,7 @@ declare module 'assert' {
52
53
  expected: any,
53
54
  message?: string | Error,
54
55
  operator?: string,
56
+ // tslint:disable-next-line:ban-types
55
57
  stackStartFn?: Function,
56
58
  ): never;
57
59
  function ok(value: any, message?: string | Error): void;
@@ -71,7 +73,7 @@ declare module 'assert' {
71
73
  function throws(block: () => any, message?: string | Error): void;
72
74
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
75
  function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
76
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75
77
 
76
78
  function ifError(value: any): void;
77
79
 
@@ -84,7 +86,7 @@ declare module 'assert' {
84
86
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85
87
  function doesNotReject(
86
88
  block: (() => Promise<any>) | Promise<any>,
87
- error: RegExp | Function,
89
+ error: AssertPredicate,
88
90
  message?: string | Error,
89
91
  ): Promise<void>;
90
92
 
node/util.d.ts CHANGED
@@ -5,8 +5,8 @@ declare module "util" {
5
5
  interface InspectOptionsStylized extends InspectOptions {
6
6
  stylize(text: string, styleType: Style): string;
7
7
  }
8
- function format(format: any, ...param: any[]): string;
9
- function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string;
8
+ function format(format?: any, ...param: any[]): string;
9
+ function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
10
10
  /** @deprecated since v0.11.3 - use a third party module instead. */
11
11
  function log(string: string): void;
12
12
  function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;