@types/node 13.13.37 → 13.13.41

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 v13.13/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/v13.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 23 Dec 2020 20:12:49 GMT
11
+ * Last updated: Wed, 03 Feb 2021 22:47:37 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 v13.13/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,11 +121,11 @@ 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
+ type Utf8AsciiLatin1Encoding = 'utf8' | 'ascii' | 'latin1';
125
+ type HexBase64Latin1Encoding = 'latin1' | 'hex' | 'base64';
126
+ type Utf8AsciiBinaryEncoding = 'utf8' | 'ascii' | 'binary';
127
+ type HexBase64BinaryEncoding = 'binary' | 'base64' | 'hex';
128
+ type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
128
129
 
129
130
  class Hash extends stream.Transform {
130
131
  private constructor();
@@ -189,24 +190,35 @@ declare module "crypto" {
189
190
  algorithm: CipherCCMTypes,
190
191
  key: CipherKey,
191
192
  iv: BinaryLike | null,
192
- options: CipherCCMOptions
193
+ options: CipherCCMOptions,
193
194
  ): CipherCCM;
194
195
  function createCipheriv(
195
196
  algorithm: CipherGCMTypes,
196
197
  key: CipherKey,
197
198
  iv: BinaryLike | null,
198
- options?: CipherGCMOptions
199
+ options?: CipherGCMOptions,
199
200
  ): CipherGCM;
200
201
  function createCipheriv(
201
- algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions
202
+ algorithm: string,
203
+ key: CipherKey,
204
+ iv: BinaryLike | null,
205
+ options?: stream.TransformOptions,
202
206
  ): Cipher;
203
207
 
204
208
  class Cipher extends stream.Transform {
205
209
  private constructor();
206
210
  update(data: BinaryLike): Buffer;
207
211
  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;
212
+ update(
213
+ data: NodeJS.ArrayBufferView,
214
+ input_encoding: undefined,
215
+ output_encoding: HexBase64BinaryEncoding,
216
+ ): string;
217
+ update(
218
+ data: string,
219
+ input_encoding: Utf8AsciiBinaryEncoding | undefined,
220
+ output_encoding: HexBase64BinaryEncoding,
221
+ ): string;
210
222
  final(): Buffer;
211
223
  final(output_encoding: string): string;
212
224
  setAutoPadding(auto_padding?: boolean): this;
@@ -240,14 +252,27 @@ declare module "crypto" {
240
252
  iv: BinaryLike | null,
241
253
  options?: CipherGCMOptions,
242
254
  ): DecipherGCM;
243
- function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
255
+ function createDecipheriv(
256
+ algorithm: string,
257
+ key: CipherKey,
258
+ iv: BinaryLike | null,
259
+ options?: stream.TransformOptions,
260
+ ): Decipher;
244
261
 
245
262
  class Decipher extends stream.Transform {
246
263
  private constructor();
247
264
  update(data: NodeJS.ArrayBufferView): Buffer;
248
265
  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;
266
+ update(
267
+ data: NodeJS.ArrayBufferView,
268
+ input_encoding: HexBase64BinaryEncoding | undefined,
269
+ output_encoding: Utf8AsciiBinaryEncoding,
270
+ ): string;
271
+ update(
272
+ data: string,
273
+ input_encoding: HexBase64BinaryEncoding | undefined,
274
+ output_encoding: Utf8AsciiBinaryEncoding,
275
+ ): string;
251
276
  final(): Buffer;
252
277
  final(output_encoding: string): string;
253
278
  setAutoPadding(auto_padding?: boolean): this;
@@ -290,8 +315,7 @@ declare module "crypto" {
290
315
  saltLength?: number;
291
316
  }
292
317
 
293
- interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {
294
- }
318
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
295
319
 
296
320
  type KeyLike = string | Buffer | KeyObject;
297
321
 
@@ -318,8 +342,17 @@ declare module "crypto" {
318
342
  function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
319
343
  function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
320
344
  function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
321
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
322
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
345
+ function createDiffieHellman(
346
+ prime: string,
347
+ prime_encoding: HexBase64Latin1Encoding,
348
+ generator: number | NodeJS.ArrayBufferView,
349
+ ): DiffieHellman;
350
+ function createDiffieHellman(
351
+ prime: string,
352
+ prime_encoding: HexBase64Latin1Encoding,
353
+ generator: string,
354
+ generator_encoding: HexBase64Latin1Encoding,
355
+ ): DiffieHellman;
323
356
  class DiffieHellman {
324
357
  private constructor();
325
358
  generateKeys(): Buffer;
@@ -327,7 +360,11 @@ declare module "crypto" {
327
360
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
328
361
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
329
362
  computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
330
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
363
+ computeSecret(
364
+ other_public_key: string,
365
+ input_encoding: HexBase64Latin1Encoding,
366
+ output_encoding: HexBase64Latin1Encoding,
367
+ ): string;
331
368
  getPrime(): Buffer;
332
369
  getPrime(encoding: HexBase64Latin1Encoding): string;
333
370
  getGenerator(): Buffer;
@@ -351,7 +388,13 @@ declare module "crypto" {
351
388
  digest: string,
352
389
  callback: (err: Error | null, derivedKey: Buffer) => any,
353
390
  ): void;
354
- function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
391
+ function pbkdf2Sync(
392
+ password: BinaryLike,
393
+ salt: BinaryLike,
394
+ iterations: number,
395
+ keylen: number,
396
+ digest: string,
397
+ ): Buffer;
355
398
 
356
399
  function randomBytes(size: number): Buffer;
357
400
  function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
@@ -359,11 +402,26 @@ declare module "crypto" {
359
402
  function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
360
403
 
361
404
  function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
362
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
363
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
364
- function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
405
+ function randomFill<T extends NodeJS.ArrayBufferView>(
406
+ buffer: T,
407
+ callback: (err: Error | null, buf: T) => void,
408
+ ): void;
409
+ function randomFill<T extends NodeJS.ArrayBufferView>(
410
+ buffer: T,
411
+ offset: number,
412
+ callback: (err: Error | null, buf: T) => void,
413
+ ): void;
414
+ function randomFill<T extends NodeJS.ArrayBufferView>(
415
+ buffer: T,
416
+ offset: number,
417
+ size: number,
418
+ callback: (err: Error | null, buf: T) => void,
419
+ ): void;
365
420
 
366
421
  interface ScryptOptions {
422
+ cost?: number;
423
+ blockSize?: number;
424
+ parallelization?: number;
367
425
  N?: number;
368
426
  r?: number;
369
427
  p?: number;
@@ -372,7 +430,8 @@ declare module "crypto" {
372
430
  function scrypt(
373
431
  password: BinaryLike,
374
432
  salt: BinaryLike,
375
- keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void,
433
+ keylen: number,
434
+ callback: (err: Error | null, derivedKey: Buffer) => void,
376
435
  ): void;
377
436
  function scrypt(
378
437
  password: BinaryLike,
@@ -411,15 +470,19 @@ declare module "crypto" {
411
470
  key: BinaryLike,
412
471
  curve: string,
413
472
  inputEncoding?: HexBase64Latin1Encoding,
414
- outputEncoding?: "latin1" | "hex" | "base64",
415
- format?: "uncompressed" | "compressed" | "hybrid",
473
+ outputEncoding?: 'latin1' | 'hex' | 'base64',
474
+ format?: 'uncompressed' | 'compressed' | 'hybrid',
416
475
  ): Buffer | string;
417
476
  generateKeys(): Buffer;
418
477
  generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
419
478
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
420
479
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
421
480
  computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
422
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
481
+ computeSecret(
482
+ other_public_key: string,
483
+ input_encoding: HexBase64Latin1Encoding,
484
+ output_encoding: HexBase64Latin1Encoding,
485
+ ): string;
423
486
  getPrivateKey(): Buffer;
424
487
  getPrivateKey(encoding: HexBase64Latin1Encoding): string;
425
488
  getPublicKey(): Buffer;
@@ -535,60 +598,192 @@ declare module "crypto" {
535
598
  privateKey: T2;
536
599
  }
537
600
 
538
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
539
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
540
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
541
- function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
601
+ function generateKeyPairSync(
602
+ type: 'rsa',
603
+ options: RSAKeyPairOptions<'pem', 'pem'>,
604
+ ): KeyPairSyncResult<string, string>;
605
+ function generateKeyPairSync(
606
+ type: 'rsa',
607
+ options: RSAKeyPairOptions<'pem', 'der'>,
608
+ ): KeyPairSyncResult<string, Buffer>;
609
+ function generateKeyPairSync(
610
+ type: 'rsa',
611
+ options: RSAKeyPairOptions<'der', 'pem'>,
612
+ ): KeyPairSyncResult<Buffer, string>;
613
+ function generateKeyPairSync(
614
+ type: 'rsa',
615
+ options: RSAKeyPairOptions<'der', 'der'>,
616
+ ): KeyPairSyncResult<Buffer, Buffer>;
542
617
  function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
543
618
 
544
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
545
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
546
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
547
- function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
619
+ function generateKeyPairSync(
620
+ type: 'dsa',
621
+ options: DSAKeyPairOptions<'pem', 'pem'>,
622
+ ): KeyPairSyncResult<string, string>;
623
+ function generateKeyPairSync(
624
+ type: 'dsa',
625
+ options: DSAKeyPairOptions<'pem', 'der'>,
626
+ ): KeyPairSyncResult<string, Buffer>;
627
+ function generateKeyPairSync(
628
+ type: 'dsa',
629
+ options: DSAKeyPairOptions<'der', 'pem'>,
630
+ ): KeyPairSyncResult<Buffer, string>;
631
+ function generateKeyPairSync(
632
+ type: 'dsa',
633
+ options: DSAKeyPairOptions<'der', 'der'>,
634
+ ): KeyPairSyncResult<Buffer, Buffer>;
548
635
  function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
549
636
 
550
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
551
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
552
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
553
- function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
637
+ function generateKeyPairSync(
638
+ type: 'ec',
639
+ options: ECKeyPairOptions<'pem', 'pem'>,
640
+ ): KeyPairSyncResult<string, string>;
641
+ function generateKeyPairSync(
642
+ type: 'ec',
643
+ options: ECKeyPairOptions<'pem', 'der'>,
644
+ ): KeyPairSyncResult<string, Buffer>;
645
+ function generateKeyPairSync(
646
+ type: 'ec',
647
+ options: ECKeyPairOptions<'der', 'pem'>,
648
+ ): KeyPairSyncResult<Buffer, string>;
649
+ function generateKeyPairSync(
650
+ type: 'ec',
651
+ options: ECKeyPairOptions<'der', 'der'>,
652
+ ): KeyPairSyncResult<Buffer, Buffer>;
554
653
  function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
555
654
 
556
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
557
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
558
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
559
- function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
560
- function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
655
+ function generateKeyPair(
656
+ type: 'rsa',
657
+ options: RSAKeyPairOptions<'pem', 'pem'>,
658
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
659
+ ): void;
660
+ function generateKeyPair(
661
+ type: 'rsa',
662
+ options: RSAKeyPairOptions<'pem', 'der'>,
663
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
664
+ ): void;
665
+ function generateKeyPair(
666
+ type: 'rsa',
667
+ options: RSAKeyPairOptions<'der', 'pem'>,
668
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
669
+ ): void;
670
+ function generateKeyPair(
671
+ type: 'rsa',
672
+ options: RSAKeyPairOptions<'der', 'der'>,
673
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
674
+ ): void;
675
+ function generateKeyPair(
676
+ type: 'rsa',
677
+ options: RSAKeyPairKeyObjectOptions,
678
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
679
+ ): void;
561
680
 
562
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
563
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
564
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
565
- function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
566
- function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
681
+ function generateKeyPair(
682
+ type: 'dsa',
683
+ options: DSAKeyPairOptions<'pem', 'pem'>,
684
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
685
+ ): void;
686
+ function generateKeyPair(
687
+ type: 'dsa',
688
+ options: DSAKeyPairOptions<'pem', 'der'>,
689
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
690
+ ): void;
691
+ function generateKeyPair(
692
+ type: 'dsa',
693
+ options: DSAKeyPairOptions<'der', 'pem'>,
694
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
695
+ ): void;
696
+ function generateKeyPair(
697
+ type: 'dsa',
698
+ options: DSAKeyPairOptions<'der', 'der'>,
699
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
700
+ ): void;
701
+ function generateKeyPair(
702
+ type: 'dsa',
703
+ options: DSAKeyPairKeyObjectOptions,
704
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
705
+ ): void;
567
706
 
568
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
569
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
570
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
571
- function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
572
- function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
707
+ function generateKeyPair(
708
+ type: 'ec',
709
+ options: ECKeyPairOptions<'pem', 'pem'>,
710
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
711
+ ): void;
712
+ function generateKeyPair(
713
+ type: 'ec',
714
+ options: ECKeyPairOptions<'pem', 'der'>,
715
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
716
+ ): void;
717
+ function generateKeyPair(
718
+ type: 'ec',
719
+ options: ECKeyPairOptions<'der', 'pem'>,
720
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
721
+ ): void;
722
+ function generateKeyPair(
723
+ type: 'ec',
724
+ options: ECKeyPairOptions<'der', 'der'>,
725
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
726
+ ): void;
727
+ function generateKeyPair(
728
+ type: 'ec',
729
+ options: ECKeyPairKeyObjectOptions,
730
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
731
+ ): void;
573
732
 
574
733
  namespace generateKeyPair {
575
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
576
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
577
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
578
- function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
579
- function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
580
-
581
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
582
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
583
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
584
- function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
585
- function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
586
-
587
- function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
588
- function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
589
- function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
590
- function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
591
- function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
734
+ function __promisify__(
735
+ type: 'rsa',
736
+ options: RSAKeyPairOptions<'pem', 'pem'>,
737
+ ): Promise<{ publicKey: string; privateKey: string }>;
738
+ function __promisify__(
739
+ type: 'rsa',
740
+ options: RSAKeyPairOptions<'pem', 'der'>,
741
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
742
+ function __promisify__(
743
+ type: 'rsa',
744
+ options: RSAKeyPairOptions<'der', 'pem'>,
745
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
746
+ function __promisify__(
747
+ type: 'rsa',
748
+ options: RSAKeyPairOptions<'der', 'der'>,
749
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
750
+ function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
751
+
752
+ function __promisify__(
753
+ type: 'dsa',
754
+ options: DSAKeyPairOptions<'pem', 'pem'>,
755
+ ): Promise<{ publicKey: string; privateKey: string }>;
756
+ function __promisify__(
757
+ type: 'dsa',
758
+ options: DSAKeyPairOptions<'pem', 'der'>,
759
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
760
+ function __promisify__(
761
+ type: 'dsa',
762
+ options: DSAKeyPairOptions<'der', 'pem'>,
763
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
764
+ function __promisify__(
765
+ type: 'dsa',
766
+ options: DSAKeyPairOptions<'der', 'der'>,
767
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
768
+ function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
769
+
770
+ function __promisify__(
771
+ type: 'ec',
772
+ options: ECKeyPairOptions<'pem', 'pem'>,
773
+ ): Promise<{ publicKey: string; privateKey: string }>;
774
+ function __promisify__(
775
+ type: 'ec',
776
+ options: ECKeyPairOptions<'pem', 'der'>,
777
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
778
+ function __promisify__(
779
+ type: 'ec',
780
+ options: ECKeyPairOptions<'der', 'pem'>,
781
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
782
+ function __promisify__(
783
+ type: 'ec',
784
+ options: ECKeyPairOptions<'der', 'der'>,
785
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
786
+ function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
592
787
  }
593
788
 
594
789
  /**
@@ -599,10 +794,13 @@ declare module "crypto" {
599
794
  * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
600
795
  * passed to [`crypto.createPrivateKey()`][].
601
796
  */
602
- function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignPrivateKeyInput): Buffer;
797
+ function sign(
798
+ algorithm: string | null | undefined,
799
+ data: NodeJS.ArrayBufferView,
800
+ key: KeyLike | SignPrivateKeyInput,
801
+ ): Buffer;
603
802
 
604
- interface VerifyKeyWithOptions extends KeyObject, SigningOptions {
605
- }
803
+ interface VerifyKeyWithOptions extends KeyObject, SigningOptions {}
606
804
 
607
805
  /**
608
806
  * Calculates and returns the signature for `data` using the given private key and
@@ -612,5 +810,10 @@ declare module "crypto" {
612
810
  * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
613
811
  * passed to [`crypto.createPublicKey()`][].
614
812
  */
615
- function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyWithOptions, signature: NodeJS.ArrayBufferView): boolean;
813
+ function verify(
814
+ algorithm: string | null | undefined,
815
+ data: NodeJS.ArrayBufferView,
816
+ key: KeyLike | VerifyKeyWithOptions,
817
+ signature: NodeJS.ArrayBufferView,
818
+ ): boolean;
616
819
  }
node v13.13/domain.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- declare module "domain" {
2
- import { EventEmitter } from "events";
1
+ declare module 'domain' {
2
+ import EventEmitter = require('events');
3
3
 
4
4
  class Domain extends EventEmitter implements NodeJS.Domain {
5
5
  run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
node v13.13/events.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module "events" {
1
+ declare module 'events' {
2
2
  interface EventEmitterOptions {
3
3
  /**
4
4
  * Enables automatic capturing of promise rejection.
@@ -14,11 +14,16 @@ declare module "events" {
14
14
  addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
15
15
  }
16
16
 
17
- namespace EventEmitter {
18
- function once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
19
- function once(emitter: DOMEventTarget, event: string): Promise<any[]>;
20
- function on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>;
21
- const captureRejectionSymbol: unique symbol;
17
+ interface EventEmitter extends NodeJS.EventEmitter {}
18
+ class EventEmitter {
19
+ constructor(options?: EventEmitterOptions);
20
+
21
+ static once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
22
+ static once(emitter: DOMEventTarget, event: string): Promise<any[]>;
23
+ static on(emitter: NodeJS.EventEmitter, event: string): AsyncIterableIterator<any>;
24
+
25
+ /** @deprecated since v4.0.0 */
26
+ static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number;
22
27
 
23
28
  /**
24
29
  * This symbol shall be used to install a listener for only monitoring `'error'`
@@ -29,21 +34,21 @@ declare module "events" {
29
34
  * `'error'` event is emitted, therefore the process will still crash if no
30
35
  * regular `'error'` listener is installed.
31
36
  */
32
- const errorMonitor: unique symbol;
37
+ static readonly errorMonitor: unique symbol;
38
+ static readonly captureRejectionSymbol: unique symbol;
39
+
33
40
  /**
34
41
  * Sets or gets the default captureRejection value for all emitters.
35
42
  */
36
- let captureRejections: boolean;
37
-
38
- interface EventEmitter extends NodeJS.EventEmitter {
39
- }
43
+ // TODO: These should be described using static getter/setter pairs:
44
+ static captureRejections: boolean;
45
+ static defaultMaxListeners: number;
46
+ }
40
47
 
41
- class EventEmitter {
42
- constructor(options?: EventEmitterOptions);
43
- /** @deprecated since v4.0.0 */
44
- static listenerCount(emitter: EventEmitter, event: string | symbol): number;
45
- static defaultMaxListeners: number;
46
- }
48
+ import internal = require('events');
49
+ namespace EventEmitter {
50
+ // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
51
+ export { internal as EventEmitter };
47
52
  }
48
53
 
49
54
  export = EventEmitter;
node v13.13/fs.d.ts CHANGED
@@ -875,7 +875,7 @@ declare module "fs" {
875
875
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
876
876
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
877
877
  */
878
- function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path: string) => void): void;
878
+ function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
879
879
 
880
880
  /**
881
881
  * Asynchronous mkdir(2) - create a directory.
@@ -891,7 +891,7 @@ declare module "fs" {
891
891
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
892
892
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
893
893
  */
894
- function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path: string | undefined) => void): void;
894
+ function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
895
895
 
896
896
  /**
897
897
  * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
@@ -907,7 +907,7 @@ declare module "fs" {
907
907
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
908
908
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
909
909
  */
910
- function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
910
+ function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
911
911
 
912
912
  /**
913
913
  * Asynchronous mkdir(2) - create a directory.
@@ -932,7 +932,7 @@ declare module "fs" {
932
932
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
933
933
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
934
934
  */
935
- function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string;
935
+ function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string | undefined;
936
936
 
937
937
  /**
938
938
  * Synchronous mkdir(2) - create a directory.
@@ -2382,7 +2382,7 @@ declare module "fs" {
2382
2382
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
2383
2383
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
2384
2384
  */
2385
- function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
2385
+ function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
2386
2386
 
2387
2387
  /**
2388
2388
  * Asynchronous mkdir(2) - create a directory.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "13.13.37",
3
+ "version": "13.13.41",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -241,6 +241,6 @@
241
241
  },
242
242
  "scripts": {},
243
243
  "dependencies": {},
244
- "typesPublisherContentHash": "1d4eae23abed6f636c0d13f94c8894400f9431901559bb71d8579efe752bd2af",
245
- "typeScriptVersion": "3.3"
244
+ "typesPublisherContentHash": "57e09f4181881840c8e34686af2b4341425c91614fbf3832921a25f47da98b6d",
245
+ "typeScriptVersion": "3.4"
246
246
  }
node v13.13/stream.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- declare module "stream" {
2
- import * as events from "events";
1
+ declare module 'stream' {
2
+ import EventEmitter = require('events');
3
3
 
4
- class internal extends events.EventEmitter {
4
+ class internal extends EventEmitter {
5
5
  pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
6
6
  }
7
7
 
node v13.13/url.d.ts CHANGED
@@ -40,13 +40,19 @@ declare module "url" {
40
40
  query: string | null;
41
41
  }
42
42
 
43
+ /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
43
44
  function parse(urlStr: string): UrlWithStringQuery;
45
+ /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
44
46
  function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
47
+ /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
45
48
  function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
49
+ /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
46
50
  function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
47
51
 
48
52
  function format(URL: URL, options?: URLFormatOptions): string;
53
+ /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
49
54
  function format(urlObject: UrlObject | string): string;
55
+ /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
50
56
  function resolve(from: string, to: string): string;
51
57
 
52
58
  function domainToASCII(domain: string): string;