@types/node 11.11.0 → 11.11.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 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: Fri, 08 Mar 2019 23:03:44 GMT
11
+ * Last updated: Tue, 19 Mar 2019 23:42:11 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/assert.d.ts CHANGED
@@ -33,17 +33,17 @@ declare module "assert" {
33
33
  function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
34
34
  function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
35
35
 
36
- function throws(block: Function, message?: string | Error): void;
37
- function throws(block: Function, error: RegExp | Function | Object | Error, message?: string | Error): void;
38
- function doesNotThrow(block: Function, message?: string | Error): void;
39
- function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void;
36
+ function throws(block: () => any, message?: string | Error): void;
37
+ function throws(block: () => any, error: RegExp | Function | Object | Error, message?: string | Error): void;
38
+ function doesNotThrow(block: () => any, message?: string | Error): void;
39
+ function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
40
40
 
41
41
  function ifError(value: any): void;
42
42
 
43
- function rejects(block: Function | Promise<any>, message?: string | Error): Promise<void>;
44
- function rejects(block: Function | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
45
- function doesNotReject(block: Function | Promise<any>, message?: string | Error): Promise<void>;
46
- function doesNotReject(block: Function | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
43
+ function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
44
+ function rejects(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
45
+ function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
46
+ function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
47
47
 
48
48
  const strict: typeof internal;
49
49
  }
node/child_process.d.ts CHANGED
@@ -264,6 +264,7 @@ declare module "child_process" {
264
264
  execArgv?: string[];
265
265
  silent?: boolean;
266
266
  stdio?: StdioOptions;
267
+ detached?: boolean;
267
268
  windowsVerbatimArguments?: boolean;
268
269
  }
269
270
  function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
node/cluster.d.ts CHANGED
@@ -92,7 +92,7 @@ declare module "cluster" {
92
92
 
93
93
  interface Cluster extends events.EventEmitter {
94
94
  Worker: Worker;
95
- disconnect(callback?: Function): void;
95
+ disconnect(callback?: () => void): void;
96
96
  fork(env?: any): Worker;
97
97
  isMaster: boolean;
98
98
  isWorker: boolean;
@@ -121,7 +121,7 @@ declare module "cluster" {
121
121
  addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
122
122
  addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
123
123
  addListener(event: "online", listener: (worker: Worker) => void): this;
124
- addListener(event: "setup", listener: (settings: any) => void): this;
124
+ addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
125
125
 
126
126
  emit(event: string | symbol, ...args: any[]): boolean;
127
127
  emit(event: "disconnect", worker: Worker): boolean;
@@ -130,7 +130,7 @@ declare module "cluster" {
130
130
  emit(event: "listening", worker: Worker, address: Address): boolean;
131
131
  emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
132
132
  emit(event: "online", worker: Worker): boolean;
133
- emit(event: "setup", settings: any): boolean;
133
+ emit(event: "setup", settings: ClusterSettings): boolean;
134
134
 
135
135
  on(event: string, listener: (...args: any[]) => void): this;
136
136
  on(event: "disconnect", listener: (worker: Worker) => void): this;
@@ -139,7 +139,7 @@ declare module "cluster" {
139
139
  on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
140
140
  on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
141
141
  on(event: "online", listener: (worker: Worker) => void): this;
142
- on(event: "setup", listener: (settings: any) => void): this;
142
+ on(event: "setup", listener: (settings: ClusterSettings) => void): this;
143
143
 
144
144
  once(event: string, listener: (...args: any[]) => void): this;
145
145
  once(event: "disconnect", listener: (worker: Worker) => void): this;
@@ -148,7 +148,7 @@ declare module "cluster" {
148
148
  once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
149
149
  once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
150
150
  once(event: "online", listener: (worker: Worker) => void): this;
151
- once(event: "setup", listener: (settings: any) => void): this;
151
+ once(event: "setup", listener: (settings: ClusterSettings) => void): this;
152
152
 
153
153
  prependListener(event: string, listener: (...args: any[]) => void): this;
154
154
  prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
@@ -157,7 +157,7 @@ declare module "cluster" {
157
157
  prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
158
158
  prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
159
159
  prependListener(event: "online", listener: (worker: Worker) => void): this;
160
- prependListener(event: "setup", listener: (settings: any) => void): this;
160
+ prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
161
161
 
162
162
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
163
163
  prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
@@ -167,10 +167,10 @@ declare module "cluster" {
167
167
  // the handle is a net.Socket or net.Server object, or undefined.
168
168
  prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
169
169
  prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
170
- prependOnceListener(event: "setup", listener: (settings: any) => void): this;
170
+ prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
171
171
  }
172
172
 
173
- function disconnect(callback?: Function): void;
173
+ function disconnect(callback?: () => void): void;
174
174
  function fork(env?: any): Worker;
175
175
  const isMaster: boolean;
176
176
  const isWorker: boolean;
@@ -200,7 +200,7 @@ declare module "cluster" {
200
200
  // the handle is a net.Socket or net.Server object, or undefined.
201
201
  function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
202
202
  function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
203
- function addListener(event: "setup", listener: (settings: any) => void): Cluster;
203
+ function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
204
204
 
205
205
  function emit(event: string | symbol, ...args: any[]): boolean;
206
206
  function emit(event: "disconnect", worker: Worker): boolean;
@@ -209,7 +209,7 @@ declare module "cluster" {
209
209
  function emit(event: "listening", worker: Worker, address: Address): boolean;
210
210
  function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
211
211
  function emit(event: "online", worker: Worker): boolean;
212
- function emit(event: "setup", settings: any): boolean;
212
+ function emit(event: "setup", settings: ClusterSettings): boolean;
213
213
 
214
214
  function on(event: string, listener: (...args: any[]) => void): Cluster;
215
215
  function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
@@ -218,7 +218,7 @@ declare module "cluster" {
218
218
  function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
219
219
  function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
220
220
  function on(event: "online", listener: (worker: Worker) => void): Cluster;
221
- function on(event: "setup", listener: (settings: any) => void): Cluster;
221
+ function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
222
222
 
223
223
  function once(event: string, listener: (...args: any[]) => void): Cluster;
224
224
  function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
@@ -227,7 +227,7 @@ declare module "cluster" {
227
227
  function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
228
228
  function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
229
229
  function once(event: "online", listener: (worker: Worker) => void): Cluster;
230
- function once(event: "setup", listener: (settings: any) => void): Cluster;
230
+ function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
231
231
 
232
232
  function removeListener(event: string, listener: (...args: any[]) => void): Cluster;
233
233
  function removeAllListeners(event?: string): Cluster;
@@ -244,7 +244,7 @@ declare module "cluster" {
244
244
  // the handle is a net.Socket or net.Server object, or undefined.
245
245
  function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
246
246
  function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
247
- function prependListener(event: "setup", listener: (settings: any) => void): Cluster;
247
+ function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
248
248
 
249
249
  function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
250
250
  function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
@@ -254,7 +254,7 @@ declare module "cluster" {
254
254
  // the handle is a net.Socket or net.Server object, or undefined.
255
255
  function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
256
256
  function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
257
- function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster;
257
+ function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
258
258
 
259
259
  function eventNames(): string[];
260
260
  }
node/crypto.d.ts CHANGED
@@ -185,10 +185,8 @@ declare module "crypto" {
185
185
  interface Cipher extends NodeJS.ReadWriteStream {
186
186
  update(data: BinaryLike): Buffer;
187
187
  update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
188
- update(data: Binary, output_encoding: HexBase64BinaryEncoding): string;
189
- update(data: Binary, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
190
- // second arg ignored
191
- update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
188
+ update(data: Binary, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
189
+ update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string;
192
190
  final(): Buffer;
193
191
  final(output_encoding: string): string;
194
192
  setAutoPadding(auto_padding?: boolean): this;
@@ -227,9 +225,8 @@ declare module "crypto" {
227
225
  interface Decipher extends NodeJS.ReadWriteStream {
228
226
  update(data: Binary): Buffer;
229
227
  update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
230
- update(data: Binary, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
231
- // second arg is ignored
232
- update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
228
+ update(data: Binary, input_encoding: undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
229
+ update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
233
230
  final(): Buffer;
234
231
  final(output_encoding: string): string;
235
232
  setAutoPadding(auto_padding?: boolean): this;
node/dgram.d.ts CHANGED
@@ -39,7 +39,7 @@ declare module "dgram" {
39
39
  bind(port?: number, address?: string, callback?: () => void): void;
40
40
  bind(port?: number, callback?: () => void): void;
41
41
  bind(callback?: () => void): void;
42
- bind(options: BindOptions, callback?: Function): void;
42
+ bind(options: BindOptions, callback?: () => void): void;
43
43
  close(callback?: () => void): void;
44
44
  address(): AddressInfo | string;
45
45
  setBroadcast(flag: boolean): void;
node/domain.d.ts CHANGED
@@ -2,12 +2,12 @@ declare module "domain" {
2
2
  import * as events from "events";
3
3
 
4
4
  class Domain extends events.EventEmitter implements NodeJS.Domain {
5
- run(fn: Function): void;
6
- add(emitter: events.EventEmitter): void;
7
- remove(emitter: events.EventEmitter): void;
8
- bind(cb: (err: Error, data: any) => any): any;
9
- intercept(cb: (data: any) => any): any;
10
- members: any[];
5
+ run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
6
+ add(emitter: events.EventEmitter | NodeJS.Timer): void;
7
+ remove(emitter: events.EventEmitter | NodeJS.Timer): void;
8
+ bind<T extends Function>(cb: T): T;
9
+ intercept<T extends Function>(cb: T): T;
10
+ members: Array<events.EventEmitter | NodeJS.Timer>;
11
11
  enter(): void;
12
12
  exit(): void;
13
13
  }
node/globals.d.ts CHANGED
@@ -360,7 +360,7 @@ declare const Buffer: {
360
360
  * Creates a new Buffer using the passed {data}
361
361
  * @param data data to create a new Buffer
362
362
  */
363
- from(data: any[]): Buffer;
363
+ from(data: number[]): Buffer;
364
364
  from(data: Uint8Array): Buffer;
365
365
  /**
366
366
  * Creates a new Buffer containing the given JavaScript string {str}.
@@ -611,12 +611,11 @@ declare namespace NodeJS {
611
611
 
612
612
  interface WritableStream extends EventEmitter {
613
613
  writable: boolean;
614
- write(buffer: Buffer | string, cb?: Function): boolean;
615
- write(str: string, encoding?: string, cb?: Function): boolean;
616
- end(cb?: Function): void;
617
- end(buffer: Buffer, cb?: Function): void;
618
- end(str: string, cb?: Function): void;
619
- end(str: string, encoding?: string, cb?: Function): void;
614
+ write(buffer: Buffer | Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
615
+ write(str: string, encoding?: string, cb?: (err?: Error | null) => void): boolean;
616
+ end(cb?: () => void): void;
617
+ end(data: string | Uint8Array | Buffer, cb?: () => void): void;
618
+ end(str: string, encoding?: string, cb?: () => void): void;
620
619
  }
621
620
 
622
621
  interface ReadWriteStream extends ReadableStream, WritableStream { }
@@ -624,11 +623,11 @@ declare namespace NodeJS {
624
623
  interface Events extends EventEmitter { }
625
624
 
626
625
  interface Domain extends Events {
627
- run(fn: Function): void;
628
- add(emitter: Events): void;
629
- remove(emitter: Events): void;
630
- bind(cb: (err: Error, data: any) => any): any;
631
- intercept(cb: (data: any) => any): any;
626
+ run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
627
+ add(emitter: EventEmitter | Timer): void;
628
+ remove(emitter: EventEmitter | Timer): void;
629
+ bind<T extends Function>(cb: T): T;
630
+ intercept<T extends Function>(cb: T): T;
632
631
 
633
632
  addListener(event: string, listener: (...args: any[]) => void): this;
634
633
  on(event: string, listener: (...args: any[]) => void): this;
@@ -712,9 +711,9 @@ declare namespace NodeJS {
712
711
  readonly writableLength: number;
713
712
  columns?: number;
714
713
  rows?: number;
715
- _write(chunk: any, encoding: string, callback: Function): void;
716
- _destroy(err: Error | null, callback: Function): void;
717
- _final(callback: Function): void;
714
+ _write(chunk: any, encoding: string, callback: (err?: null | Error) => void): void;
715
+ _destroy(err: Error | null, callback: (err?: null | Error) => void): void;
716
+ _final(callback: (err?: null | Error) => void): void;
718
717
  setDefaultEncoding(encoding: string): this;
719
718
  cork(): void;
720
719
  uncork(): void;
@@ -726,7 +725,7 @@ declare namespace NodeJS {
726
725
  isRaw?: boolean;
727
726
  setRawMode?(mode: boolean): void;
728
727
  _read(size: number): void;
729
- _destroy(err: Error | null, callback: Function): void;
728
+ _destroy(err: Error | null, callback: (err?: null | Error) => void): void;
730
729
  push(chunk: any, encoding?: string): boolean;
731
730
  destroy(error?: Error): void;
732
731
  }
node/http.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  declare module "http" {
2
2
  import * as events from "events";
3
- import * as net from "net";
4
3
  import * as stream from "stream";
5
4
  import { URL } from "url";
5
+ import { Socket, Server as NetServer } from "net";
6
6
 
7
7
  // incoming headers will never contain number
8
8
  interface IncomingHttpHeaders {
@@ -85,7 +85,7 @@ declare module "http" {
85
85
  timeout?: number;
86
86
  setHost?: boolean;
87
87
  // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
88
- createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket;
88
+ createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket;
89
89
  }
90
90
 
91
91
  interface ServerOptions {
@@ -95,17 +95,23 @@ declare module "http" {
95
95
 
96
96
  type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
97
97
 
98
- class Server extends net.Server {
98
+ class Server extends NetServer {
99
99
  constructor(requestListener?: RequestListener);
100
100
  constructor(options: ServerOptions, requestListener?: RequestListener);
101
101
 
102
102
  setTimeout(msecs?: number, callback?: () => void): this;
103
103
  setTimeout(callback: () => void): this;
104
- maxHeadersCount: number;
104
+ /**
105
+ * Limits maximum incoming headers count. If set to 0, no limit will be applied.
106
+ * @default 2000
107
+ * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
108
+ */
109
+ maxHeadersCount: number | null;
105
110
  timeout: number;
106
111
  /**
107
112
  * Limit the amount of time the parser will wait to receive the complete HTTP headers.
108
113
  * @default 40000
114
+ * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
109
115
  */
110
116
  headersTimeout: number;
111
117
  keepAliveTimeout: number;
@@ -120,7 +126,7 @@ declare module "http" {
120
126
  sendDate: boolean;
121
127
  finished: boolean;
122
128
  headersSent: boolean;
123
- connection: net.Socket;
129
+ connection: Socket;
124
130
 
125
131
  constructor();
126
132
 
@@ -142,8 +148,8 @@ declare module "http" {
142
148
 
143
149
  constructor(req: IncomingMessage);
144
150
 
145
- assignSocket(socket: net.Socket): void;
146
- detachSocket(socket: net.Socket): void;
151
+ assignSocket(socket: Socket): void;
152
+ detachSocket(socket: Socket): void;
147
153
  // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
148
154
  // no args in writeContinue callback
149
155
  writeContinue(callback?: () => void): void;
@@ -153,27 +159,27 @@ declare module "http" {
153
159
 
154
160
  // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
155
161
  class ClientRequest extends OutgoingMessage {
156
- connection: net.Socket;
157
- socket: net.Socket;
162
+ connection: Socket;
163
+ socket: Socket;
158
164
  aborted: number;
159
165
 
160
166
  constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
161
167
 
162
168
  readonly path: string;
163
169
  abort(): void;
164
- onSocket(socket: net.Socket): void;
170
+ onSocket(socket: Socket): void;
165
171
  setTimeout(timeout: number, callback?: () => void): this;
166
172
  setNoDelay(noDelay?: boolean): void;
167
173
  setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
168
174
  }
169
175
 
170
176
  class IncomingMessage extends stream.Readable {
171
- constructor(socket: net.Socket);
177
+ constructor(socket: Socket);
172
178
 
173
179
  httpVersion: string;
174
180
  httpVersionMajor: number;
175
181
  httpVersionMinor: number;
176
- connection: net.Socket;
182
+ connection: Socket;
177
183
  headers: IncomingHttpHeaders;
178
184
  rawHeaders: string[];
179
185
  trailers: { [key: string]: string | undefined };
@@ -195,7 +201,7 @@ declare module "http" {
195
201
  * Only valid for response obtained from http.ClientRequest.
196
202
  */
197
203
  statusMessage?: string;
198
- socket: net.Socket;
204
+ socket: Socket;
199
205
  destroy(error?: Error): void;
200
206
  }
201
207
 
@@ -226,8 +232,12 @@ declare module "http" {
226
232
  class Agent {
227
233
  maxFreeSockets: number;
228
234
  maxSockets: number;
229
- sockets: any;
230
- requests: any;
235
+ readonly sockets: {
236
+ readonly [key: string]: Socket[];
237
+ };
238
+ readonly requests: {
239
+ readonly [key: string]: IncomingMessage[];
240
+ };
231
241
 
232
242
  constructor(opts?: AgentOptions);
233
243
 
@@ -249,7 +259,6 @@ declare module "http" {
249
259
 
250
260
  function createServer(requestListener?: RequestListener): Server;
251
261
  function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
252
- function createClient(port?: number, host?: string): any;
253
262
 
254
263
  // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
255
264
  // create interface RequestOptions would make the naming more clear to developers
node/http2.d.ts CHANGED
@@ -558,7 +558,7 @@ declare module "http2" {
558
558
  prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
559
559
  }
560
560
 
561
- export class Http2ServerResponse extends events.EventEmitter {
561
+ export class Http2ServerResponse extends stream.Stream {
562
562
  private constructor();
563
563
  addTrailers(trailers: OutgoingHttpHeaders): void;
564
564
  connection: net.Socket | tls.TLSSocket;
node/https.d.ts CHANGED
@@ -26,7 +26,19 @@ declare module "https" {
26
26
 
27
27
  setTimeout(callback: () => void): this;
28
28
  setTimeout(msecs?: number, callback?: () => void): this;
29
+ /**
30
+ * Limits maximum incoming headers count. If set to 0, no limit will be applied.
31
+ * @default 2000
32
+ * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
33
+ */
34
+ maxHeadersCount: number | null;
29
35
  timeout: number;
36
+ /**
37
+ * Limit the amount of time the parser will wait to receive the complete HTTP headers.
38
+ * @default 40000
39
+ * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
40
+ */
41
+ headersTimeout: number;
30
42
  keepAliveTimeout: number;
31
43
  }
32
44
 
node/net.d.ts CHANGED
@@ -38,22 +38,18 @@ declare module "net" {
38
38
  constructor(options?: SocketConstructorOpts);
39
39
 
40
40
  // Extended base methods
41
- write(buffer: Buffer): boolean;
42
- write(buffer: Buffer, cb?: Function): boolean;
43
- write(str: string, cb?: Function): boolean;
44
- write(str: string, encoding?: string, cb?: Function): boolean;
45
- write(str: string, encoding?: string, fd?: string): boolean;
46
- write(data: any, encoding?: string, callback?: Function): void;
47
-
48
- connect(options: SocketConnectOpts, connectionListener?: Function): this;
49
- connect(port: number, host: string, connectionListener?: Function): this;
50
- connect(port: number, connectionListener?: Function): this;
51
- connect(path: string, connectionListener?: Function): this;
41
+ write(buffer: Buffer | Uint8Array | string, cb?: (err?: Error) => void): boolean;
42
+ write(str: Buffer | Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
43
+
44
+ connect(options: SocketConnectOpts, connectionListener?: () => void): this;
45
+ connect(port: number, host: string, connectionListener?: () => void): this;
46
+ connect(port: number, connectionListener?: () => void): this;
47
+ connect(path: string, connectionListener?: () => void): this;
52
48
 
53
49
  setEncoding(encoding?: string): this;
54
50
  pause(): this;
55
51
  resume(): this;
56
- setTimeout(timeout: number, callback?: Function): this;
52
+ setTimeout(timeout: number, callback?: () => void): this;
57
53
  setNoDelay(noDelay?: boolean): this;
58
54
  setKeepAlive(enable?: boolean, initialDelay?: number): this;
59
55
  address(): AddressInfo | string;
@@ -72,11 +68,9 @@ declare module "net" {
72
68
  readonly remotePort?: number;
73
69
 
74
70
  // Extended base methods
75
- end(): void;
76
- end(buffer: Buffer, cb?: Function): void;
77
- end(str: string, cb?: Function): void;
78
- end(str: string, encoding?: string, cb?: Function): void;
79
- end(data?: any, encoding?: string): void;
71
+ end(cb?: () => void): void;
72
+ end(buffer: Buffer | Uint8Array | string, cb?: () => void): void;
73
+ end(str: Buffer | Uint8Array | string, encoding?: string, cb?: () => void): void;
80
74
 
81
75
  /**
82
76
  * events.EventEmitter
@@ -169,15 +163,15 @@ declare module "net" {
169
163
  constructor(connectionListener?: (socket: Socket) => void);
170
164
  constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
171
165
 
172
- listen(port?: number, hostname?: string, backlog?: number, listeningListener?: Function): this;
173
- listen(port?: number, hostname?: string, listeningListener?: Function): this;
174
- listen(port?: number, backlog?: number, listeningListener?: Function): this;
175
- listen(port?: number, listeningListener?: Function): this;
176
- listen(path: string, backlog?: number, listeningListener?: Function): this;
177
- listen(path: string, listeningListener?: Function): this;
178
- listen(options: ListenOptions, listeningListener?: Function): this;
179
- listen(handle: any, backlog?: number, listeningListener?: Function): this;
180
- listen(handle: any, listeningListener?: Function): this;
166
+ listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
167
+ listen(port?: number, hostname?: string, listeningListener?: () => void): this;
168
+ listen(port?: number, backlog?: number, listeningListener?: () => void): this;
169
+ listen(port?: number, listeningListener?: () => void): this;
170
+ listen(path: string, backlog?: number, listeningListener?: () => void): this;
171
+ listen(path: string, listeningListener?: () => void): this;
172
+ listen(options: ListenOptions, listeningListener?: () => void): this;
173
+ listen(handle: any, backlog?: number, listeningListener?: () => void): this;
174
+ listen(handle: any, listeningListener?: () => void): this;
181
175
  close(callback?: (err?: Error) => void): this;
182
176
  address(): AddressInfo | string | null;
183
177
  getConnections(cb: (error: Error | null, count: number) => void): void;
@@ -243,12 +237,12 @@ declare module "net" {
243
237
 
244
238
  function createServer(connectionListener?: (socket: Socket) => void): Server;
245
239
  function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
246
- function connect(options: NetConnectOpts, connectionListener?: Function): Socket;
247
- function connect(port: number, host?: string, connectionListener?: Function): Socket;
248
- function connect(path: string, connectionListener?: Function): Socket;
249
- function createConnection(options: NetConnectOpts, connectionListener?: Function): Socket;
250
- function createConnection(port: number, host?: string, connectionListener?: Function): Socket;
251
- function createConnection(path: string, connectionListener?: Function): Socket;
240
+ function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
241
+ function connect(port: number, host?: string, connectionListener?: () => void): Socket;
242
+ function connect(path: string, connectionListener?: () => void): Socket;
243
+ function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket;
244
+ function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
245
+ function createConnection(path: string, connectionListener?: () => void): Socket;
252
246
  function isIP(input: string): number;
253
247
  function isIPv4(input: string): boolean;
254
248
  function isIPv6(input: string): boolean;
node/os.d.ts CHANGED
@@ -28,6 +28,14 @@ declare module "os" {
28
28
  scopeid: number;
29
29
  }
30
30
 
31
+ interface UserInfo<T> {
32
+ username: T;
33
+ uid: number;
34
+ gid: number;
35
+ shell: T;
36
+ homedir: T;
37
+ }
38
+
31
39
  type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
32
40
 
33
41
  function hostname(): string;
@@ -40,7 +48,8 @@ declare module "os" {
40
48
  function release(): string;
41
49
  function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };
42
50
  function homedir(): string;
43
- function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string };
51
+ function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52
+ function userInfo(options?: { encoding: string }): UserInfo<string>;
44
53
  const constants: {
45
54
  UV_UDP_REUSEADDR: number;
46
55
  signals: {
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "11.11.0",
3
+ "version": "11.11.4",
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": "460d4f0de2f05fc8bc2b7609a3454eb1a9c6efe6a79a2fcb50116f5ce7f51e38",
209
+ "typesPublisherContentHash": "3ae8881053042a07e21a9cb17e6ca7dc2bd3d90f72ee0923d652dcb7455aa64e",
210
210
  "typeScriptVersion": "2.0"
211
211
  }
node/path.d.ts CHANGED
@@ -129,8 +129,8 @@ declare module "path" {
129
129
 
130
130
  namespace posix {
131
131
  function normalize(p: string): string;
132
- function join(...paths: any[]): string;
133
- function resolve(...pathSegments: any[]): string;
132
+ function join(...paths: string[]): string;
133
+ function resolve(...pathSegments: string[]): string;
134
134
  function isAbsolute(p: string): boolean;
135
135
  function relative(from: string, to: string): string;
136
136
  function dirname(p: string): string;
@@ -144,8 +144,8 @@ declare module "path" {
144
144
 
145
145
  namespace win32 {
146
146
  function normalize(p: string): string;
147
- function join(...paths: any[]): string;
148
- function resolve(...pathSegments: any[]): string;
147
+ function join(...paths: string[]): string;
148
+ function resolve(...pathSegments: string[]): string;
149
149
  function isAbsolute(p: string): boolean;
150
150
  function relative(from: string, to: string): string;
151
151
  function dirname(p: string): string;
node/punycode.d.ts CHANGED
@@ -8,5 +8,5 @@ declare module "punycode" {
8
8
  decode(string: string): number[];
9
9
  encode(codePoints: number[]): string;
10
10
  }
11
- const version: any;
11
+ const version: string;
12
12
  }
node/querystring.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  declare module "querystring" {
2
2
  interface StringifyOptions {
3
- encodeURIComponent?: Function;
3
+ encodeURIComponent?: (str: string) => string;
4
4
  }
5
5
 
6
6
  interface ParseOptions {
7
7
  maxKeys?: number;
8
- decodeURIComponent?: Function;
8
+ decodeURIComponent?: (str: string) => string;
9
9
  }
10
10
 
11
11
  interface ParsedUrlQuery { [key: string]: string | string[]; }
node/readline.d.ts CHANGED
@@ -110,7 +110,7 @@ declare module "readline" {
110
110
  type ReadLine = Interface; // type forwarded for backwards compatiblity
111
111
 
112
112
  type Completer = (line: string) => CompleterResult;
113
- type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any;
113
+ type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
114
114
 
115
115
  type CompleterResult = [string[], string];
116
116
 
node/stream.d.ts CHANGED
@@ -14,6 +14,7 @@ declare module "stream" {
14
14
  objectMode?: boolean;
15
15
  read?(this: Readable, size: number): void;
16
16
  destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void;
17
+ autoDestroy?: boolean;
17
18
  }
18
19
 
19
20
  class Readable extends Stream implements NodeJS.ReadableStream {
@@ -31,7 +32,7 @@ declare module "stream" {
31
32
  unshift(chunk: any): void;
32
33
  wrap(oldStream: NodeJS.ReadableStream): this;
33
34
  push(chunk: any, encoding?: string): boolean;
34
- _destroy(error: Error | null, callback: (error: Error | null) => void): void;
35
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
35
36
  destroy(error?: Error): void;
36
37
 
37
38
  /**
@@ -98,11 +99,14 @@ declare module "stream" {
98
99
  interface WritableOptions {
99
100
  highWaterMark?: number;
100
101
  decodeStrings?: boolean;
102
+ defaultEncoding?: string;
101
103
  objectMode?: boolean;
104
+ emitClose?: boolean;
102
105
  write?(this: Writable, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
103
106
  writev?(this: Writable, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
104
107
  destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
105
108
  final?(this: Writable, callback: (error?: Error | null) => void): void;
109
+ autoDestroy?: boolean;
106
110
  }
107
111
 
108
112
  class Writable extends Stream implements NodeJS.WritableStream {
@@ -112,7 +116,7 @@ declare module "stream" {
112
116
  constructor(opts?: WritableOptions);
113
117
  _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
114
118
  _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
115
- _destroy(error: Error | null, callback: (error: Error | null) => void): void;
119
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
116
120
  _final(callback: (error?: Error | null) => void): void;
117
121
  write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
118
122
  write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean;
@@ -212,8 +216,8 @@ declare module "stream" {
212
216
  _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
213
217
  _destroy(error: Error | null, callback: (error: Error | null) => void): void;
214
218
  _final(callback: (error?: Error | null) => void): void;
215
- write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
216
219
  write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean;
220
+ write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
217
221
  setDefaultEncoding(encoding: string): this;
218
222
  end(cb?: () => void): void;
219
223
  end(chunk: any, cb?: () => void): void;
node/tls.d.ts CHANGED
@@ -180,13 +180,13 @@ declare module "tls" {
180
180
  * Could be used to speed up handshake establishment when reconnecting to the server.
181
181
  * @returns ASN.1 encoded TLS session or undefined if none was negotiated.
182
182
  */
183
- getSession(): any;
183
+ getSession(): Buffer | undefined;
184
184
  /**
185
185
  * NOTE: Works only with client TLS sockets.
186
186
  * Useful only for debugging, for session reuse provide session option to tls.connect().
187
187
  * @returns TLS session ticket or undefined if none was negotiated.
188
188
  */
189
- getTLSTicket(): any;
189
+ getTLSTicket(): Buffer | undefined;
190
190
  /**
191
191
  * Initiate TLS renegotiation process.
192
192
  *
@@ -196,8 +196,9 @@ declare module "tls" {
196
196
  * requestCert (See tls.createServer() for details).
197
197
  * @param callback - callback(err) will be executed with null as err, once the renegotiation
198
198
  * is successfully completed.
199
+ * @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated.
199
200
  */
200
- renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): any;
201
+ renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean;
201
202
  /**
202
203
  * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
203
204
  * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
@@ -291,50 +292,50 @@ declare module "tls" {
291
292
  */
292
293
  addListener(event: string, listener: (...args: any[]) => void): this;
293
294
  addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
294
- addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
295
- addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
296
- addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
295
+ addListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
296
+ addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
297
+ addListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
297
298
  addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
298
299
 
299
300
  emit(event: string | symbol, ...args: any[]): boolean;
300
301
  emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
301
- emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean;
302
- emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean;
303
- emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean;
302
+ emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
303
+ emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
304
+ emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
304
305
  emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
305
306
 
306
307
  on(event: string, listener: (...args: any[]) => void): this;
307
308
  on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
308
- on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
309
- on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
310
- on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
309
+ on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
310
+ on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
311
+ on(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
311
312
  on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
312
313
 
313
314
  once(event: string, listener: (...args: any[]) => void): this;
314
315
  once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
315
- once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
316
- once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
317
- once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
316
+ once(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
317
+ once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
318
+ once(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
318
319
  once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
319
320
 
320
321
  prependListener(event: string, listener: (...args: any[]) => void): this;
321
322
  prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
322
- prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
323
- prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
324
- prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
323
+ prependListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
324
+ prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
325
+ prependListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
325
326
  prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
326
327
 
327
328
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
328
329
  prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
329
- prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
330
- prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
331
- prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
330
+ prependOnceListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
331
+ prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
332
+ prependOnceListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
332
333
  prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
333
334
  }
334
335
 
335
336
  interface SecurePair {
336
- encrypted: any;
337
- cleartext: any;
337
+ encrypted: TLSSocket;
338
+ cleartext: TLSSocket;
338
339
  }
339
340
 
340
341
  type SecureVersion = 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
@@ -388,6 +389,9 @@ declare module "tls" {
388
389
  function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
389
390
  function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
390
391
  function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
392
+ /**
393
+ * @deprecated
394
+ */
391
395
  function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
392
396
  function createSecureContext(details: SecureContextOptions): SecureContext;
393
397
  function getCiphers(): string[];
node/worker_threads.d.ts CHANGED
@@ -72,51 +72,51 @@ declare module "worker_threads" {
72
72
  postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
73
73
  ref(): void;
74
74
  unref(): void;
75
- terminate(callback?: (err: any, exitCode: number) => void): void;
75
+ terminate(callback?: (err: Error, exitCode: number) => void): void;
76
76
 
77
- addListener(event: "error", listener: (err: any) => void): this;
77
+ addListener(event: "error", listener: (err: Error) => void): this;
78
78
  addListener(event: "exit", listener: (exitCode: number) => void): this;
79
79
  addListener(event: "message", listener: (value: any) => void): this;
80
80
  addListener(event: "online", listener: () => void): this;
81
81
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
82
82
 
83
- emit(event: "error", err: any): boolean;
83
+ emit(event: "error", err: Error): boolean;
84
84
  emit(event: "exit", exitCode: number): boolean;
85
85
  emit(event: "message", value: any): boolean;
86
86
  emit(event: "online"): boolean;
87
87
  emit(event: string | symbol, ...args: any[]): boolean;
88
88
 
89
- on(event: "error", listener: (err: any) => void): this;
89
+ on(event: "error", listener: (err: Error) => void): this;
90
90
  on(event: "exit", listener: (exitCode: number) => void): this;
91
91
  on(event: "message", listener: (value: any) => void): this;
92
92
  on(event: "online", listener: () => void): this;
93
93
  on(event: string | symbol, listener: (...args: any[]) => void): this;
94
94
 
95
- once(event: "error", listener: (err: any) => void): this;
95
+ once(event: "error", listener: (err: Error) => void): this;
96
96
  once(event: "exit", listener: (exitCode: number) => void): this;
97
97
  once(event: "message", listener: (value: any) => void): this;
98
98
  once(event: "online", listener: () => void): this;
99
99
  once(event: string | symbol, listener: (...args: any[]) => void): this;
100
100
 
101
- prependListener(event: "error", listener: (err: any) => void): this;
101
+ prependListener(event: "error", listener: (err: Error) => void): this;
102
102
  prependListener(event: "exit", listener: (exitCode: number) => void): this;
103
103
  prependListener(event: "message", listener: (value: any) => void): this;
104
104
  prependListener(event: "online", listener: () => void): this;
105
105
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
106
106
 
107
- prependOnceListener(event: "error", listener: (err: any) => void): this;
107
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
108
108
  prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
109
109
  prependOnceListener(event: "message", listener: (value: any) => void): this;
110
110
  prependOnceListener(event: "online", listener: () => void): this;
111
111
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
112
112
 
113
- removeListener(event: "error", listener: (err: any) => void): this;
113
+ removeListener(event: "error", listener: (err: Error) => void): this;
114
114
  removeListener(event: "exit", listener: (exitCode: number) => void): this;
115
115
  removeListener(event: "message", listener: (value: any) => void): this;
116
116
  removeListener(event: "online", listener: () => void): this;
117
117
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
118
118
 
119
- off(event: "error", listener: (err: any) => void): this;
119
+ off(event: "error", listener: (err: Error) => void): this;
120
120
  off(event: "exit", listener: (exitCode: number) => void): this;
121
121
  off(event: "message", listener: (value: any) => void): this;
122
122
  off(event: "online", listener: () => void): this;