@types/node 12.12.7 → 12.12.11

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
@@ -5,12 +5,12 @@
5
5
  This package contains type definitions for Node.js (http://nodejs.org/).
6
6
 
7
7
  # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
- Additional Details
11
- * Last updated: Fri, 08 Nov 2019 22:57:07 GMT
10
+ ### Additional Details
11
+ * Last updated: Tue, 19 Nov 2019 19:44:54 GMT
12
12
  * Dependencies: none
13
- * Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
13
+ * Global values: `Buffer`, `NodeJS`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
15
15
  # Credits
16
- These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Nikita Galkin <https://github.com/galkin>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, Thanik Bhongbhibhat <https://github.com/bhongy>, Marcin Kopacz <https://github.com/chyzwar>, Trivikram Kamat <https://github.com/trivikr>, and Minh Son Nguyen <https://github.com/nguymin4>.
16
+ These definitions were written by Microsoft TypeScript (https://github.com/Microsoft), DefinitelyTyped (https://github.com/DefinitelyTyped), Alberto Schiabel (https://github.com/jkomyno), Alexander T. (https://github.com/a-tarasyuk), Alvis HT Tang (https://github.com/alvis), Andrew Makarov (https://github.com/r3nya), Benjamin Toueg (https://github.com/btoueg), Bruno Scheufler (https://github.com/brunoscheufler), Chigozirim C. (https://github.com/smac89), Christian Vaagland Tellnes (https://github.com/tellnes), David Junger (https://github.com/touffy), Deividas Bakanas (https://github.com/DeividasBakanas), Eugene Y. Q. Shen (https://github.com/eyqs), Flarna (https://github.com/Flarna), Hannes Magnusson (https://github.com/Hannes-Magnusson-CK), Hoàng Văn Khải (https://github.com/KSXGitHub), Huw (https://github.com/hoo29), Kelvin Jin (https://github.com/kjin), Klaus Meinhardt (https://github.com/ajafff), Lishude (https://github.com/islishude), Mariusz Wiktorczyk (https://github.com/mwiktorczyk), Mohsen Azimi (https://github.com/mohsen1), Nicolas Even (https://github.com/n-e), Nicolas Voigt (https://github.com/octo-sniffle), Nikita Galkin (https://github.com/galkin), Parambir Singh (https://github.com/parambirs), Sebastian Silbermann (https://github.com/eps1lon), Simon Schick (https://github.com/SimonSchick), Thomas den Hollander (https://github.com/ThomasdenH), Wilco Bakker (https://github.com/WilcoBakker), wwwy3y3 (https://github.com/wwwy3y3), Zane Hannan AU (https://github.com/ZaneHannanAU), Samuel Ainsworth (https://github.com/samuela), Kyle Uehlein (https://github.com/kuehlein), Jordi Oliveras Rovira (https://github.com/j-oliveras), Thanik Bhongbhibhat (https://github.com/bhongy), Marcin Kopacz (https://github.com/chyzwar), Trivikram Kamat (https://github.com/trivikr), Minh Son Nguyen (https://github.com/nguymin4), and Junxiao Shi (https://github.com/yoursunny).
node/dgram.d.ts CHANGED
@@ -11,9 +11,10 @@ declare module "dgram" {
11
11
  }
12
12
 
13
13
  interface BindOptions {
14
- port: number;
14
+ port?: number;
15
15
  address?: string;
16
16
  exclusive?: boolean;
17
+ fd?: number;
17
18
  }
18
19
 
19
20
  type SocketType = "udp4" | "udp6";
@@ -34,67 +35,82 @@ declare module "dgram" {
34
35
  function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
35
36
 
36
37
  class Socket extends events.EventEmitter {
37
- send(msg: string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
38
- send(msg: string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
38
+ addMembership(multicastAddress: string, multicastInterface?: string): void;
39
+ address(): AddressInfo;
39
40
  bind(port?: number, address?: string, callback?: () => void): void;
40
41
  bind(port?: number, callback?: () => void): void;
41
42
  bind(callback?: () => void): void;
42
43
  bind(options: BindOptions, callback?: () => void): void;
43
44
  close(callback?: () => void): void;
44
- address(): AddressInfo | string;
45
+ connect(port: number, address?: string, callback?: () => void): void;
46
+ connect(port: number, callback: () => void): void;
47
+ disconnect(): void;
48
+ dropMembership(multicastAddress: string, multicastInterface?: string): void;
49
+ getRecvBufferSize(): number;
50
+ getSendBufferSize(): number;
51
+ ref(): this;
52
+ remoteAddress(): AddressInfo;
53
+ send(msg: string | Uint8Array | any[], port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
54
+ send(msg: string | Uint8Array | any[], port?: number, callback?: (error: Error | null, bytes: number) => void): void;
55
+ send(msg: string | Uint8Array | any[], callback?: (error: Error | null, bytes: number) => void): void;
56
+ send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
57
+ send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
58
+ send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
45
59
  setBroadcast(flag: boolean): void;
46
- setTTL(ttl: number): void;
47
- setMulticastTTL(ttl: number): void;
48
60
  setMulticastInterface(multicastInterface: string): void;
49
61
  setMulticastLoopback(flag: boolean): void;
50
- addMembership(multicastAddress: string, multicastInterface?: string): void;
51
- dropMembership(multicastAddress: string, multicastInterface?: string): void;
52
- ref(): this;
53
- unref(): this;
62
+ setMulticastTTL(ttl: number): void;
54
63
  setRecvBufferSize(size: number): void;
55
64
  setSendBufferSize(size: number): void;
56
- getRecvBufferSize(): number;
57
- getSendBufferSize(): number;
65
+ setTTL(ttl: number): void;
66
+ unref(): this;
58
67
 
59
68
  /**
60
69
  * events.EventEmitter
61
70
  * 1. close
62
- * 2. error
63
- * 3. listening
64
- * 4. message
71
+ * 2. connect
72
+ * 3. error
73
+ * 4. listening
74
+ * 5. message
65
75
  */
66
76
  addListener(event: string, listener: (...args: any[]) => void): this;
67
77
  addListener(event: "close", listener: () => void): this;
78
+ addListener(event: "connect", listener: () => void): this;
68
79
  addListener(event: "error", listener: (err: Error) => void): this;
69
80
  addListener(event: "listening", listener: () => void): this;
70
81
  addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
71
82
 
72
83
  emit(event: string | symbol, ...args: any[]): boolean;
73
84
  emit(event: "close"): boolean;
85
+ emit(event: "connect"): boolean;
74
86
  emit(event: "error", err: Error): boolean;
75
87
  emit(event: "listening"): boolean;
76
88
  emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
77
89
 
78
90
  on(event: string, listener: (...args: any[]) => void): this;
79
91
  on(event: "close", listener: () => void): this;
92
+ on(event: "connect", listener: () => void): this;
80
93
  on(event: "error", listener: (err: Error) => void): this;
81
94
  on(event: "listening", listener: () => void): this;
82
95
  on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
83
96
 
84
97
  once(event: string, listener: (...args: any[]) => void): this;
85
98
  once(event: "close", listener: () => void): this;
99
+ once(event: "connect", listener: () => void): this;
86
100
  once(event: "error", listener: (err: Error) => void): this;
87
101
  once(event: "listening", listener: () => void): this;
88
102
  once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
89
103
 
90
104
  prependListener(event: string, listener: (...args: any[]) => void): this;
91
105
  prependListener(event: "close", listener: () => void): this;
106
+ prependListener(event: "connect", listener: () => void): this;
92
107
  prependListener(event: "error", listener: (err: Error) => void): this;
93
108
  prependListener(event: "listening", listener: () => void): this;
94
109
  prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
95
110
 
96
111
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
97
112
  prependOnceListener(event: "close", listener: () => void): this;
113
+ prependOnceListener(event: "connect", listener: () => void): this;
98
114
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
99
115
  prependOnceListener(event: "listening", listener: () => void): this;
100
116
  prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
node/globals.d.ts CHANGED
@@ -193,9 +193,13 @@ interface NodeRequireFunction {
193
193
  (id: string): any;
194
194
  }
195
195
 
196
+ interface NodeRequireCache {
197
+ [path: string]: NodeModule;
198
+ }
199
+
196
200
  interface NodeRequire extends NodeRequireFunction {
197
201
  resolve: RequireResolve;
198
- cache: any;
202
+ cache: NodeRequireCache;
199
203
  /**
200
204
  * @deprecated
201
205
  */
@@ -1134,8 +1138,8 @@ declare namespace NodeJS {
1134
1138
  /**
1135
1139
  * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
1136
1140
  */
1137
- static createRequireFromPath(path: string): NodeRequireFunction;
1138
- static createRequire(path: string): NodeRequireFunction;
1141
+ static createRequireFromPath(path: string): NodeRequire;
1142
+ static createRequire(path: string): NodeRequire;
1139
1143
  static builtinModules: string[];
1140
1144
 
1141
1145
  static Module: typeof Module;
node/http.d.ts CHANGED
@@ -69,18 +69,18 @@ declare module "http" {
69
69
  }
70
70
 
71
71
  interface ClientRequestArgs {
72
- protocol?: string;
73
- host?: string;
74
- hostname?: string;
72
+ protocol?: string | null;
73
+ host?: string | null;
74
+ hostname?: string | null;
75
75
  family?: number;
76
- port?: number | string;
76
+ port?: number | string | null;
77
77
  defaultPort?: number | string;
78
78
  localAddress?: string;
79
79
  socketPath?: string;
80
80
  method?: string;
81
- path?: string;
81
+ path?: string | null;
82
82
  headers?: OutgoingHttpHeaders;
83
- auth?: string;
83
+ auth?: string | null;
84
84
  agent?: Agent | boolean;
85
85
  _defaultAgent?: Agent;
86
86
  timeout?: number;
node/index.d.ts CHANGED
@@ -39,6 +39,7 @@
39
39
  // Marcin Kopacz <https://github.com/chyzwar>
40
40
  // Trivikram Kamat <https://github.com/trivikr>
41
41
  // Minh Son Nguyen <https://github.com/nguymin4>
42
+ // Junxiao Shi <https://github.com/yoursunny>
42
43
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
43
44
 
44
45
  // NOTE: These definitions support NodeJS and TypeScript 3.2.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.12.7",
3
+ "version": "12.12.11",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -198,6 +198,11 @@
198
198
  "name": "Minh Son Nguyen",
199
199
  "url": "https://github.com/nguymin4",
200
200
  "githubUsername": "nguymin4"
201
+ },
202
+ {
203
+ "name": "Junxiao Shi",
204
+ "url": "https://github.com/yoursunny",
205
+ "githubUsername": "yoursunny"
201
206
  }
202
207
  ],
203
208
  "main": "",
@@ -216,6 +221,6 @@
216
221
  },
217
222
  "scripts": {},
218
223
  "dependencies": {},
219
- "typesPublisherContentHash": "a02ca3410df572421b5c3f9cb42feca6989e17002defcbd3d03e36d8e38e54c2",
224
+ "typesPublisherContentHash": "db8a3e1fadc482615dd04e1c1d0d26eca954d792aed008eac14078e02f14e87b",
220
225
  "typeScriptVersion": "2.8"
221
226
  }
node/url.d.ts CHANGED
@@ -1,29 +1,36 @@
1
1
  declare module "url" {
2
2
  import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
3
3
 
4
- interface UrlObjectCommon {
5
- auth?: string;
6
- hash?: string;
7
- host?: string;
8
- hostname?: string;
9
- href?: string;
10
- path?: string;
11
- pathname?: string;
12
- protocol?: string;
13
- search?: string;
14
- slashes?: boolean;
15
- }
16
-
17
4
  // Input to `url.format`
18
- interface UrlObject extends UrlObjectCommon {
19
- port?: string | number;
5
+ interface UrlObject {
6
+ auth?: string | null;
7
+ hash?: string | null;
8
+ host?: string | null;
9
+ hostname?: string | null;
10
+ href?: string | null;
11
+ path?: string | null;
12
+ pathname?: string | null;
13
+ protocol?: string | null;
14
+ search?: string | null;
15
+ slashes?: boolean | null;
16
+ port?: string | number | null;
20
17
  query?: string | null | ParsedUrlQueryInput;
21
18
  }
22
19
 
23
20
  // Output of `url.parse`
24
- interface Url extends UrlObjectCommon {
25
- port?: string;
26
- query?: string | null | ParsedUrlQuery;
21
+ interface Url {
22
+ auth: string | null;
23
+ hash: string | null;
24
+ host: string | null;
25
+ hostname: string | null;
26
+ href: string;
27
+ path: string | null;
28
+ pathname: string | null;
29
+ protocol: string | null;
30
+ search: string | null;
31
+ slashes: boolean | null;
32
+ port: string | null;
33
+ query: string | null | ParsedUrlQuery;
27
34
  }
28
35
 
29
36
  interface UrlWithParsedQuery extends Url {