@types/node 14.14.20 → 14.14.24

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: Mon, 04 Jan 2021 20:50:23 GMT
11
+ * Last updated: Wed, 03 Feb 2021 23:39:29 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/domain.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- declare module "domain" {
2
- import { EventEmitter } from "events";
1
+ declare module 'domain' {
2
+ import EventEmitter = require('events');
3
3
 
4
4
  global {
5
5
  namespace NodeJS {
node/events.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module "events" {
1
+ declare module 'events' {
2
2
  interface EventEmitterOptions {
3
3
  /**
4
4
  * Enables automatic capturing of promise rejection.
@@ -14,11 +14,16 @@ declare module "events" {
14
14
  addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
15
15
  }
16
16
 
17
- namespace EventEmitter {
18
- function once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
19
- function once(emitter: DOMEventTarget, event: string): Promise<any[]>;
20
- function on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>;
21
- const captureRejectionSymbol: unique symbol;
17
+ interface EventEmitter extends NodeJS.EventEmitter {}
18
+ class EventEmitter {
19
+ constructor(options?: EventEmitterOptions);
20
+
21
+ static once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
22
+ static once(emitter: DOMEventTarget, event: string): Promise<any[]>;
23
+ static on(emitter: NodeJS.EventEmitter, event: string): AsyncIterableIterator<any>;
24
+
25
+ /** @deprecated since v4.0.0 */
26
+ static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number;
22
27
 
23
28
  /**
24
29
  * This symbol shall be used to install a listener for only monitoring `'error'`
@@ -29,31 +34,21 @@ declare module "events" {
29
34
  * `'error'` event is emitted, therefore the process will still crash if no
30
35
  * regular `'error'` listener is installed.
31
36
  */
32
- const errorMonitor: unique symbol;
37
+ static readonly errorMonitor: unique symbol;
38
+ static readonly captureRejectionSymbol: unique symbol;
39
+
33
40
  /**
34
41
  * Sets or gets the default captureRejection value for all emitters.
35
42
  */
36
- let captureRejections: boolean;
37
-
38
- interface EventEmitter extends NodeJS.EventEmitter {
39
- }
43
+ // TODO: These should be described using static getter/setter pairs:
44
+ static captureRejections: boolean;
45
+ static defaultMaxListeners: number;
46
+ }
40
47
 
41
- class EventEmitter {
42
- constructor(options?: EventEmitterOptions);
43
- /** @deprecated since v4.0.0 */
44
- static listenerCount(emitter: EventEmitter, event: string | symbol): number;
45
- static defaultMaxListeners: number;
46
- /**
47
- * This symbol shall be used to install a listener for only monitoring `'error'`
48
- * events. Listeners installed using this symbol are called before the regular
49
- * `'error'` listeners are called.
50
- *
51
- * Installing a listener using this symbol does not change the behavior once an
52
- * `'error'` event is emitted, therefore the process will still crash if no
53
- * regular `'error'` listener is installed.
54
- */
55
- static readonly errorMonitor: unique symbol;
56
- }
48
+ import internal = require('events');
49
+ namespace EventEmitter {
50
+ // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
51
+ export { internal as EventEmitter };
57
52
  }
58
53
 
59
54
  global {
node/fs/promises.d.ts CHANGED
@@ -281,7 +281,7 @@ declare module 'fs/promises' {
281
281
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
282
282
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
283
283
  */
284
- function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
284
+ function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
285
285
 
286
286
  /**
287
287
  * Asynchronous mkdir(2) - create a directory.
node/fs.d.ts CHANGED
@@ -973,7 +973,7 @@ declare module "fs" {
973
973
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
974
974
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
975
975
  */
976
- export function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path: string) => void): void;
976
+ export function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
977
977
 
978
978
  /**
979
979
  * Asynchronous mkdir(2) - create a directory.
@@ -989,7 +989,7 @@ declare module "fs" {
989
989
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
990
990
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
991
991
  */
992
- export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path: string | undefined) => void): void;
992
+ export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
993
993
 
994
994
  /**
995
995
  * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
@@ -1005,7 +1005,7 @@ declare module "fs" {
1005
1005
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1006
1006
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1007
1007
  */
1008
- function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
1008
+ function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
1009
1009
 
1010
1010
  /**
1011
1011
  * Asynchronous mkdir(2) - create a directory.
@@ -1030,7 +1030,7 @@ declare module "fs" {
1030
1030
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
1031
1031
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
1032
1032
  */
1033
- export function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string;
1033
+ export function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string | undefined;
1034
1034
 
1035
1035
  /**
1036
1036
  * Synchronous mkdir(2) - create a directory.
node/net.d.ts CHANGED
@@ -178,10 +178,22 @@ declare module "net" {
178
178
  ipv6Only?: boolean;
179
179
  }
180
180
 
181
+ interface ServerOpts {
182
+ /**
183
+ * Indicates whether half-opened TCP connections are allowed. __Default:__ `false`.
184
+ */
185
+ allowHalfOpen?: boolean;
186
+
187
+ /**
188
+ * Indicates whether the socket should be paused on incoming connections. __Default:__ `false`.
189
+ */
190
+ pauseOnConnect?: boolean;
191
+ }
192
+
181
193
  // https://github.com/nodejs/node/blob/master/lib/net.js
182
194
  class Server extends events.EventEmitter {
183
195
  constructor(connectionListener?: (socket: Socket) => void);
184
- constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
196
+ constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
185
197
 
186
198
  listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
187
199
  listen(port?: number, hostname?: string, listeningListener?: () => void): this;
@@ -256,7 +268,7 @@ declare module "net" {
256
268
  type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
257
269
 
258
270
  function createServer(connectionListener?: (socket: Socket) => void): Server;
259
- function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
271
+ function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server;
260
272
  function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
261
273
  function connect(port: number, host?: string, connectionListener?: () => void): Socket;
262
274
  function connect(path: string, connectionListener?: () => void): Socket;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.20",
3
+ "version": "14.14.24",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -251,6 +251,6 @@
251
251
  },
252
252
  "scripts": {},
253
253
  "dependencies": {},
254
- "typesPublisherContentHash": "3ec100758f9a98f40ade23fd5781e233afe6427322127911c2b9a87c70fe396b",
255
- "typeScriptVersion": "3.3"
254
+ "typesPublisherContentHash": "e2509bd7872a33bb4ab8408aa52ebe466b47f1f3d47e251ce72437f2cace8d02",
255
+ "typeScriptVersion": "3.4"
256
256
  }
node/stream.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- declare module "stream" {
2
- import * as events from "events";
1
+ declare module 'stream' {
2
+ import EventEmitter = require('events');
3
3
 
4
- class internal extends events.EventEmitter {
4
+ class internal extends EventEmitter {
5
5
  pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
6
6
  }
7
7
 
node/tls.d.ts CHANGED
@@ -385,7 +385,7 @@ declare module "tls" {
385
385
  rejectUnauthorized?: boolean;
386
386
  }
387
387
 
388
- interface TlsOptions extends SecureContextOptions, CommonConnectionOptions {
388
+ interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
389
389
  /**
390
390
  * Abort the connection if the SSL/TLS handshake does not finish in the
391
391
  * specified number of milliseconds. A 'tlsClientError' is emitted on
@@ -471,6 +471,9 @@ declare module "tls" {
471
471
  }
472
472
 
473
473
  class Server extends net.Server {
474
+ constructor(secureConnectionListener?: (socket: TLSSocket) => void);
475
+ constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void);
476
+
474
477
  /**
475
478
  * The server.addContext() method adds a secure context that will be
476
479
  * used if the client request's SNI name matches the supplied hostname
node/ts3.4/assert.d.ts CHANGED
@@ -2,9 +2,7 @@ declare module 'assert' {
2
2
  /** An alias of `assert.ok()`. */
3
3
  function assert(value: any, message?: string | Error): void;
4
4
  namespace assert {
5
- class AssertionError implements Error {
6
- name: string;
7
- message: string;
5
+ class AssertionError extends Error {
8
6
  actual: any;
9
7
  expected: any;
10
8
  operator: string;