@types/node 14.14.22 → 14.14.26

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: Tue, 19 Jan 2021 23:09:28 GMT
11
+ * Last updated: Thu, 11 Feb 2021 21:04:31 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/dns.d.ts CHANGED
@@ -276,7 +276,12 @@ declare module "dns" {
276
276
  const ADDRGETNETWORKPARAMS: string;
277
277
  const CANCELLED: string;
278
278
 
279
+ interface ResolverOptions {
280
+ timeout?: number;
281
+ }
282
+
279
283
  class Resolver {
284
+ constructor(options?: ResolverOptions);
280
285
  cancel(): void;
281
286
  getServers: typeof getServers;
282
287
  resolve: typeof resolve;
@@ -352,6 +357,7 @@ declare module "dns" {
352
357
  function setServers(servers: ReadonlyArray<string>): void;
353
358
 
354
359
  class Resolver {
360
+ constructor(options?: ResolverOptions);
355
361
  cancel(): void;
356
362
  getServers: typeof getServers;
357
363
  resolve: typeof resolve;
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.
@@ -1778,7 +1778,7 @@ declare module "fs" {
1778
1778
  export function watch(
1779
1779
  filename: PathLike,
1780
1780
  options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null,
1781
- listener?: (event: string, filename: string) => void,
1781
+ listener?: (event: "rename" | "change", filename: string) => void,
1782
1782
  ): FSWatcher;
1783
1783
 
1784
1784
  /**
@@ -1790,7 +1790,11 @@ declare module "fs" {
1790
1790
  * If `persistent` is not supplied, the default of `true` is used.
1791
1791
  * If `recursive` is not supplied, the default of `false` is used.
1792
1792
  */
1793
- export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher;
1793
+ export function watch(
1794
+ filename: PathLike,
1795
+ options: { encoding: "buffer", persistent?: boolean, recursive?: boolean; } | "buffer",
1796
+ listener?: (event: "rename" | "change", filename: Buffer) => void
1797
+ ): FSWatcher;
1794
1798
 
1795
1799
  /**
1796
1800
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
@@ -1804,7 +1808,7 @@ declare module "fs" {
1804
1808
  export function watch(
1805
1809
  filename: PathLike,
1806
1810
  options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | string | null,
1807
- listener?: (event: string, filename: string | Buffer) => void,
1811
+ listener?: (event: "rename" | "change", filename: string | Buffer) => void,
1808
1812
  ): FSWatcher;
1809
1813
 
1810
1814
  /**
@@ -1812,7 +1816,7 @@ declare module "fs" {
1812
1816
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1813
1817
  * URL support is _experimental_.
1814
1818
  */
1815
- export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher;
1819
+ export function watch(filename: PathLike, listener?: (event: "rename" | "change", filename: string) => any): FSWatcher;
1816
1820
 
1817
1821
  /**
1818
1822
  * Asynchronously tests whether or not the given path exists by checking with the file system.
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.22",
3
+ "version": "14.14.26",
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": "1fca9b97600d43cbf3c9f3a1c57e994dbe5cd9aa768bd7accf34db05f7079716",
254
+ "typesPublisherContentHash": "17b47c86751c9605f2b7fe24f7b721984325c2fa26a6d7773151eb03d23e0264",
255
255
  "typeScriptVersion": "3.4"
256
256
  }
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