@types/node 10.3.2 → 10.3.6

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.
Files changed (3) hide show
  1. node/README.md +2 -2
  2. node/index.d.ts +170 -80
  3. node/package.json +12 -2
node/README.md CHANGED
@@ -8,9 +8,9 @@ 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, 07 Jun 2018 19:55:41 GMT
11
+ * Last updated: Tue, 26 Jun 2018 01:10:51 GMT
12
12
  * Dependencies: none
13
13
  * Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout
14
14
 
15
15
  # Credits
16
- These definitions were written by Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Parambir Singh <https://github.com/parambirs>, Christian Vaagland Tellnes <https://github.com/tellnes>, Wilco Bakker <https://github.com/WilcoBakker>, Nicolas Voigt <https://github.com/octo-sniffle>, Chigozirim C. <https://github.com/smac89>, Flarna <https://github.com/Flarna>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, wwwy3y3 <https://github.com/wwwy3y3>, Deividas Bakanas <https://github.com/DeividasBakanas>, Kelvin Jin <https://github.com/kjin>, Alvis HT Tang <https://github.com/alvis>, Sebastian Silbermann <https://github.com/eps1lon>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Alberto Schiabel <https://github.com/jkomyno>, Klaus Meinhardt <https://github.com/ajafff>, Huw <https://github.com/hoo29>, Nicolas Even <https://github.com/n-e>, Bruno Scheufler <https://github.com/brunoscheufler>, Mohsen Azimi <https://github.com/mohsen1>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Alexander T. <https://github.com/a-tarasyuk>, Lishude <https://github.com/islishude>.
16
+ These definitions were written by Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>, Parambir Singh <https://github.com/parambirs>, Christian Vaagland Tellnes <https://github.com/tellnes>, Wilco Bakker <https://github.com/WilcoBakker>, Nicolas Voigt <https://github.com/octo-sniffle>, Chigozirim C. <https://github.com/smac89>, Flarna <https://github.com/Flarna>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, wwwy3y3 <https://github.com/wwwy3y3>, Deividas Bakanas <https://github.com/DeividasBakanas>, Kelvin Jin <https://github.com/kjin>, Alvis HT Tang <https://github.com/alvis>, Sebastian Silbermann <https://github.com/eps1lon>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Alberto Schiabel <https://github.com/jkomyno>, Klaus Meinhardt <https://github.com/ajafff>, Huw <https://github.com/hoo29>, Nicolas Even <https://github.com/n-e>, Bruno Scheufler <https://github.com/brunoscheufler>, Mohsen Azimi <https://github.com/mohsen1>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Alexander T. <https://github.com/a-tarasyuk>, Lishude <https://github.com/islishude>, Andrew Makarov <https://github.com/r3nya>, Zane Hannan AU <https://github.com/ZaneHannanAU>.
node/index.d.ts CHANGED
@@ -24,6 +24,8 @@
24
24
  // Hoàng Văn Khải <https://github.com/KSXGitHub>
25
25
  // Alexander T. <https://github.com/a-tarasyuk>
26
26
  // Lishude <https://github.com/islishude>
27
+ // Andrew Makarov <https://github.com/r3nya>
28
+ // Zane Hannan AU <https://github.com/ZaneHannanAU>
27
29
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
28
30
 
29
31
  /** inspector module types */
