@types/node 14.14.10 → 14.14.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 25 Nov 2020 06:26:11 GMT
11
+ * Last updated: Tue, 15 Dec 2020 16:22:53 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/assert.d.ts CHANGED
@@ -21,6 +21,7 @@ declare module 'assert' {
21
21
  /** The `operator` property on the error instance. */
22
22
  operator?: string;
23
23
  /** If provided, the generated stack trace omits frames before this function. */
24
+ // tslint:disable-next-line:ban-types
24
25
  stackStartFn?: Function;
25
26
  });
26
27
  }
@@ -52,6 +53,7 @@ declare module 'assert' {
52
53
  expected: any,
53
54
  message?: string | Error,
54
55
  operator?: string,
56
+ // tslint:disable-next-line:ban-types
55
57
  stackStartFn?: Function,
56
58
  ): never;
57
59
  function ok(value: any, message?: string | Error): asserts value;
@@ -71,7 +73,7 @@ declare module 'assert' {
71
73
  function throws(block: () => any, message?: string | Error): void;
72
74
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
75
  function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
76
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75
77
 
76
78
  function ifError(value: any): asserts value is null | undefined;
77
79
 
@@ -84,7 +86,7 @@ declare module 'assert' {
84
86
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85
87
  function doesNotReject(
86
88
  block: (() => Promise<any>) | Promise<any>,
87
- error: RegExp | Function,
89
+ error: AssertPredicate,
88
90
  message?: string | Error,
89
91
  ): Promise<void>;
90
92
 
node/crypto.d.ts CHANGED
@@ -120,26 +120,29 @@ declare module "crypto" {
120
120
  function createHash(algorithm: string, options?: HashOptions): Hash;
121
121
  function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
122
122
 
123
- type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
124
- type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
125
- type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";
126
- type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
123
+ // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
124
+ type BinaryToTextEncoding = "base64" | "hex";
125
+ type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
126
+ type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
127
+
128
+ type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
129
+
127
130
  type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
128
131
 
129
132
  class Hash extends stream.Transform {
130
133
  private constructor();
131
134
  copy(): Hash;
132
135
  update(data: BinaryLike): Hash;
133
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
136
+ update(data: string, input_encoding: Encoding): Hash;
134
137
  digest(): Buffer;
135
- digest(encoding: HexBase64Latin1Encoding): string;
138
+ digest(encoding: BinaryToTextEncoding): string;
136
139
  }
137
140
  class Hmac extends stream.Transform {
138
141
  private constructor();
139
142
  update(data: BinaryLike): Hmac;
140
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
143
+ update(data: string, input_encoding: Encoding): Hmac;
141
144
  digest(): Buffer;
142
- digest(encoding: HexBase64Latin1Encoding): string;
145
+ digest(encoding: BinaryToTextEncoding): string;
143
146
  }
144
147
 
145
148
  type KeyObjectType = 'secret' | 'public' | 'private';
@@ -204,9 +207,9 @@ declare module "crypto" {
204
207
  class Cipher extends stream.Transform {
205
208
  private constructor();
206
209
  update(data: BinaryLike): Buffer;
207
- update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
208
- update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
209
- update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string;
210
+ update(data: string, input_encoding: Encoding): Buffer;
211
+ update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: BinaryToTextEncoding): string;
212
+ update(data: string, input_encoding: Encoding | undefined, output_encoding: BinaryToTextEncoding): string;
210
213
  final(): Buffer;
211
214
  final(output_encoding: BufferEncoding): string;
212
215
  setAutoPadding(auto_padding?: boolean): this;
@@ -245,9 +248,9 @@ declare module "crypto" {
245
248
  class Decipher extends stream.Transform {
246
249
  private constructor();
247
250
  update(data: NodeJS.ArrayBufferView): Buffer;
248
- update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
249
- update(data: NodeJS.ArrayBufferView, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
250
- update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
251
+ update(data: string, input_encoding: BinaryToTextEncoding): Buffer;
252
+ update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string;
253
+ update(data: string, input_encoding: BinaryToTextEncoding | undefined, output_encoding: Encoding): string;
251
254
  final(): Buffer;
252
255
  final(output_encoding: BufferEncoding): string;
253
256
  setAutoPadding(auto_padding?: boolean): this;
@@ -310,9 +313,9 @@ declare module "crypto" {
310
313
  private constructor();
311
314
 
312
315
  update(data: BinaryLike): Signer;
313
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
316
+ update(data: string, input_encoding: Encoding): Signer;
314
317
  sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
315
- sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, output_format: HexBase64Latin1Encoding): string;
318
+ sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, output_format: BinaryToTextEncoding): string;
316
319
  }
317
320
 
318
321
  function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
@@ -320,33 +323,33 @@ declare module "crypto" {
320
323
  private constructor();
321
324
 
322
325
  update(data: BinaryLike): Verify;
323
- update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
326
+ update(data: string, input_encoding: Encoding): Verify;
324
327
  verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean;
325
- verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: HexBase64Latin1Encoding): boolean;
328
+ verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
326
329
  // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
327
330
  // The signature field accepts a TypedArray type, but it is only available starting ES2017
328
331
  }
329
332
  function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
330
333
  function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
331
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
332
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
333
- function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
334
+ function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding): DiffieHellman;
335
+ function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
336
+ function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding, generator: string, generator_encoding: BinaryToTextEncoding): DiffieHellman;
334
337
  class DiffieHellman {
335
338
  private constructor();
336
339
  generateKeys(): Buffer;
337
- generateKeys(encoding: HexBase64Latin1Encoding): string;
340
+ generateKeys(encoding: BinaryToTextEncoding): string;
338
341
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
339
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
340
- computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
341
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
342
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
343
+ computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
344
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding, output_encoding: BinaryToTextEncoding): string;
342
345
  getPrime(): Buffer;
343
- getPrime(encoding: HexBase64Latin1Encoding): string;
346
+ getPrime(encoding: BinaryToTextEncoding): string;
344
347
  getGenerator(): Buffer;
345
- getGenerator(encoding: HexBase64Latin1Encoding): string;
348
+ getGenerator(encoding: BinaryToTextEncoding): string;
346
349
  getPublicKey(): Buffer;
347
- getPublicKey(encoding: HexBase64Latin1Encoding): string;
350
+ getPublicKey(encoding: BinaryToTextEncoding): string;
348
351
  getPrivateKey(): Buffer;
349
- getPrivateKey(encoding: HexBase64Latin1Encoding): string;
352
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
350
353
  setPublicKey(public_key: NodeJS.ArrayBufferView): void;
351
354
  setPublicKey(public_key: string, encoding: BufferEncoding): void;
352
355
  setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
@@ -426,22 +429,22 @@ declare module "crypto" {
426
429
  static convertKey(
427
430
  key: BinaryLike,
428
431
  curve: string,
429
- inputEncoding?: HexBase64Latin1Encoding,
432
+ inputEncoding?: BinaryToTextEncoding,
430
433
  outputEncoding?: "latin1" | "hex" | "base64",
431
434
  format?: "uncompressed" | "compressed" | "hybrid",
432
435
  ): Buffer | string;
433
436
  generateKeys(): Buffer;
434
- generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
437
+ generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
435
438
  computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
436
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
437
- computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
438
- computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
439
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
440
+ computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
441
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding, output_encoding: BinaryToTextEncoding): string;
439
442
  getPrivateKey(): Buffer;
440
- getPrivateKey(encoding: HexBase64Latin1Encoding): string;
443
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
441
444
  getPublicKey(): Buffer;
442
- getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
445
+ getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
443
446
  setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
444
- setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
447
+ setPrivateKey(private_key: string, encoding: BinaryToTextEncoding): void;
445
448
  }
446
449
  function createECDH(curve_name: string): ECDH;
447
450
  function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
node/globals.d.ts CHANGED
@@ -73,6 +73,8 @@ declare var exports: any;
73
73
  // Buffer class
74
74
  type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
75
75
 
76
+ type WithImplicitCoercion<T> = T | { valueOf(): T };
77
+
76
78
  /**
77
79
  * Raw data is stored in instances of the Buffer class.
78
80
  * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
@@ -132,25 +134,19 @@ declare class Buffer extends Uint8Array {
132
134
  *
133
135
  * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
134
136
  */
135
- static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
137
+ static from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
136
138
  /**
137
139
  * Creates a new Buffer using the passed {data}
138
140
  * @param data data to create a new Buffer
139
141
  */
140
- static from(data: ReadonlyArray<number>): Buffer;
141
- static from(data: Uint8Array): Buffer;
142
- /**
143
- * Creates a new buffer containing the coerced value of an object
144
- * A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
145
- * @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
146
- */
147
- static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
142
+ static from(data: Uint8Array | ReadonlyArray<number>): Buffer;
143
+ static from(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>): Buffer;
148
144
  /**
149
145
  * Creates a new Buffer containing the given JavaScript string {str}.
150
146
  * If provided, the {encoding} parameter identifies the character encoding.
151
147
  * If not provided, {encoding} defaults to 'utf8'.
152
148
  */
153
- static from(str: string, encoding?: BufferEncoding): Buffer;
149
+ static from(str: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer;
154
150
  /**
155
151
  * Creates a new Buffer using the passed {data}
156
152
  * @param values to create a new Buffer
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.10",
3
+ "version": "14.14.14",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -246,6 +246,6 @@
246
246
  },
247
247
  "scripts": {},
248
248
  "dependencies": {},
249
- "typesPublisherContentHash": "62f0f6cb4bd82f8d2c0ab046ed00f0e79c63f5e06cb3225e5749fd2b0bfe94ca",
249
+ "typesPublisherContentHash": "87bafec1f2d07e2ebc3193f86320fcf28d1ecc5051ef2b471642be6e8b29ed90",
250
250
  "typeScriptVersion": "3.3"
251
251
  }
node/tls.d.ts CHANGED
@@ -436,7 +436,7 @@ declare module "tls" {
436
436
 
437
437
  interface PSKCallbackNegotation {
438
438
  psk: DataView | NodeJS.TypedArray;
439
- identitty: string;
439
+ identity: string;
440
440
  }
441
441
 
442
442
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
node/ts3.4/assert.d.ts CHANGED
@@ -21,6 +21,7 @@ declare module 'assert' {
21
21
  /** The `operator` property on the error instance. */
22
22
  operator?: string;
23
23
  /** If provided, the generated stack trace omits frames before this function. */
24
+ // tslint:disable-next-line:ban-types
24
25
  stackStartFn?: Function;
25
26
  });
26
27
  }
@@ -52,6 +53,7 @@ declare module 'assert' {
52
53
  expected: any,
53
54
  message?: string | Error,
54
55
  operator?: string,
56
+ // tslint:disable-next-line:ban-types
55
57
  stackStartFn?: Function,
56
58
  ): never;
57
59
  function ok(value: any, message?: string | Error): void;
@@ -71,7 +73,7 @@ declare module 'assert' {
71
73
  function throws(block: () => any, message?: string | Error): void;
72
74
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
75
  function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
76
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75
77
 
76
78
  function ifError(value: any): void;
77
79
 
@@ -84,7 +86,7 @@ declare module 'assert' {
84
86
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85
87
  function doesNotReject(
86
88
  block: (() => Promise<any>) | Promise<any>,
87
- error: RegExp | Function,
89
+ error: AssertPredicate,
88
90
  message?: string | Error,
89
91
  ): Promise<void>;
90
92