@types/node 10.11.7 → 10.12.0
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/index.d.ts +131 -4
- node/package.json +3 -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:
|
|
11
|
+
* Last updated: Mon, 15 Oct 2018 23:08:10 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for Node.js 10.
|
|
1
|
+
// Type definitions for Node.js 10.12
|
|
2
2
|
// Project: http://nodejs.org/
|
|
3
3
|
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
4
|
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
|
@@ -493,6 +493,7 @@ declare namespace NodeJS {
|
|
|
493
493
|
maxArrayLength?: number | null;
|
|
494
494
|
breakLength?: number;
|
|
495
495
|
compact?: boolean;
|
|
496
|
+
sorted?: boolean | ((a: string, b: string) => number);
|
|
496
497
|
}
|
|
497
498
|
|
|
498
499
|
interface ConsoleConstructor {
|
|
@@ -691,6 +692,8 @@ declare namespace NodeJS {
|
|
|
691
692
|
"SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
|
692
693
|
"SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
|
|
693
694
|
|
|
695
|
+
type MultipleResolveType = 'resolve' | 'reject';
|
|
696
|
+
|
|
694
697
|
type BeforeExitListener = (code: number) => void;
|
|
695
698
|
type DisconnectListener = () => void;
|
|
696
699
|
type ExitListener = (code: number) => void;
|
|
@@ -702,6 +705,7 @@ declare namespace NodeJS {
|
|
|
702
705
|
type SignalsListener = (signal: Signals) => void;
|
|
703
706
|
type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
|
|
704
707
|
type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
|
|
708
|
+
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
|
|
705
709
|
|
|
706
710
|
interface Socket extends ReadWriteStream {
|
|
707
711
|
isTTY?: true;
|
|
@@ -845,6 +849,7 @@ declare namespace NodeJS {
|
|
|
845
849
|
addListener(event: Signals, listener: SignalsListener): this;
|
|
846
850
|
addListener(event: "newListener", listener: NewListenerListener): this;
|
|
847
851
|
addListener(event: "removeListener", listener: RemoveListenerListener): this;
|
|
852
|
+
addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
848
853
|
|
|
849
854
|
emit(event: "beforeExit", code: number): boolean;
|
|
850
855
|
emit(event: "disconnect"): boolean;
|
|
@@ -857,6 +862,7 @@ declare namespace NodeJS {
|
|
|
857
862
|
emit(event: Signals, signal: Signals): boolean;
|
|
858
863
|
emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
859
864
|
emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
|
|
865
|
+
emit(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
860
866
|
|
|
861
867
|
on(event: "beforeExit", listener: BeforeExitListener): this;
|
|
862
868
|
on(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -869,6 +875,7 @@ declare namespace NodeJS {
|
|
|
869
875
|
on(event: Signals, listener: SignalsListener): this;
|
|
870
876
|
on(event: "newListener", listener: NewListenerListener): this;
|
|
871
877
|
on(event: "removeListener", listener: RemoveListenerListener): this;
|
|
878
|
+
on(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
872
879
|
|
|
873
880
|
once(event: "beforeExit", listener: BeforeExitListener): this;
|
|
874
881
|
once(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -881,6 +888,7 @@ declare namespace NodeJS {
|
|
|
881
888
|
once(event: Signals, listener: SignalsListener): this;
|
|
882
889
|
once(event: "newListener", listener: NewListenerListener): this;
|
|
883
890
|
once(event: "removeListener", listener: RemoveListenerListener): this;
|
|
891
|
+
once(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
884
892
|
|
|
885
893
|
prependListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
886
894
|
prependListener(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -893,6 +901,7 @@ declare namespace NodeJS {
|
|
|
893
901
|
prependListener(event: Signals, listener: SignalsListener): this;
|
|
894
902
|
prependListener(event: "newListener", listener: NewListenerListener): this;
|
|
895
903
|
prependListener(event: "removeListener", listener: RemoveListenerListener): this;
|
|
904
|
+
prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
896
905
|
|
|
897
906
|
prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
898
907
|
prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -905,6 +914,7 @@ declare namespace NodeJS {
|
|
|
905
914
|
prependOnceListener(event: Signals, listener: SignalsListener): this;
|
|
906
915
|
prependOnceListener(event: "newListener", listener: NewListenerListener): this;
|
|
907
916
|
prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
|
|
917
|
+
prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
908
918
|
|
|
909
919
|
listeners(event: "beforeExit"): BeforeExitListener[];
|
|
910
920
|
listeners(event: "disconnect"): DisconnectListener[];
|
|
@@ -917,6 +927,7 @@ declare namespace NodeJS {
|
|
|
917
927
|
listeners(event: Signals): SignalsListener[];
|
|
918
928
|
listeners(event: "newListener"): NewListenerListener[];
|
|
919
929
|
listeners(event: "removeListener"): RemoveListenerListener[];
|
|
930
|
+
listeners(event: "multipleResolves"): MultipleResolveListener[];
|
|
920
931
|
}
|
|
921
932
|
|
|
922
933
|
interface Global {
|
|
@@ -1006,6 +1017,7 @@ declare namespace NodeJS {
|
|
|
1006
1017
|
class Module {
|
|
1007
1018
|
static runMain(): void;
|
|
1008
1019
|
static wrap(code: string): string;
|
|
1020
|
+
static createRequireFromPath(path: string): (path: string) => any;
|
|
1009
1021
|
static builtinModules: string[];
|
|
1010
1022
|
|
|
1011
1023
|
static Module: typeof Module;
|
|
@@ -2618,6 +2630,20 @@ declare module "url" {
|
|
|
2618
2630
|
function domainToASCII(domain: string): string;
|
|
2619
2631
|
function domainToUnicode(domain: string): string;
|
|
2620
2632
|
|
|
2633
|
+
/**
|
|
2634
|
+
* This function ensures the correct decodings of percent-encoded characters as
|
|
2635
|
+
* well as ensuring a cross-platform valid absolute path string.
|
|
2636
|
+
* @param url The file URL string or URL object to convert to a path.
|
|
2637
|
+
*/
|
|
2638
|
+
function fileURLToPath(url: string | URL): string;
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* This function ensures that path is resolved absolutely, and that the URL
|
|
2642
|
+
* control characters are correctly encoded when converting into a File URL.
|
|
2643
|
+
* @param url The path to convert to a File URL.
|
|
2644
|
+
*/
|
|
2645
|
+
function pathToFileURL(url: string): URL;
|
|
2646
|
+
|
|
2621
2647
|
interface URLFormatOptions {
|
|
2622
2648
|
auth?: boolean;
|
|
2623
2649
|
fragment?: boolean;
|
|
@@ -3994,12 +4020,25 @@ declare module "fs" {
|
|
|
3994
4020
|
*/
|
|
3995
4021
|
function rmdirSync(path: PathLike): void;
|
|
3996
4022
|
|
|
4023
|
+
export interface MakeDirectoryOptions {
|
|
4024
|
+
/**
|
|
4025
|
+
* Indicates whether parent folders should be created.
|
|
4026
|
+
* @default false
|
|
4027
|
+
*/
|
|
4028
|
+
recursive?: boolean;
|
|
4029
|
+
/**
|
|
4030
|
+
* A file mode. If a string is passed, it is parsed as an octal integer. If not specified
|
|
4031
|
+
* @default 0o777.
|
|
4032
|
+
*/
|
|
4033
|
+
mode?: number;
|
|
4034
|
+
}
|
|
4035
|
+
|
|
3997
4036
|
/**
|
|
3998
4037
|
* Asynchronous mkdir(2) - create a directory.
|
|
3999
4038
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
4000
4039
|
* @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
4001
4040
|
*/
|
|
4002
|
-
function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
|
4041
|
+
function mkdir(path: PathLike, mode: number | string | MakeDirectoryOptions | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
|
4003
4042
|
|
|
4004
4043
|
/**
|
|
4005
4044
|
* Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
|
|
@@ -4014,7 +4053,7 @@ declare module "fs" {
|
|
|
4014
4053
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
4015
4054
|
* @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
4016
4055
|
*/
|
|
4017
|
-
function __promisify__(path: PathLike, mode?: number | string | null): Promise<void>;
|
|
4056
|
+
function __promisify__(path: PathLike, mode?: number | string | MakeDirectoryOptions | null): Promise<void>;
|
|
4018
4057
|
}
|
|
4019
4058
|
|
|
4020
4059
|
/**
|
|
@@ -4022,7 +4061,7 @@ declare module "fs" {
|
|
|
4022
4061
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
4023
4062
|
* @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
|
4024
4063
|
*/
|
|
4025
|
-
function mkdirSync(path: PathLike, mode?: number | string | null): void;
|
|
4064
|
+
function mkdirSync(path: PathLike, mode?: number | string | MakeDirectoryOptions | null): void;
|
|
4026
4065
|
|
|
4027
4066
|
/**
|
|
4028
4067
|
* Asynchronously creates a unique temporary directory.
|
|
@@ -6349,6 +6388,88 @@ declare module "crypto" {
|
|
|
6349
6388
|
function timingSafeEqual(a: Buffer | NodeJS.TypedArray | DataView, b: Buffer | NodeJS.TypedArray | DataView): boolean;
|
|
6350
6389
|
/** @deprecated since v10.0.0 */
|
|
6351
6390
|
const DEFAULT_ENCODING: string;
|
|
6391
|
+
|
|
6392
|
+
export type KeyType = 'rsa' | 'dsa' | 'ec';
|
|
6393
|
+
export type KeyFormat = 'pem' | 'der';
|
|
6394
|
+
|
|
6395
|
+
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
|
6396
|
+
format: T;
|
|
6397
|
+
ciper: string;
|
|
6398
|
+
passphrase: string;
|
|
6399
|
+
}
|
|
6400
|
+
|
|
6401
|
+
interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
6402
|
+
/**
|
|
6403
|
+
* Key size in bits
|
|
6404
|
+
*/
|
|
6405
|
+
modulusLength: number;
|
|
6406
|
+
/**
|
|
6407
|
+
* @default 0x10001
|
|
6408
|
+
*/
|
|
6409
|
+
publicExponent?: number;
|
|
6410
|
+
|
|
6411
|
+
publicKeyEncoding: {
|
|
6412
|
+
type: 'pkcs1' | 'spki';
|
|
6413
|
+
format: PubF;
|
|
6414
|
+
};
|
|
6415
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
6416
|
+
type: 'pkcs1' | 'pkcs8';
|
|
6417
|
+
};
|
|
6418
|
+
}
|
|
6419
|
+
|
|
6420
|
+
interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
6421
|
+
/**
|
|
6422
|
+
* Key size in bits
|
|
6423
|
+
*/
|
|
6424
|
+
modulusLength: number;
|
|
6425
|
+
/**
|
|
6426
|
+
* Size of q in bits
|
|
6427
|
+
*/
|
|
6428
|
+
divisorLength: number;
|
|
6429
|
+
|
|
6430
|
+
publicKeyEncoding: {
|
|
6431
|
+
type: 'spki';
|
|
6432
|
+
format: PubF;
|
|
6433
|
+
};
|
|
6434
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
6435
|
+
type: 'pkcs8';
|
|
6436
|
+
};
|
|
6437
|
+
}
|
|
6438
|
+
|
|
6439
|
+
interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
|
6440
|
+
/**
|
|
6441
|
+
* Name of the curve to use.
|
|
6442
|
+
*/
|
|
6443
|
+
namedCurve: string;
|
|
6444
|
+
|
|
6445
|
+
publicKeyEncoding: {
|
|
6446
|
+
type: 'pkcs1' | 'spki';
|
|
6447
|
+
format: PubF;
|
|
6448
|
+
};
|
|
6449
|
+
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
|
6450
|
+
type: 'sec1' | 'pkcs8';
|
|
6451
|
+
};
|
|
6452
|
+
}
|
|
6453
|
+
|
|
6454
|
+
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
|
6455
|
+
publicKey: T1;
|
|
6456
|
+
privateKey: T2;
|
|
6457
|
+
}
|
|
6458
|
+
|
|
6459
|
+
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
|
6460
|
+
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
|
6461
|
+
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
|
6462
|
+
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
6463
|
+
|
|
6464
|
+
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
|
6465
|
+
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
|
6466
|
+
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
|
6467
|
+
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
6468
|
+
|
|
6469
|
+
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
|
6470
|
+
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
|
6471
|
+
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
|
6472
|
+
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
|
6352
6473
|
}
|
|
6353
6474
|
|
|
6354
6475
|
declare module "stream" {
|
|
@@ -7665,6 +7786,7 @@ declare module "http2" {
|
|
|
7665
7786
|
addListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
|
7666
7787
|
addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
|
7667
7788
|
addListener(event: "timeout", listener: () => void): this;
|
|
7789
|
+
addListener(event: "ping", listener: () => void): this;
|
|
7668
7790
|
|
|
7669
7791
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
7670
7792
|
emit(event: "close"): boolean;
|
|
@@ -7674,6 +7796,7 @@ declare module "http2" {
|
|
|
7674
7796
|
emit(event: "localSettings", settings: Settings): boolean;
|
|
7675
7797
|
emit(event: "remoteSettings", settings: Settings): boolean;
|
|
7676
7798
|
emit(event: "timeout"): boolean;
|
|
7799
|
+
emit(event: "ping"): boolean;
|
|
7677
7800
|
|
|
7678
7801
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
7679
7802
|
on(event: "close", listener: () => void): this;
|
|
@@ -7683,6 +7806,7 @@ declare module "http2" {
|
|
|
7683
7806
|
on(event: "localSettings", listener: (settings: Settings) => void): this;
|
|
7684
7807
|
on(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
|
7685
7808
|
on(event: "timeout", listener: () => void): this;
|
|
7809
|
+
on(event: "ping", listener: () => void): this;
|
|
7686
7810
|
|
|
7687
7811
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
7688
7812
|
once(event: "close", listener: () => void): this;
|
|
@@ -7692,6 +7816,7 @@ declare module "http2" {
|
|
|
7692
7816
|
once(event: "localSettings", listener: (settings: Settings) => void): this;
|
|
7693
7817
|
once(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
|
7694
7818
|
once(event: "timeout", listener: () => void): this;
|
|
7819
|
+
once(event: "ping", listener: () => void): this;
|
|
7695
7820
|
|
|
7696
7821
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
7697
7822
|
prependListener(event: "close", listener: () => void): this;
|
|
@@ -7701,6 +7826,7 @@ declare module "http2" {
|
|
|
7701
7826
|
prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
|
7702
7827
|
prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
|
7703
7828
|
prependListener(event: "timeout", listener: () => void): this;
|
|
7829
|
+
prependListener(event: "ping", listener: () => void): this;
|
|
7704
7830
|
|
|
7705
7831
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
7706
7832
|
prependOnceListener(event: "close", listener: () => void): this;
|
|
@@ -7710,6 +7836,7 @@ declare module "http2" {
|
|
|
7710
7836
|
prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
|
7711
7837
|
prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
|
7712
7838
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
7839
|
+
prependOnceListener(event: "ping", listener: () => void): this;
|
|
7713
7840
|
}
|
|
7714
7841
|
|
|
7715
7842
|
export interface ClientHttp2Session extends Http2Session {
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.12.0",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -156,12 +156,13 @@
|
|
|
156
156
|
}
|
|
157
157
|
],
|
|
158
158
|
"main": "",
|
|
159
|
+
"types": "",
|
|
159
160
|
"repository": {
|
|
160
161
|
"type": "git",
|
|
161
162
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
|
162
163
|
},
|
|
163
164
|
"scripts": {},
|
|
164
165
|
"dependencies": {},
|
|
165
|
-
"typesPublisherContentHash": "
|
|
166
|
+
"typesPublisherContentHash": "2f0ee5caa77d69f14900c2f28db9d6901f1c038af748af32f60256f9ba8202f2",
|
|
166
167
|
"typeScriptVersion": "2.0"
|
|
167
168
|
}
|