@@ -374,20 +376,27 @@ declare var Buffer: {
374
376
  * The optional {byteOffset} and {length} arguments specify a memory range
375
377
  * within the {arrayBuffer} that will be shared by the Buffer.
376
378
  *
377
- * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
379
+ * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
378
380
  */
379
381
  from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
382
+ // from(arrayBuffer: SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
380
383
  /**
381
384
  * Creates a new Buffer using the passed {data}
382
385
  * @param data data to create a new Buffer
383
386
  */
384
- from(data: any[] | string | ArrayBuffer | Uint8Array /*| TypedArray*/): Buffer;
387
+ from(data: any[]): Buffer;
388
+ from(data: Uint8Array): Buffer;
385
389
  /**
386
390
  * Creates a new Buffer containing the given JavaScript string {str}.
387
391
  * If provided, the {encoding} parameter identifies the character encoding.
388
392
  * If not provided, {encoding} defaults to 'utf8'.
389
393
  */
390
394
  from(str: string, encoding?: string): Buffer;
395
+ /**
396
+ * Creates a new Buffer using the passed {data}
397
+ * @param values to create a new Buffer
398
+ */
399
+ of(...items: number[]): Buffer;
391
400
  /**
392
401
  * Returns true if {obj} is a Buffer
393
402
  *
@@ -408,7 +417,7 @@ declare var Buffer: {
408
417
  * @param string string to test. (TypedArray is also allowed, but it is only available starting ES2017)
409
418
  * @param encoding encoding used to evaluate (defaults to 'utf8')
410
419
  */
411
- byteLength(string: string | Buffer | DataView | ArrayBuffer, encoding?: string): number;
420
+ byteLength(string: string | ArrayBuffer | ArrayBufferView, encoding?: string): number;
412
421
  /**
413
422
  * Returns a buffer which is the result of concatenating all the buffers in the list together.
414
423
  *
@@ -468,6 +477,7 @@ declare namespace NodeJS {
468
477
  showProxy?: boolean;
469
478
  maxArrayLength?: number | null;
470
479
  breakLength?: number;
480
+ compact?: boolean;
471
481
  }
472
482
 
473
483
  export interface ConsoleConstructor {
@@ -2540,6 +2550,12 @@ declare module "dns" {
2540
2550
  export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
2541
2551
  }
2542
2552
 
2553
+ export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
2554
+
2555
+ export namespace lookupService {
2556
+ export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
2557
+ }
2558
+
2543
2559
  export interface ResolveOptions {
2544
2560
  ttl: boolean;
2545
2561
  }
@@ -2553,11 +2569,19 @@ declare module "dns" {
2553
2569
  ttl: number;
2554
2570
  }
2555
2571
 
2572
+ export interface AnyRecordWithTtl extends RecordWithTtl {
2573
+ type: "A" | "AAAA";
2574
+ }
2575
+
2556
2576
  export interface MxRecord {
2557
2577
  priority: number;
2558
2578
  exchange: string;
2559
2579
  }
2560
2580
 
2581
+ export interface AnyMxRecord extends MxRecord {
2582
+ type: "MX";
2583
+ }
2584
+
2561
2585
  export interface NaptrRecord {
2562
2586
  flags: string;
2563
2587
  service: string;
@@ -2567,6 +2591,10 @@ declare module "dns" {
2567
2591
  preference: number;
2568
2592
  }
2569
2593
 
2594
+ export interface AnyNaptrRecord extends NaptrRecord {
2595
+ type: "NAPTR";
2596
+ }
2597
+
2570
2598
  export interface SoaRecord {
2571
2599
  nsname: string;
2572
2600
  hostmaster: string;
@@ -2577,6 +2605,10 @@ declare module "dns" {
2577
2605
  minttl: number;
2578
2606
  }
2579
2607
 
2608
+ export interface AnySoaRecord extends SoaRecord {
2609
+ type: "SOA";
2610
+ }
2611
+
2580
2612
  export interface SrvRecord {
2581
2613
  priority: number;
2582
2614
  weight: number;
@@ -2584,9 +2616,19 @@ declare module "dns" {
2584
2616
  name: string;
2585
2617
  }
2586
2618
 
2619
+ export interface AnySrvRecord extends SrvRecord {
2620
+ type: "SRV";
2621
+ }
2622
+
2623
+ export interface AnyTxtRecord {
2624
+ type: "TXT";
2625
+ entries: string[];
2626
+ }
2627
+
2587
2628
  export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2588
2629
  export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2589
2630
  export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2631
+ export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>) => void): void;
2590
2632
  export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2591
2633
  export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
2592
2634
  export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
@@ -2600,6 +2642,7 @@ declare module "dns" {
2600
2642
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
2601
2643
  export namespace resolve {
2602
2644
  export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
2645
+ export function __promisify__(hostname: string, rrtype: "ANY"): Promise<ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>>;
2603
2646
  export function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
2604
2647
  export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
2605
2648
  export function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
@@ -2630,6 +2673,7 @@ declare module "dns" {
2630
2673
  export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
2631
2674
  }
2632
2675
 
2676
+ export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>) => void): void;
2633
2677
  export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
2634
2678
  export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
2635
2679
  export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
@@ -5684,10 +5728,12 @@ declare module "tls" {
5684
5728
  }
5685
5729
 
5686
5730
  declare module "crypto" {
5731
+ import * as stream from "stream";
5732
+
5687
5733
  export interface Certificate {
5688
- exportChallenge(spkac: string | Buffer): Buffer;
5689
- exportPublicKey(spkac: string | Buffer): Buffer;
5690
- verifySpkac(spkac: Buffer): boolean;
5734
+ exportChallenge(spkac: string | ArrayBufferView): Buffer;
5735
+ exportPublicKey(spkac: string | ArrayBufferView): Buffer;
5736
+ verifySpkac(spkac: ArrayBufferView): boolean;
5691
5737
  }
5692
5738
  export var Certificate: {
5693
5739
  new(): Certificate;
@@ -5708,8 +5754,8 @@ declare module "crypto" {
5708
5754
  }
5709
5755
  export interface Credentials { context?: any; }
5710
5756
  export function createCredentials(details: CredentialDetails): Credentials;
5711
- export function createHash(algorithm: string): Hash;
5712
- export function createHmac(algorithm: string, key: string | Buffer): Hmac;
5757
+ export function createHash(algorithm: string, options?: stream.TransformOptions): Hash;
5758
+ export function createHmac(algorithm: string, key: string | ArrayBufferView, options?: stream.TransformOptions): Hmac;
5713
5759
 
5714
5760
  type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
5715
5761
  type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
@@ -5718,72 +5764,112 @@ declare module "crypto" {
5718
5764
  type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
5719
5765
 
5720
5766
  export interface Hash extends NodeJS.ReadWriteStream {
5721
- update(data: string | Buffer | DataView): Hash;
5722
- update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hash;
5767
+ update(data: string | ArrayBufferView): Hash;
5768
+ update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
5723
5769
  digest(): Buffer;
5724
5770
  digest(encoding: HexBase64Latin1Encoding): string;
5725
5771
  }
5726
5772
  export interface Hmac extends NodeJS.ReadWriteStream {
5727
- update(data: string | Buffer | DataView): Hmac;
5728
- update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
5773
+ update(data: string | ArrayBufferView): Hmac;
5774
+ update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
5729
5775
  digest(): Buffer;
5730
5776
  digest(encoding: HexBase64Latin1Encoding): string;
5731
5777
  }
5732
-
5778
+ export type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm';
5779
+ export type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
5780
+ export interface CipherCCMOptions extends stream.TransformOptions {
5781
+ authTagLength: number;
5782
+ }
5783
+ export interface CipherGCMOptions extends stream.TransformOptions {
5784
+ authTagLength?: number;
5785
+ }
5733
5786
  /** @deprecated since v10.0.0 use createCipheriv() */
5734
- export function createCipher(algorithm: string, password: any): Cipher;
5735
- export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
5787
+ export function createCipher(algorithm: string, password: string | ArrayBufferView, options?: stream.TransformOptions): Cipher;
5788
+ export function createCipher(algorithm: CipherCCMTypes, password: string | ArrayBufferView, options: CipherCCMOptions): CipherCCM;
5789
+ export function createCipher(algorithm: CipherGCMTypes, password: string | ArrayBufferView, options: CipherGCMOptions): CipherGCM;
5790
+
5791
+ export function createCipheriv(algorithm: string, key: string | ArrayBufferView, iv: string | ArrayBufferView, options?: stream.TransformOptions): Cipher;
5792
+ export function createCipheriv(algorithm: CipherGCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherCCMOptions): CipherCCM;
5793
+ export function createCipheriv(algorithm: CipherGCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherGCMOptions): CipherGCM;
5794
+
5736
5795
  export interface Cipher extends NodeJS.ReadWriteStream {
5737
- update(data: Buffer | DataView): Buffer;
5796
+ update(data: string | ArrayBufferView): Buffer;
5738
5797
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
5739
- update(data: Buffer | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
5798
+ update(data: ArrayBufferView, output_encoding: HexBase64BinaryEncoding): string;
5799
+ update(data: ArrayBufferView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
5800
+ // second arg ignored
5740
5801
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
5741
5802
  final(): Buffer;
5742
5803
  final(output_encoding: string): string;
5743
5804
  setAutoPadding(auto_padding?: boolean): this;
5805
+ // getAuthTag(): Buffer;
5806
+ // setAAD(buffer: Buffer): this; // docs only say buffer
5807
+ }
5808
+ export interface CipherCCM extends Cipher {
5809
+ setAAD(buffer: Buffer, options: { plainTextLength: number }): this;
5810
+ getAuthTag(): Buffer;
5811
+ }
5812
+ export interface CipherGCM extends Cipher {
5813
+ setAAD(buffer: Buffer, options?: { plainTextLength: number }): this;
5744
5814
  getAuthTag(): Buffer;
5745
- setAAD(buffer: Buffer): this;
5746
5815
  }
5747
5816
  /** @deprecated since v10.0.0 use createCipheriv() */
5748
- export function createDecipher(algorithm: string, password: any): Decipher;
5749
- export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
5817
+ export function createDecipher(algorithm: string, password: string | ArrayBufferView, options?: stream.TransformOptions): Decipher;
5818
+ export function createDecipher(algorithm: CipherCCMTypes, password: string | ArrayBufferView, options: CipherCCMOptions): DecipherCCM;
5819
+ export function createDecipher(algorithm: CipherGCMTypes, password: string | ArrayBufferView, options: CipherGCMOptions): DecipherGCM;
5820
+
5821
+ export function createDecipheriv(algorithm: string, key: string | ArrayBufferView, iv: string | ArrayBufferView, options?: stream.TransformOptions): Decipher;
5822
+ export function createDecipheriv(algorithm: CipherCCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherCCMOptions): DecipherCCM;
5823
+ export function createDecipheriv(algorithm: CipherGCMTypes, key: string | ArrayBufferView, iv: string | ArrayBufferView, options: CipherGCMOptions): DecipherGCM;
5824
+
5750
5825
  export interface Decipher extends NodeJS.ReadWriteStream {
5751
- update(data: Buffer | DataView): Buffer;
5826
+ update(data: ArrayBufferView): Buffer;
5752
5827
  update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
5753
- update(data: Buffer | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
5828
+ update(data: ArrayBufferView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
5829
+ // second arg is ignored
5754
5830
  update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
5755
5831
  final(): Buffer;
5756
5832
  final(output_encoding: string): string;
5757
5833
  setAutoPadding(auto_padding?: boolean): this;
5758
- setAuthTag(tag: Buffer): this;
5759
- setAAD(buffer: Buffer): this;
5834
+ // setAuthTag(tag: ArrayBufferView): this;
5835
+ // setAAD(buffer: ArrayBufferView): this; // docs say buffer view
5836
+ }
5837
+ export interface DecipherCCM extends Decipher {
5838
+ setAuthTag(buffer: ArrayBufferView, options: { plainTextLength: number }): this;
5839
+ setAAD(buffer: ArrayBufferView): this; // docs say buffer view
5840
+ }
5841
+ export interface DecipherGCM extends Decipher {
5842
+ setAuthTag(buffer: ArrayBufferView, options?: { plainTextLength: number }): this;
5843
+ setAAD(buffer: ArrayBufferView): this; // docs say buffer view
5760
5844
  }
5761
- export function createSign(algorithm: string): Signer;
5845
+
5846
+ export function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
5762
5847
  export interface Signer extends NodeJS.WritableStream {
5763
- update(data: string | Buffer | DataView): Signer;
5764
- update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Signer;
5848
+ update(data: string | ArrayBufferView): Signer;
5849
+ update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
5765
5850
  sign(private_key: string | { key: string; passphrase: string }): Buffer;
5766
5851
  sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
5767
5852
  }
5768
- export function createVerify(algorith: string): Verify;
5853
+ export function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
5769
5854
  export interface Verify extends NodeJS.WritableStream {
5770
- update(data: string | Buffer | DataView): Verify;
5771
- update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Verify;
5772
- verify(object: string | Object, signature: Buffer | DataView): boolean;
5855
+ update(data: string | ArrayBufferView): Verify;
5856
+ update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
5857
+ verify(object: string | Object, signature: ArrayBufferView): boolean;
5773
5858
  verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
5774
5859
  // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
5775
5860
  // The signature field accepts a TypedArray type, but it is only available starting ES2017
5776
5861
  }
5777
- export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman;
5778
- export function createDiffieHellman(prime: Buffer): DiffieHellman;
5862
+ export function createDiffieHellman(prime_length: number, generator?: number | ArrayBufferView): DiffieHellman;
5863
+ export function createDiffieHellman(prime: ArrayBufferView): DiffieHellman;
5779
5864
  export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
5780
- export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman;
5865
+ export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | ArrayBufferView): DiffieHellman;
5781
5866
  export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
5782
5867
  export interface DiffieHellman {
5783
5868
  generateKeys(): Buffer;
5784
5869
  generateKeys(encoding: HexBase64Latin1Encoding): string;
5785
- computeSecret(other_public_key: Buffer): Buffer;
5870
+ computeSecret(other_public_key: ArrayBufferView): Buffer;
5786
5871
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
5872
+ computeSecret(other_public_key: ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
5787
5873
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
5788
5874
  getPrime(): Buffer;
5789
5875
  getPrime(encoding: HexBase64Latin1Encoding): string;
@@ -5793,26 +5879,26 @@ declare module "crypto" {
5793
5879
  getPublicKey(encoding: HexBase64Latin1Encoding): string;
5794
5880
  getPrivateKey(): Buffer;
5795
5881
  getPrivateKey(encoding: HexBase64Latin1Encoding): string;
5796
- setPublicKey(public_key: Buffer): void;
5882
+ setPublicKey(public_key: ArrayBufferView): void;
5797
5883
  setPublicKey(public_key: string, encoding: string): void;
5798
- setPrivateKey(private_key: Buffer): void;
5884
+ setPrivateKey(private_key: ArrayBufferView): void;
5799
5885
  setPrivateKey(private_key: string, encoding: string): void;
5800
5886
  verifyError: number;
5801
5887
  }
5802
5888
  export function getDiffieHellman(group_name: string): DiffieHellman;
5803
- export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
5804
- export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer;
5889
+ export function pbkdf2(password: string | ArrayBufferView, salt: string | ArrayBufferView, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void;
5890
+ export function pbkdf2Sync(password: string | ArrayBufferView, salt: string | ArrayBufferView, iterations: number, keylen: number, digest: string): Buffer;
5891
+
5805
5892
  export function randomBytes(size: number): Buffer;
5806
- export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
5893
+ export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
5807
5894
  export function pseudoRandomBytes(size: number): Buffer;
5808
- export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
5809
- export function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer;
5810
- export function randomFill(buffer: Buffer, callback: (err: Error, buf: Buffer) => void): void;
5811
- export function randomFill(buffer: Uint8Array, callback: (err: Error, buf: Uint8Array) => void): void;
5812
- export function randomFill(buffer: Buffer, offset: number, callback: (err: Error, buf: Buffer) => void): void;
5813
- export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error, buf: Uint8Array) => void): void;
5814
- export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error, buf: Buffer) => void): void;
5815
- export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error, buf: Uint8Array) => void): void;
5895
+ export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
5896
+
5897
+ export function randomFillSync(buffer: ArrayBufferView, offset?: number, size?: number): ArrayBufferView;
5898
+ export function randomFill(buffer: ArrayBufferView, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
5899
+ export function randomFill(buffer: ArrayBufferView, offset: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
5900
+ export function randomFill(buffer: ArrayBufferView, offset: number, size: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
5901
+
5816
5902
  export interface RsaPublicKey {
5817
5903
  key: string;
5818
5904
  padding?: number;
@@ -5822,29 +5908,30 @@ declare module "crypto" {
5822
5908
  passphrase?: string;
5823
5909
  padding?: number;
5824
5910
  }
5825
- export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer;
5826
- export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer;
5827
- export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer;
5828
- export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer;
5911
+ export function publicEncrypt(public_key: string | RsaPublicKey, buffer: ArrayBufferView): Buffer;
5912
+ export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: ArrayBufferView): Buffer;
5913
+ export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: ArrayBufferView): Buffer;
5914
+ export function publicDecrypt(public_key: string | RsaPublicKey, buffer: ArrayBufferView): Buffer;
5829
5915
  export function getCiphers(): string[];
5830
5916
  export function getCurves(): string[];
5831
5917
  export function getHashes(): string[];
5832
- export interface ECDH {
5833
- convertKey(key: string | Buffer /*| TypedArray*/ | DataView, curve: string, inputEncoding?: string, outputEncoding?: string, format?: string): Buffer | string;
5918
+ export class ECDH {
5919
+ static convertKey(key: string | ArrayBufferView, curve: string, inputEncoding?: HexBase64Latin1Encoding, outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string;
5834
5920
  generateKeys(): Buffer;
5835
5921
  generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
5836
- computeSecret(other_public_key: Buffer): Buffer;
5922
+ computeSecret(other_public_key: ArrayBufferView): Buffer;
5837
5923
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
5924
+ computeSecret(other_public_key: ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
5838
5925
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
5839
5926
  getPrivateKey(): Buffer;
5840
5927
  getPrivateKey(encoding: HexBase64Latin1Encoding): string;
5841
5928
  getPublicKey(): Buffer;
5842
5929
  getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
5843
- setPrivateKey(private_key: Buffer): void;
5930
+ setPrivateKey(private_key: ArrayBufferView): void;
5844
5931
  setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
5845
5932
  }
5846
5933
  export function createECDH(curve_name: string): ECDH;
5847
- export function timingSafeEqual(a: Buffer, b: Buffer): boolean;
5934
+ export function timingSafeEqual(a: ArrayBufferView, b: ArrayBufferView): boolean;
5848
5935
  /** @deprecated since v10.0.0 */
5849
5936
  export var DEFAULT_ENCODING: string;
5850
5937
  }
@@ -6849,12 +6936,15 @@ declare module "http2" {
6849
6936
  import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
6850
6937
  export { OutgoingHttpHeaders } from "http";
6851
6938
 
6939
+ export interface IncomingHttpStatusHeader {
6940
+ ":status"?: number;
6941
+ }
6942
+
6852
6943
  export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
6853
- ':path'?: string;
6854
- ':method'?: string;
6855
- ':status'?: string;
6856
- ':authority'?: string;
6857
- ':scheme'?: string;
6944
+ ":path"?: string;
6945
+ ":method"?: string;
6946
+ ":authority"?: string;
6947
+ ":scheme"?: string;
6858
6948
  }
6859
6949
 
6860
6950
  // Http2Stream
@@ -7001,34 +7091,34 @@ declare module "http2" {
7001
7091
 
7002
7092
  export interface ClientHttp2Stream extends Http2Stream {
7003
7093
  addListener(event: string, listener: (...args: any[]) => void): this;
7004
- addListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7094
+ addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7005
7095
  addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7006
- addListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7096
+ addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7007
7097
 
7008
7098
  emit(event: string | symbol, ...args: any[]): boolean;
7009
- emit(event: "headers", headers: IncomingHttpHeaders, flags: number): boolean;
7099
+ emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
7010
7100
  emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
7011
- emit(event: "response", headers: IncomingHttpHeaders, flags: number): boolean;
7101
+ emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
7012
7102
 
7013
7103
  on(event: string, listener: (...args: any[]) => void): this;
7014
- on(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7104
+ on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7015
7105
  on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7016
- on(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7106
+ on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7017
7107
 
7018
7108
  once(event: string, listener: (...args: any[]) => void): this;
7019
- once(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7109
+ once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7020
7110
  once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7021
- once(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7111
+ once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7022
7112
 
7023
7113
  prependListener(event: string, listener: (...args: any[]) => void): this;
7024
- prependListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7114
+ prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7025
7115
  prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7026
- prependListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7116
+ prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7027
7117
 
7028
7118
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
7029
- prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7119
+ prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7030
7120
  prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7031
- prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
7121
+ prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7032
7122
  }
7033
7123
 
7034
7124
  export interface ServerHttp2Stream extends Http2Stream {
@@ -7156,32 +7246,32 @@ declare module "http2" {
7156
7246
  addListener(event: string, listener: (...args: any[]) => void): this;
7157
7247
  addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
7158
7248
  addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
7159
- addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
7249
+ addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7160
7250
 
7161
7251
  emit(event: string | symbol, ...args: any[]): boolean;
7162
7252
  emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
7163
7253
  emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
7164
- emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
7254
+ emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
7165
7255
 
7166
7256
  on(event: string, listener: (...args: any[]) => void): this;
7167
7257
  on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
7168
7258
  on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
7169
- on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
7259
+ on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7170
7260
 
7171
7261
  once(event: string, listener: (...args: any[]) => void): this;
7172
7262
  once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
7173
7263
  once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
7174
- once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
7264
+ once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7175
7265
 
7176
7266
  prependListener(event: string, listener: (...args: any[]) => void): this;
7177
7267
  prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
7178
7268
  prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
7179
- prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
7269
+ prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7180
7270
 
7181
7271
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
7182
7272
  prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
7183
7273
  prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
7184
- prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
7274
+ prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
7185
7275
  }
7186
7276
 
7187
7277
  export interface AlternativeServiceOptions {
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "10.3.2",
3
+ "version": "10.3.6",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -121,6 +121,16 @@
121
121
  "name": "Lishude",
122
122
  "url": "https://github.com/islishude",
123
123
  "githubUsername": "islishude"
124
+ },
125
+ {
126
+ "name": "Andrew Makarov",
127
+ "url": "https://github.com/r3nya",
128
+ "githubUsername": "r3nya"
129
+ },
130
+ {
131
+ "name": "Zane Hannan AU",
132
+ "url": "https://github.com/ZaneHannanAU",
133
+ "githubUsername": "ZaneHannanAU"
124
134
  }
125
135
  ],
126
136
  "main": "",
@@ -130,6 +140,6 @@
130
140
  },
131
141
  "scripts": {},
132
142
  "dependencies": {},
133
- "typesPublisherContentHash": "b1d220a18c121070c15fca538e96c8c74d5653c589a6002179905c65da932a8d",
143
+ "typesPublisherContentHash": "9174b898ccb7fcb7c175ce20b89da415cbaeaca69278618ae978c3466158fec9",
134
144
  "typeScriptVersion": "2.0"
135
145
  }