@types/node 14.14.13 → 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.
Files changed (3) hide show
  1. node/README.md +1 -1
  2. node/crypto.d.ts +40 -37
  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: Sat, 12 Dec 2020 17:18:07 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/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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.13",
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": "2d2baa6ba176af581ab0526fbd1ecf8426794040c566cca82cf3f03d6778229f",
249
+ "typesPublisherContentHash": "87bafec1f2d07e2ebc3193f86320fcf28d1ecc5051ef2b471642be6e8b29ed90",
250
250
  "typeScriptVersion": "3.3"
251
251
  }