@types/node 14.6.3 → 14.6.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.
- node/README.md +1 -1
- node/package.json +2 -2
- node/ts3.1/crypto.d.ts +47 -3
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:
|
|
11
|
+
* Last updated: Thu, 03 Sep 2020 22:13:20 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`, `Symbol`
|
|
14
14
|
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "14.6.
|
|
3
|
+
"version": "14.6.4",
|
|
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": "
|
|
249
|
+
"typesPublisherContentHash": "5fc739401176088207c6f60e9d6b833ad5ae4b6a6edc1548b9665013878f8ac0",
|
|
250
250
|
"typeScriptVersion": "3.1"
|
|
251
251
|
}
|
node/ts3.1/crypto.d.ts
CHANGED
|
@@ -431,7 +431,7 @@ declare module "crypto" {
|
|
|
431
431
|
/** @deprecated since v10.0.0 */
|
|
432
432
|
const DEFAULT_ENCODING: BufferEncoding;
|
|
433
433
|
|
|
434
|
-
type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519';
|
|
434
|
+
type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'x25519';
|
|
435
435
|
type KeyFormat = 'pem' | 'der';
|
|
436
436
|
|
|
437
437
|
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
@@ -451,6 +451,12 @@ declare module "crypto" {
|
|
|
451
451
|
*/
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
+
interface X25519KeyPairKeyObjectOptions {
|
|
455
|
+
/**
|
|
456
|
+
* No options.
|
|
457
|
+
*/
|
|
458
|
+
}
|
|
459
|
+
|
|
454
460
|
interface ECKeyPairKeyObjectOptions {
|
|
455
461
|
/**
|
|
456
462
|
* Name of the curve to use.
|
|
@@ -537,11 +543,21 @@ declare module "crypto" {
|
|
|
537
543
|
|
|
538
544
|
interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
539
545
|
publicKeyEncoding: {
|
|
540
|
-
type: '
|
|
546
|
+
type: 'spki';
|
|
541
547
|
format: PubF;
|
|
542
548
|
};
|
|
543
549
|
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
544
|
-
type: '
|
|
550
|
+
type: 'pkcs8';
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
555
|
+
publicKeyEncoding: {
|
|
556
|
+
type: 'spki';
|
|
557
|
+
format: PubF;
|
|
558
|
+
};
|
|
559
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
560
|
+
type: 'pkcs8';
|
|
545
561
|
};
|
|
546
562
|
}
|
|
547
563
|
|
|
@@ -574,6 +590,12 @@ declare module "crypto" {
|
|
|
574
590
|
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
575
591
|
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
576
592
|
|
|
593
|
+
function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
|
594
|
+
function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
|
595
|
+
function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
|
596
|
+
function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
597
|
+
function generateKeyPairSync(type: 'x25519', options: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
|
598
|
+
|
|
577
599
|
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
|
578
600
|
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
|
579
601
|
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
|
@@ -598,6 +620,12 @@ declare module "crypto" {
|
|
|
598
620
|
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
|
599
621
|
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
|
600
622
|
|
|
623
|
+
function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
|
624
|
+
function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
|
625
|
+
function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
|
626
|
+
function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
|
627
|
+
function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
|
628
|
+
|
|
601
629
|
namespace generateKeyPair {
|
|
602
630
|
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
|
603
631
|
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
|
@@ -622,6 +650,12 @@ declare module "crypto" {
|
|
|
622
650
|
function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
|
623
651
|
function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
|
624
652
|
function __promisify__(type: "ed25519", options: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
653
|
+
|
|
654
|
+
function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
|
655
|
+
function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
|
656
|
+
function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
|
657
|
+
function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
|
658
|
+
function __promisify__(type: "x25519", options: X25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
|
625
659
|
}
|
|
626
660
|
|
|
627
661
|
/**
|
|
@@ -646,4 +680,14 @@ declare module "crypto" {
|
|
|
646
680
|
* passed to [`crypto.createPublicKey()`][].
|
|
647
681
|
*/
|
|
648
682
|
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyWithOptions, signature: NodeJS.ArrayBufferView): boolean;
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Computes the Diffie-Hellman secret based on a privateKey and a publicKey.
|
|
686
|
+
* Both keys must have the same asymmetricKeyType, which must be one of
|
|
687
|
+
* 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES).
|
|
688
|
+
*/
|
|
689
|
+
function diffieHellman(options: {
|
|
690
|
+
privateKey: KeyObject;
|
|
691
|
+
publicKey: KeyObject
|
|
692
|
+
}): Buffer;
|
|
649
693
|
}
|