@types/node 10.5.0 → 10.5.4

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 +1 -1
  2. node/index.d.ts +93 -86
  3. node/package.json +2 -2
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: Wed, 27 Jun 2018 18:10:43 GMT
11
+ * Last updated: Sat, 28 Jul 2018 00:44:17 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
 
node/index.d.ts CHANGED
@@ -414,10 +414,10 @@ declare var Buffer: {
414
414
  * Gives the actual byte length of a string. encoding defaults to 'utf8'.
415
415
  * This is not the same as String.prototype.length since that returns the number of characters in a string.
416
416
  *
417
- * @param string string to test. (TypedArray is also allowed, but it is only available starting ES2017)
417
+ * @param string string to test.
418
418
  * @param encoding encoding used to evaluate (defaults to 'utf8')
419
419
  */
420
- byteLength(string: string | ArrayBuffer | ArrayBufferView, encoding?: string): number;
420
+ byteLength(string: string | NodeJS.TypedArray | DataView | ArrayBuffer /*| SharedArrayBuffer */, encoding?: string): number;
421
421
  /**
422
422
  * Returns a buffer which is the result of concatenating all the buffers in the list together.
423
423
  *
@@ -694,7 +694,7 @@ declare namespace NodeJS {
694
694
  columns?: number;
695
695
  rows?: number;
696
696
  _write(chunk: any, encoding: string, callback: Function): void;
697
- _destroy(err: Error, callback: Function): void;
697
+ _destroy(err: Error | null, callback: Function): void;
698
698
  _final(callback: Function): void;
699
699
  setDefaultEncoding(encoding: string): this;
700
700
  cork(): void;
@@ -707,7 +707,7 @@ declare namespace NodeJS {
707
707
  isRaw?: boolean;
708
708
  setRawMode?(mode: boolean): void;
709
709
  _read(size: number): void;
710
- _destroy(err: Error, callback: Function): void;
710
+ _destroy(err: Error | null, callback: Function): void;
711
711
  push(chunk: any, encoding?: string): boolean;
712
712
  destroy(error?: Error): void;
713
713
  }
@@ -977,6 +977,8 @@ declare namespace NodeJS {
977
977
 
978
978
  constructor(id: string, parent?: Module);
979
979
  }
980
+
981
+ type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
980
982
  }
981
983
 
982
984
  interface IterableIterator<T> { }
@@ -1249,6 +1251,7 @@ declare module "http" {
1249
1251
  }
1250
1252
 
1251
1253
  export class Agent {
1254
+ maxFreeSockets: number;
1252
1255
  maxSockets: number;
1253
1256
  sockets: any;
1254
1257
  requests: any;
@@ -1551,7 +1554,7 @@ declare module "zlib" {
1551
1554
  level?: number; // compression only
1552
1555
  memLevel?: number; // compression only
1553
1556
  strategy?: number; // compression only
1554
- dictionary?: any; // deflate/inflate only, empty dictionary by default
1557
+ dictionary?: Buffer | NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
1555
1558
  }
1556
1559
 
1557
1560
  export interface Zlib {
@@ -1584,7 +1587,7 @@ declare module "zlib" {
1584
1587
  export function createInflateRaw(options?: ZlibOptions): InflateRaw;
1585
1588
  export function createUnzip(options?: ZlibOptions): Unzip;
1586
1589
 
1587
- type InputType = string | Buffer | DataView | ArrayBuffer /* | TypedArray */;
1590
+ type InputType = string | Buffer | DataView | ArrayBuffer | NodeJS.TypedArray;
1588
1591
  export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
1589
1592
  export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
1590
1593
  export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
@@ -4471,6 +4474,17 @@ declare module "fs" {
4471
4474
  /** Constant for fs.access(). File can be executed by the calling process. */
4472
4475
  export const X_OK: number;
4473
4476
 
4477
+ // File Copy Constants
4478
+
4479
+ /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */
4480
+ export const COPYFILE_EXCL: number;
4481
+
4482
+ /** Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. */
4483
+ export const COPYFILE_FICLONE: number;
4484
+
4485
+ /** Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then the operation will fail with an error. */
4486
+ export const COPYFILE_FICLONE_FORCE: number;
4487
+
4474
4488
  // File Open Constants
4475
4489
 
4476
4490
  /** Constant for fs.open(). Flag indicating to open a file for read-only access. */
@@ -4584,9 +4598,6 @@ declare module "fs" {
4584
4598
 
4585
4599
  /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
4586
4600
  export const S_IXOTH: number;
4587
-
4588
- /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */
4589
- export const COPYFILE_EXCL: number;
4590
4601
  }
4591
4602
 
4592
4603
  /**
@@ -5731,9 +5742,9 @@ declare module "crypto" {
5731
5742
  import * as stream from "stream";
5732
5743
 
5733
5744
  export interface Certificate {
5734
- exportChallenge(spkac: string | ArrayBufferView): Buffer;
5735
- exportPublicKey(spkac: string | ArrayBufferView): Buffer;
5736
- verifySpkac(spkac: ArrayBufferView): boolean;
5745
+ exportChallenge(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
5746
+ exportPublicKey(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
5747
+ verifySpkac(spkac: Buffer | NodeJS.TypedArray | DataView): boolean;
5737
5748
  }
5738
5749
  export var Certificate: {
5739
5750
  new(): Certificate;
@@ -5755,7 +5766,7 @@ declare module "crypto" {
5755
5766
  export interface Credentials { context?: any; }
5756
5767
  export function createCredentials(details: CredentialDetails): Credentials;
5757
5768
  export function createHash(algorithm: string, options?: stream.TransformOptions): Hash;
5758
- export function createHmac(algorithm: string, key: string | ArrayBufferView, options?: stream.TransformOptions): Hmac;
5769
+ export function createHmac(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Hmac;
5759
5770
 
5760
5771
  type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
5761
5772
  type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
@@ -5764,13 +5775,13 @@ declare module "crypto" {
5764
5775
  type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
5765
5776
 
5766
5777
  export interface Hash extends NodeJS.ReadWriteStream {
5767
- update(data: string | ArrayBufferView): Hash;
5778
+ update(data: string | Buffer | NodeJS.TypedArray | DataView): Hash;
5768
5779
  update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
5769
5780
  digest(): Buffer;
5770
5781
  digest(encoding: HexBase64Latin1Encoding): string;
5771
5782
  }
5772
5783
  export interface Hmac extends NodeJS.ReadWriteStream {
5773
- update(data: string | ArrayBufferView): Hmac;
5784
+ update(data: string | Buffer | NodeJS.TypedArray | DataView): Hmac;
5774
5785
  update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
5775
5786
  digest(): Buffer;
5776
5787
  digest(encoding: HexBase64Latin1Encoding): string;
@@ -5784,19 +5795,19 @@ declare module "crypto" {
5784
5795
  authTagLength?: number;
5785
5796
  }
5786
5797
  /** @deprecated since v10.0.0 use createCipheriv() */
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;
5798
+ export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
5799
+ export function createCipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
5800
+ export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM;
5790
5801
 
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;
5802
+ export function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
5803
+ export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
5804
+ export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM;
5794
5805
 
5795
5806
  export interface Cipher extends NodeJS.ReadWriteStream {
5796
- update(data: string | ArrayBufferView): Buffer;
5807
+ update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
5797
5808
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
5798
- update(data: ArrayBufferView, output_encoding: HexBase64BinaryEncoding): string;
5799
- update(data: ArrayBufferView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
5809
+ update(data: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64BinaryEncoding): string;
5810
+ update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
5800
5811
  // second arg ignored
5801
5812
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
5802
5813
  final(): Buffer;
@@ -5814,62 +5825,62 @@ declare module "crypto" {
5814
5825
  getAuthTag(): Buffer;
5815
5826
  }
5816
5827
  /** @deprecated since v10.0.0 use createCipheriv() */
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;
5828
+ export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher;
5829
+ export function createDecipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM;
5830
+ export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM;
5820
5831
 
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;
5832
+ export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher;
5833
+ export function createDecipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM;
5834
+ export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM;
5824
5835
 
5825
5836
  export interface Decipher extends NodeJS.ReadWriteStream {
5826
- update(data: ArrayBufferView): Buffer;
5837
+ update(data: Buffer | NodeJS.TypedArray | DataView): Buffer;
5827
5838
  update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
5828
- update(data: ArrayBufferView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
5839
+ update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
5829
5840
  // second arg is ignored
5830
5841
  update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
5831
5842
  final(): Buffer;
5832
5843
  final(output_encoding: string): string;
5833
5844
  setAutoPadding(auto_padding?: boolean): this;
5834
- // setAuthTag(tag: ArrayBufferView): this;
5835
- // setAAD(buffer: ArrayBufferView): this; // docs say buffer view
5845
+ // setAuthTag(tag: Buffer | NodeJS.TypedArray | DataView): this;
5846
+ // setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this;
5836
5847
  }
5837
5848
  export interface DecipherCCM extends Decipher {
5838
- setAuthTag(buffer: ArrayBufferView, options: { plainTextLength: number }): this;
5839
- setAAD(buffer: ArrayBufferView): this; // docs say buffer view
5849
+ setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plainTextLength: number }): this;
5850
+ setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this;
5840
5851
  }
5841
5852
  export interface DecipherGCM extends Decipher {
5842
- setAuthTag(buffer: ArrayBufferView, options?: { plainTextLength: number }): this;
5843
- setAAD(buffer: ArrayBufferView): this; // docs say buffer view
5853
+ setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plainTextLength: number }): this;
5854
+ setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this;
5844
5855
  }
5845
5856
 
5846
5857
  export function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
5847
5858
  export interface Signer extends NodeJS.WritableStream {
5848
- update(data: string | ArrayBufferView): Signer;
5859
+ update(data: string | Buffer | NodeJS.TypedArray | DataView): Signer;
5849
5860
  update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
5850
5861
  sign(private_key: string | { key: string; passphrase: string }): Buffer;
5851
5862
  sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
5852
5863
  }
5853
5864
  export function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
5854
5865
  export interface Verify extends NodeJS.WritableStream {
5855
- update(data: string | ArrayBufferView): Verify;
5866
+ update(data: string | Buffer | NodeJS.TypedArray | DataView): Verify;
5856
5867
  update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
5857
- verify(object: string | Object, signature: ArrayBufferView): boolean;
5868
+ verify(object: string | Object, signature: Buffer | NodeJS.TypedArray | DataView): boolean;
5858
5869
  verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
5859
5870
  // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
5860
5871
  // The signature field accepts a TypedArray type, but it is only available starting ES2017
5861
5872
  }
5862
- export function createDiffieHellman(prime_length: number, generator?: number | ArrayBufferView): DiffieHellman;
5863
- export function createDiffieHellman(prime: ArrayBufferView): DiffieHellman;
5873
+ export function createDiffieHellman(prime_length: number, generator?: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
5874
+ export function createDiffieHellman(prime: Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
5864
5875
  export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
5865
- export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | ArrayBufferView): DiffieHellman;
5876
+ export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
5866
5877
  export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
5867
5878
  export interface DiffieHellman {
5868
5879
  generateKeys(): Buffer;
5869
5880
  generateKeys(encoding: HexBase64Latin1Encoding): string;
5870
- computeSecret(other_public_key: ArrayBufferView): Buffer;
5881
+ computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer;
5871
5882
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
5872
- computeSecret(other_public_key: ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
5883
+ computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string;
5873
5884
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
5874
5885
  getPrime(): Buffer;
5875
5886
  getPrime(encoding: HexBase64Latin1Encoding): string;
@@ -5879,25 +5890,25 @@ declare module "crypto" {
5879
5890
  getPublicKey(encoding: HexBase64Latin1Encoding): string;
5880
5891
  getPrivateKey(): Buffer;
5881
5892
  getPrivateKey(encoding: HexBase64Latin1Encoding): string;
5882
- setPublicKey(public_key: ArrayBufferView): void;
5893
+ setPublicKey(public_key: Buffer | NodeJS.TypedArray | DataView): void;
5883
5894
  setPublicKey(public_key: string, encoding: string): void;
5884
- setPrivateKey(private_key: ArrayBufferView): void;
5895
+ setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void;
5885
5896
  setPrivateKey(private_key: string, encoding: string): void;
5886
5897
  verifyError: number;
5887
5898
  }
5888
5899
  export function getDiffieHellman(group_name: string): DiffieHellman;
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;
5900
+ export function pbkdf2(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void;
5901
+ export function pbkdf2Sync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string): Buffer;
5891
5902
 
5892
5903
  export function randomBytes(size: number): Buffer;
5893
5904
  export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
5894
5905
  export function pseudoRandomBytes(size: number): Buffer;
5895
5906
  export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
5896
5907
 
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;
5908
+ export function randomFillSync<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset?: number, size?: number): T;
5909
+ export function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
5910
+ export function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
5911
+ export function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
5901
5912
 
5902
5913
  export interface ScryptOptions {
5903
5914
  N?: number;
@@ -5905,9 +5916,9 @@ declare module "crypto" {
5905
5916
  p?: number;
5906
5917
  maxmem?: number;
5907
5918
  }
5908
- export function scrypt(password: string | ArrayBufferView, salt: string | ArrayBufferView, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void;
5909
- export function scrypt(password: string | ArrayBufferView, salt: string | ArrayBufferView, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void;
5910
- export function scryptSync(password: string | ArrayBufferView, salt: string | ArrayBufferView, keylen: number, options?: ScryptOptions): Buffer;
5919
+ export function scrypt(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void;
5920
+ export function scrypt(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void;
5921
+ export function scryptSync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options?: ScryptOptions): Buffer;
5911
5922
 
5912
5923
  export interface RsaPublicKey {
5913
5924
  key: string;
@@ -5918,30 +5929,30 @@ declare module "crypto" {
5918
5929
  passphrase?: string;
5919
5930
  padding?: number;
5920
5931
  }
5921
- export function publicEncrypt(public_key: string | RsaPublicKey, buffer: ArrayBufferView): Buffer;
5922
- export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: ArrayBufferView): Buffer;
5923
- export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: ArrayBufferView): Buffer;
5924
- export function publicDecrypt(public_key: string | RsaPublicKey, buffer: ArrayBufferView): Buffer;
5932
+ export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
5933
+ export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
5934
+ export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
5935
+ export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
5925
5936
  export function getCiphers(): string[];
5926
5937
  export function getCurves(): string[];
5927
5938
  export function getHashes(): string[];
5928
5939
  export class ECDH {
5929
- static convertKey(key: string | ArrayBufferView, curve: string, inputEncoding?: HexBase64Latin1Encoding, outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string;
5940
+ static convertKey(key: string | Buffer | NodeJS.TypedArray | DataView, curve: string, inputEncoding?: HexBase64Latin1Encoding, outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string;
5930
5941
  generateKeys(): Buffer;
5931
5942
  generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
5932
- computeSecret(other_public_key: ArrayBufferView): Buffer;
5943
+ computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer;
5933
5944
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
5934
- computeSecret(other_public_key: ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
5945
+ computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string;
5935
5946
  computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
5936
5947
  getPrivateKey(): Buffer;
5937
5948
  getPrivateKey(encoding: HexBase64Latin1Encoding): string;
5938
5949
  getPublicKey(): Buffer;
5939
5950
  getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
5940
- setPrivateKey(private_key: ArrayBufferView): void;
5951
+ setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void;
5941
5952
  setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
5942
5953
  }
5943
5954
  export function createECDH(curve_name: string): ECDH;
5944
- export function timingSafeEqual(a: ArrayBufferView, b: ArrayBufferView): boolean;
5955
+ export function timingSafeEqual(a: Buffer | NodeJS.TypedArray | DataView, b: Buffer | NodeJS.TypedArray | DataView): boolean;
5945
5956
  /** @deprecated since v10.0.0 */
5946
5957
  export var DEFAULT_ENCODING: string;
5947
5958
  }
@@ -5961,7 +5972,7 @@ declare module "stream" {
5961
5972
  encoding?: string;
5962
5973
  objectMode?: boolean;
5963
5974
  read?: (this: Readable, size?: number) => any;
5964
- destroy?: (error?: Error) => any;
5975
+ destroy?: (error: Error | null, callback: (error?: Error) => void) => void;
5965
5976
  }
5966
5977
 
5967
5978
  export class Readable extends Stream implements NodeJS.ReadableStream {
@@ -5979,7 +5990,7 @@ declare module "stream" {
5979
5990
  unshift(chunk: any): void;
5980
5991
  wrap(oldStream: NodeJS.ReadableStream): this;
5981
5992
  push(chunk: any, encoding?: string): boolean;
5982
- _destroy(err: Error, callback: Function): void;
5993
+ _destroy(error: Error | null, callback: (error?: Error) => void): void;
5983
5994
  destroy(error?: Error): void;
5984
5995
 
5985
5996
  /**
@@ -6049,7 +6060,7 @@ declare module "stream" {
6049
6060
  objectMode?: boolean;
6050
6061
  write?: (chunk: any, encoding: string, callback: Function) => any;
6051
6062
  writev?: (chunks: Array<{ chunk: any, encoding: string }>, callback: Function) => any;
6052
- destroy?: (error?: Error) => any;
6063
+ destroy?: (error: Error | null, callback: (error?: Error) => void) => void;
6053
6064
  final?: (callback: (error?: Error) => void) => void;
6054
6065
  }
6055
6066
 
@@ -6060,7 +6071,7 @@ declare module "stream" {
6060
6071
  constructor(opts?: WritableOptions);
6061
6072
  _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
6062
6073
  _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void;
6063
- _destroy(err: Error, callback: Function): void;
6074
+ _destroy(error: Error | null, callback: (error?: Error) => void): void;
6064
6075
  _final(callback: Function): void;
6065
6076
  write(chunk: any, cb?: Function): boolean;
6066
6077
  write(chunk: any, encoding?: string, cb?: Function): boolean;
@@ -6153,7 +6164,7 @@ declare module "stream" {
6153
6164
  constructor(opts?: DuplexOptions);
6154
6165
  _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
6155
6166
  _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void;
6156
- _destroy(err: Error, callback: Function): void;
6167
+ _destroy(error: Error | null, callback: (error?: Error) => void): void;
6157
6168
  _final(callback: Function): void;
6158
6169
  write(chunk: any, cb?: Function): boolean;
6159
6170
  write(chunk: any, encoding?: string, cb?: Function): boolean;
@@ -6324,7 +6335,7 @@ declare module "util" {
6324
6335
  export function isSharedArrayBuffer(object: any): boolean;
6325
6336
  export function isStringObject(object: any): boolean;
6326
6337
  export function isSymbolObject(object: any): boolean;
6327
- export function isTypedArray(object: any): object is Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
6338
+ export function isTypedArray(object: any): object is NodeJS.TypedArray;
6328
6339
  export function isUint8Array(object: any): object is Uint8Array;
6329
6340
  export function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
6330
6341
  export function isUint16Array(object: any): object is Uint16Array;
@@ -6343,19 +6354,7 @@ declare module "util" {
6343
6354
  options?: { fatal?: boolean; ignoreBOM?: boolean }
6344
6355
  );
6345
6356
  decode(
6346
- input?:
6347
- Int8Array
6348
- | Int16Array
6349
- | Int32Array
6350
- | Uint8Array
6351
- | Uint16Array
6352
- | Uint32Array
6353
- | Uint8ClampedArray
6354
- | Float32Array
6355
- | Float64Array
6356
- | DataView
6357
- | ArrayBuffer
6358
- | null,
6357
+ input?: NodeJS.TypedArray | DataView | ArrayBuffer | null,
6359
6358
  options?: { stream?: boolean }
6360
6359
  ): string;
6361
6360
  }
@@ -6417,6 +6416,8 @@ declare module "assert" {
6417
6416
  export function rejects(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
6418
6417
  export function doesNotReject(block: Function | Promise<any>, message?: string): Promise<void>;
6419
6418
  export function doesNotReject(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
6419
+
6420
+ export var strict: typeof internal;
6420
6421
  }
6421
6422
 
6422
6423
  export = internal;
@@ -6700,6 +6701,9 @@ declare module "constants" {
6700
6701
  export var R_OK: number;
6701
6702
  export var W_OK: number;
6702
6703
  export var X_OK: number;
6704
+ export var COPYFILE_EXCL: number;
6705
+ export var COPYFILE_FICLONE: number;
6706
+ export var COPYFILE_FICLONE_FORCE: number;
6703
6707
  export var UV_UDP_REUSEADDR: number;
6704
6708
  export var SIGQUIT: number;
6705
6709
  export var SIGTRAP: number;
@@ -7177,13 +7181,16 @@ declare module "http2" {
7177
7181
  readonly alpnProtocol?: string;
7178
7182
  close(callback?: () => void): void;
7179
7183
  readonly closed: boolean;
7184
+ readonly connecting: boolean;
7180
7185
  destroy(error?: Error, code?: number): void;
7181
7186
  readonly destroyed: boolean;
7182
7187
  readonly encrypted?: boolean;
7183
- goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView /*| TypedArray*/): void;
7188
+ goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView | NodeJS.TypedArray): void;
7184
7189
  readonly localSettings: Settings;
7185
7190
  readonly originSet?: string[];
7186
7191
  readonly pendingSettingsAck: boolean;
7192
+ ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
7193
+ ping(payload: Buffer | DataView | NodeJS.TypedArray , callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
7187
7194
  ref(): void;
7188
7195
  readonly remoteSettings: Settings;
7189
7196
  rstStream(stream: Http2Stream, code?: number): void;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "10.5.0",
3
+ "version": "10.5.4",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -140,6 +140,6 @@
140
140
  },
141
141
  "scripts": {},
142
142
  "dependencies": {},
143
- "typesPublisherContentHash": "9119c3e2efe76f3f20f9027547aa8bd36c7883038dda3c1b39b4a58080cfdf2a",
143
+ "typesPublisherContentHash": "f5d750c92591244ab500cdeda02599e0c7f820d216b4a60e4e928994521837c3",
144
144
  "typeScriptVersion": "2.0"
145
145
  }