@types/node 11.12.1 → 11.13.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/child_process.d.ts +25 -5
- node/cluster.d.ts +1 -1
- node/crypto.d.ts +1 -1
- node/events.d.ts +1 -0
- node/globals.d.ts +1 -1
- node/https.d.ts +2 -0
- node/index.d.ts +1 -1
- node/package.json +2 -2
- node/tls.d.ts +2 -5
- node/tty.d.ts +3 -0
- node/v8.d.ts +22 -0
- node/worker_threads.d.ts +16 -0
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, 01 Apr 2019 19:40:47 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
|
|
14
14
|
|
node/child_process.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ declare module "child_process" {
|
|
|
19
19
|
readonly pid: number;
|
|
20
20
|
readonly connected: boolean;
|
|
21
21
|
kill(signal?: string): void;
|
|
22
|
-
send(message: any, callback?: (error: Error) => void): boolean;
|
|
23
|
-
send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean;
|
|
24
|
-
send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error) => void): boolean;
|
|
22
|
+
send(message: any, callback?: (error: Error | null) => void): boolean;
|
|
23
|
+
send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error | null) => void): boolean;
|
|
24
|
+
send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
|
|
25
25
|
disconnect(): void;
|
|
26
26
|
unref(): void;
|
|
27
27
|
ref(): void;
|
|
@@ -78,6 +78,20 @@ declare module "child_process" {
|
|
|
78
78
|
prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
// return this object when stdio option is undefined or not specified
|
|
82
|
+
interface ChildProcessWithoutNullStreams extends ChildProcess {
|
|
83
|
+
stdin: Writable;
|
|
84
|
+
stdout: Readable;
|
|
85
|
+
stderr: Readable;
|
|
86
|
+
readonly stdio: [
|
|
87
|
+
Writable, // stdin
|
|
88
|
+
Readable, // stdout
|
|
89
|
+
Readable, // stderr
|
|
90
|
+
Readable | Writable | null | undefined, // extra, no modification
|
|
91
|
+
Readable | Writable | null | undefined // extra, no modification
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
|
|
81
95
|
interface MessageOptions {
|
|
82
96
|
keepOpen?: boolean;
|
|
83
97
|
}
|
|
@@ -110,8 +124,14 @@ declare module "child_process" {
|
|
|
110
124
|
windowsVerbatimArguments?: boolean;
|
|
111
125
|
}
|
|
112
126
|
|
|
113
|
-
|
|
114
|
-
|
|
127
|
+
interface SpawnOptionsWithoutStdio extends SpawnOptions {
|
|
128
|
+
stdio?: 'pipe' | Array<null | undefined | 'pipe'>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
|
|
132
|
+
function spawn(command: string, options: SpawnOptions): ChildProcess;
|
|
133
|
+
function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
|
|
134
|
+
function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
|
|
115
135
|
|
|
116
136
|
interface ExecOptions extends CommonOptions {
|
|
117
137
|
shell?: string;
|
node/cluster.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare module "cluster" {
|
|
|
24
24
|
class Worker extends events.EventEmitter {
|
|
25
25
|
id: number;
|
|
26
26
|
process: child.ChildProcess;
|
|
27
|
-
send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean;
|
|
27
|
+
send(message: any, sendHandle?: any, callback?: (error: Error | null) => void): boolean;
|
|
28
28
|
kill(signal?: string): void;
|
|
29
29
|
destroy(signal?: string): void;
|
|
30
30
|
disconnect(): void;
|
node/crypto.d.ts
CHANGED
|
@@ -261,7 +261,7 @@ declare module "crypto" {
|
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
|
|
264
|
-
function createPublicKey(key: PublicKeyInput | string | Buffer): KeyObject;
|
|
264
|
+
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
|
|
265
265
|
function createSecretKey(key: Buffer): KeyObject;
|
|
266
266
|
|
|
267
267
|
function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
|
node/events.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare module "events" {
|
|
|
2
2
|
class internal extends NodeJS.EventEmitter { }
|
|
3
3
|
|
|
4
4
|
namespace internal {
|
|
5
|
+
function once(emitter: EventEmitter, event: string | symbol): Promise<any>;
|
|
5
6
|
class EventEmitter extends internal {
|
|
6
7
|
/** @deprecated since v4.0.0 */
|
|
7
8
|
static listenerCount(emitter: EventEmitter, event: string | symbol): number;
|
node/globals.d.ts
CHANGED
|
@@ -891,7 +891,7 @@ declare namespace NodeJS {
|
|
|
891
891
|
domain: Domain;
|
|
892
892
|
|
|
893
893
|
// Worker
|
|
894
|
-
send?(message: any, sendHandle?: any):
|
|
894
|
+
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
|
|
895
895
|
disconnect(): void;
|
|
896
896
|
connected: boolean;
|
|
897
897
|
|
node/https.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare module "https" {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
class Server extends tls.Server {
|
|
25
|
+
constructor(requestListener?: http.RequestListener);
|
|
25
26
|
constructor(options: ServerOptions, requestListener?: http.RequestListener);
|
|
26
27
|
|
|
27
28
|
setTimeout(callback: () => void): this;
|
|
@@ -42,6 +43,7 @@ declare module "https" {
|
|
|
42
43
|
keepAliveTimeout: number;
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
function createServer(requestListener?: http.RequestListener): Server;
|
|
45
47
|
function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
|
|
46
48
|
function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
|
47
49
|
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for non-npm package Node.js 11.
|
|
1
|
+
// Type definitions for non-npm package Node.js 11.13
|
|
2
2
|
// Project: http://nodejs.org/
|
|
3
3
|
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
4
|
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.13.0",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -206,6 +206,6 @@
|
|
|
206
206
|
},
|
|
207
207
|
"scripts": {},
|
|
208
208
|
"dependencies": {},
|
|
209
|
-
"typesPublisherContentHash": "
|
|
209
|
+
"typesPublisherContentHash": "f650903133b29f714d48239d0401ba23695ef6bdb390e447918ee3d997cb3350",
|
|
210
210
|
"typeScriptVersion": "2.0"
|
|
211
211
|
}
|
node/tls.d.ts
CHANGED
|
@@ -276,11 +276,7 @@ declare module "tls" {
|
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
class Server extends net.Server {
|
|
279
|
-
addContext(hostName: string, credentials:
|
|
280
|
-
key: string;
|
|
281
|
-
cert: string;
|
|
282
|
-
ca: string;
|
|
283
|
-
}): void;
|
|
279
|
+
addContext(hostName: string, credentials: SecureContextOptions): void;
|
|
284
280
|
|
|
285
281
|
/**
|
|
286
282
|
* events.EventEmitter
|
|
@@ -385,6 +381,7 @@ declare module "tls" {
|
|
|
385
381
|
* Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined.
|
|
386
382
|
*/
|
|
387
383
|
function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
|
|
384
|
+
function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server;
|
|
388
385
|
function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
|
|
389
386
|
function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
390
387
|
function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
node/tty.d.ts
CHANGED
|
@@ -39,6 +39,9 @@ declare module "tty" {
|
|
|
39
39
|
* @default `process.env`
|
|
40
40
|
*/
|
|
41
41
|
getColorDepth(env?: {}): number;
|
|
42
|
+
hasColors(depth?: number): boolean;
|
|
43
|
+
hasColors(env?: {}): boolean;
|
|
44
|
+
hasColors(depth: number, env?: {}): boolean;
|
|
42
45
|
getWindowSize(): [number, number];
|
|
43
46
|
columns: number;
|
|
44
47
|
rows: number;
|
node/v8.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
declare module "v8" {
|
|
2
|
+
import { Readable } from "stream";
|
|
3
|
+
|
|
2
4
|
interface HeapSpaceInfo {
|
|
3
5
|
space_name: string;
|
|
4
6
|
space_size: number;
|
|
@@ -25,4 +27,24 @@ declare module "v8" {
|
|
|
25
27
|
function getHeapStatistics(): HeapInfo;
|
|
26
28
|
function getHeapSpaceStatistics(): HeapSpaceInfo[];
|
|
27
29
|
function setFlagsFromString(flags: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Generates a snapshot of the current V8 heap and returns a Readable
|
|
32
|
+
* Stream that may be used to read the JSON serialized representation.
|
|
33
|
+
* This conversation was marked as resolved by joyeecheung
|
|
34
|
+
* This JSON stream format is intended to be used with tools such as
|
|
35
|
+
* Chrome DevTools. The JSON schema is undocumented and specific to the
|
|
36
|
+
* V8 engine, and may change from one version of V8 to the next.
|
|
37
|
+
*/
|
|
38
|
+
function getHeapSnapshot(): Readable;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param fileName The file path where the V8 heap snapshot is to be
|
|
43
|
+
* saved. If not specified, a file name with the pattern
|
|
44
|
+
* `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
|
|
45
|
+
* generated, where `{pid}` will be the PID of the Node.js process,
|
|
46
|
+
* `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
|
|
47
|
+
* the main Node.js thread or the id of a worker thread.
|
|
48
|
+
*/
|
|
49
|
+
function writeHeapSnapshot(fileName?: string): string;
|
|
28
50
|
}
|
node/worker_threads.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare module "worker_threads" {
|
|
2
|
+
import { Context } from "vm";
|
|
2
3
|
import { EventEmitter } from "events";
|
|
3
4
|
import { Readable, Writable } from "stream";
|
|
4
5
|
|
|
@@ -73,6 +74,21 @@ declare module "worker_threads" {
|
|
|
73
74
|
ref(): void;
|
|
74
75
|
unref(): void;
|
|
75
76
|
terminate(callback?: (err: Error, exitCode: number) => void): void;
|
|
77
|
+
/**
|
|
78
|
+
* Transfer a `MessagePort` to a different `vm` Context. The original `port`
|
|
79
|
+
* object will be rendered unusable, and the returned `MessagePort` instance will
|
|
80
|
+
* take its place.
|
|
81
|
+
*
|
|
82
|
+
* The returned `MessagePort` will be an object in the target context, and will
|
|
83
|
+
* inherit from its global `Object` class. Objects passed to the
|
|
84
|
+
* `port.onmessage()` listener will also be created in the target context
|
|
85
|
+
* and inherit from its global `Object` class.
|
|
86
|
+
*
|
|
87
|
+
* However, the created `MessagePort` will no longer inherit from
|
|
88
|
+
* `EventEmitter`, and only `port.onmessage()` can be used to receive
|
|
89
|
+
* events using it.
|
|
90
|
+
*/
|
|
91
|
+
moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
|
|
76
92
|
|
|
77
93
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
78
94
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|