@types/node 12.20.14 → 12.20.18

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 v12.20/net.d.ts CHANGED
@@ -16,10 +16,10 @@ declare module 'net' {
16
16
  }
17
17
 
18
18
  interface SocketConstructorOpts {
19
- fd?: number;
20
- allowHalfOpen?: boolean;
21
- readable?: boolean;
22
- writable?: boolean;
19
+ fd?: number | undefined;
20
+ allowHalfOpen?: boolean | undefined;
21
+ readable?: boolean | undefined;
22
+ writable?: boolean | undefined;
23
23
  }
24
24
 
25
25
  interface OnReadOpts {
@@ -38,17 +38,17 @@ declare module 'net' {
38
38
  * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
39
39
  * still be emitted as normal and methods like pause() and resume() will also behave as expected.
40
40
  */
41
- onread?: OnReadOpts;
41
+ onread?: OnReadOpts | undefined;
42
42
  }
43
43
 
44
44
  interface TcpSocketConnectOpts extends ConnectOpts {
45
45
  port: number;
46
- host?: string;
47
- localAddress?: string;
48
- localPort?: number;
49
- hints?: number;
50
- family?: number;
51
- lookup?: LookupFunction;
46
+ host?: string | undefined;
47
+ localAddress?: string | undefined;
48
+ localPort?: number | undefined;
49
+ hints?: number | undefined;
50
+ family?: number | undefined;
51
+ lookup?: LookupFunction | undefined;
52
52
  }
53
53
 
54
54
  interface IpcSocketConnectOpts extends ConnectOpts {
@@ -86,9 +86,9 @@ declare module 'net' {
86
86
  readonly destroyed: boolean;
87
87
  readonly localAddress: string;
88
88
  readonly localPort: number;
89
- readonly remoteAddress?: string;
90
- readonly remoteFamily?: string;
91
- readonly remotePort?: number;
89
+ readonly remoteAddress?: string | undefined;
90
+ readonly remoteFamily?: string | undefined;
91
+ readonly remotePort?: number | undefined;
92
92
 
93
93
  // Extended base methods
94
94
  end(cb?: () => void): void;
@@ -114,6 +114,7 @@ declare module 'net' {
114
114
  addListener(event: "end", listener: () => void): this;
115
115
  addListener(event: "error", listener: (err: Error) => void): this;
116
116
  addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
117
+ addListener(event: "ready", listener: () => void): this;
117
118
  addListener(event: "timeout", listener: () => void): this;
118
119
 
119
120
  emit(event: string | symbol, ...args: any[]): boolean;
@@ -124,6 +125,7 @@ declare module 'net' {
124
125
  emit(event: "end"): boolean;
125
126
  emit(event: "error", err: Error): boolean;
126
127
  emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
128
+ emit(event: "ready"): boolean;
127
129
  emit(event: "timeout"): boolean;
128
130
 
129
131
  on(event: string, listener: (...args: any[]) => void): this;
@@ -134,6 +136,7 @@ declare module 'net' {
134
136
  on(event: "end", listener: () => void): this;
135
137
  on(event: "error", listener: (err: Error) => void): this;
136
138
  on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
139
+ on(event: "ready", listener: () => void): this;
137
140
  on(event: "timeout", listener: () => void): this;
138
141
 
139
142
  once(event: string, listener: (...args: any[]) => void): this;
@@ -144,6 +147,7 @@ declare module 'net' {
144
147
  once(event: "end", listener: () => void): this;
145
148
  once(event: "error", listener: (err: Error) => void): this;
146
149
  once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
150
+ once(event: "ready", listener: () => void): this;
147
151
  once(event: "timeout", listener: () => void): this;
148
152
 
149
153
  prependListener(event: string, listener: (...args: any[]) => void): this;
@@ -154,6 +158,7 @@ declare module 'net' {
154
158
  prependListener(event: "end", listener: () => void): this;
155
159
  prependListener(event: "error", listener: (err: Error) => void): this;
156
160
  prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
161
+ prependListener(event: "ready", listener: () => void): this;
157
162
  prependListener(event: "timeout", listener: () => void): this;
158
163
 
159
164
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
@@ -164,27 +169,28 @@ declare module 'net' {
164
169
  prependOnceListener(event: "end", listener: () => void): this;
165
170
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
166
171
  prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
172
+ prependOnceListener(event: "ready", listener: () => void): this;
167
173
  prependOnceListener(event: "timeout", listener: () => void): this;
168
174
  }
169
175
 
170
176
  interface ListenOptions {
171
- port?: number;
172
- host?: string;
173
- backlog?: number;
174
- path?: string;
175
- exclusive?: boolean;
176
- readableAll?: boolean;
177
- writableAll?: boolean;
177
+ port?: number | undefined;
178
+ host?: string | undefined;
179
+ backlog?: number | undefined;
180
+ path?: string | undefined;
181
+ exclusive?: boolean | undefined;
182
+ readableAll?: boolean | undefined;
183
+ writableAll?: boolean | undefined;
178
184
  /**
179
185
  * @default false
180
186
  */
181
- ipv6Only?: boolean;
187
+ ipv6Only?: boolean | undefined;
182
188
  }
183
189
 
184
190
  // https://github.com/nodejs/node/blob/master/lib/net.js
185
191
  class Server extends EventEmitter {
186
192
  constructor(connectionListener?: (socket: Socket) => void);
187
- constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
193
+ constructor(options?: { allowHalfOpen?: boolean | undefined, pauseOnConnect?: boolean | undefined }, connectionListener?: (socket: Socket) => void);
188
194
 
189
195
  listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
190
196
  listen(port?: number, hostname?: string, listeningListener?: () => void): this;
@@ -249,17 +255,17 @@ declare module 'net' {
249
255
  }
250
256
 
251
257
  interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
252
- timeout?: number;
258
+ timeout?: number | undefined;
253
259
  }
254
260
 
255
261
  interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
256
- timeout?: number;
262
+ timeout?: number | undefined;
257
263
  }
258
264
 
259
265
  type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
260
266
 
261
267
  function createServer(connectionListener?: (socket: Socket) => void): Server;
262
- function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
268
+ function createServer(options?: { allowHalfOpen?: boolean | undefined, pauseOnConnect?: boolean | undefined }, connectionListener?: (socket: Socket) => void): Server;
263
269
  function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
264
270
  function connect(port: number, host?: string, connectionListener?: () => void): Socket;
265
271
  function connect(path: string, connectionListener?: () => void): Socket;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.20.14",
3
+ "version": "12.20.18",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -207,6 +207,6 @@
207
207
  },
208
208
  "scripts": {},
209
209
  "dependencies": {},
210
- "typesPublisherContentHash": "2e58313cb47fcdf714f6591bdd70e667b4fb6722bad49359b8597fd57a857d35",
210
+ "typesPublisherContentHash": "b46674c8cb13b645216fd995fa79baafd00286cac63c92c8d768dcc3da0ae05f",
211
211
  "typeScriptVersion": "3.6"
212
212
  }
node v12.20/path.d.ts CHANGED
@@ -28,23 +28,23 @@ declare module 'path' {
28
28
  /**
29
29
  * The root of the path such as '/' or 'c:\'
30
30
  */
31
- root?: string;
31
+ root?: string | undefined;
32
32
  /**
33
33
  * The full directory path such as '/home/user/dir' or 'c:\path\dir'
34
34
  */
35
- dir?: string;
35
+ dir?: string | undefined;
36
36
  /**
37
37
  * The file name including extension (if any) such as 'index.html'
38
38
  */
39
- base?: string;
39
+ base?: string | undefined;
40
40
  /**
41
41
  * The file extension (if any) such as '.html'
42
42
  */
43
- ext?: string;
43
+ ext?: string | undefined;
44
44
  /**
45
45
  * The file name without extension (if any) such as 'index'
46
46
  */
47
- name?: string;
47
+ name?: string | undefined;
48
48
  }
49
49
 
50
50
  /**
@@ -29,7 +29,7 @@ declare module 'perf_hooks' {
29
29
  * the type of garbage collection operation that occurred.
30
30
  * The value may be one of perf_hooks.constants.
31
31
  */
32
- readonly kind?: number;
32
+ readonly kind?: number | undefined;
33
33
  }
34
34
 
35
35
  interface PerformanceNodeTiming extends PerformanceEntry {
@@ -182,7 +182,7 @@ declare module 'perf_hooks' {
182
182
  * Property buffered defaults to false.
183
183
  * @param options
184
184
  */
185
- observe(options: { entryTypes: ReadonlyArray<string>; buffered?: boolean }): void;
185
+ observe(options: { entryTypes: ReadonlyArray<string>; buffered?: boolean | undefined }): void;
186
186
  }
187
187
 
188
188
  namespace constants {
@@ -200,7 +200,7 @@ declare module 'perf_hooks' {
200
200
  * Must be greater than zero.
201
201
  * @default 10
202
202
  */
203
- resolution?: number;
203
+ resolution?: number | undefined;
204
204
  }
205
205
 
206
206
  interface EventLoopDelayMonitor {
@@ -1,11 +1,11 @@
1
1
  declare module 'querystring' {
2
2
  interface StringifyOptions {
3
- encodeURIComponent?: (str: string) => string;
3
+ encodeURIComponent?: ((str: string) => string) | undefined;
4
4
  }
5
5
 
6
6
  interface ParseOptions {
7
- maxKeys?: number;
8
- decodeURIComponent?: (str: string) => string;
7
+ maxKeys?: number | undefined;
8
+ decodeURIComponent?: ((str: string) => string) | undefined;
9
9
  }
10
10
 
11
11
  interface ParsedUrlQuery { [key: string]: string | string[]; }
@@ -2,11 +2,11 @@ declare module 'readline' {
2
2
  import EventEmitter = require('events');
3
3
 
4
4
  interface Key {
5
- sequence?: string;
6
- name?: string;
7
- ctrl?: boolean;
8
- meta?: boolean;
9
- shift?: boolean;
5
+ sequence?: string | undefined;
6
+ name?: string | undefined;
7
+ ctrl?: boolean | undefined;
8
+ meta?: boolean | undefined;
9
+ shift?: boolean | undefined;
10
10
  }
11
11
 
12
12
  class Interface extends EventEmitter {
@@ -122,14 +122,14 @@ declare module 'readline' {
122
122
 
123
123
  interface ReadLineOptions {
124
124
  input: NodeJS.ReadableStream;
125
- output?: NodeJS.WritableStream;
126
- completer?: Completer | AsyncCompleter;
127
- terminal?: boolean;
128
- historySize?: number;
129
- prompt?: string;
130
- crlfDelay?: number;
131
- removeHistoryDuplicates?: boolean;
132
- escapeCodeTimeout?: number;
125
+ output?: NodeJS.WritableStream | undefined;
126
+ completer?: Completer | AsyncCompleter | undefined;
127
+ terminal?: boolean | undefined;
128
+ historySize?: number | undefined;
129
+ prompt?: string | undefined;
130
+ crlfDelay?: number | undefined;
131
+ removeHistoryDuplicates?: boolean | undefined;
132
+ escapeCodeTimeout?: number | undefined;
133
133
  }
134
134
 
135
135
  function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
node v12.20/repl.d.ts CHANGED
@@ -8,24 +8,24 @@ declare module 'repl' {
8
8
  * The input prompt to display.
9
9
  * @default "> "
10
10
  */
11
- prompt?: string;
11
+ prompt?: string | undefined;
12
12
  /**
13
13
  * The `Readable` stream from which REPL input will be read.
14
14
  * @default process.stdin
15
15
  */
16
- input?: NodeJS.ReadableStream;
16
+ input?: NodeJS.ReadableStream | undefined;
17
17
  /**
18
18
  * The `Writable` stream to which REPL output will be written.
19
19
  * @default process.stdout
20
20
  */
21
- output?: NodeJS.WritableStream;
21
+ output?: NodeJS.WritableStream | undefined;
22
22
  /**
23
23
  * If `true`, specifies that the output should be treated as a TTY terminal, and have
24
24
  * ANSI/VT100 escape codes written to it.
25
25
  * Default: checking the value of the `isTTY` property on the output stream upon
26
26
  * instantiation.
27
27
  */
28
- terminal?: boolean;
28
+ terminal?: boolean | undefined;
29
29
  /**
30
30
  * The function to be used when evaluating each given line of input.
31
31
  * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
@@ -35,40 +35,40 @@ declare module 'repl' {
35
35
  * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
36
36
  * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
37
37
  */
38
- eval?: REPLEval;
38
+ eval?: REPLEval | undefined;
39
39
  /**
40
40
  * If `true`, specifies that the default `writer` function should include ANSI color
41
41
  * styling to REPL output. If a custom `writer` function is provided then this has no
42
42
  * effect.
43
43
  * Default: the REPL instance's `terminal` value.
44
44
  */
45
- useColors?: boolean;
45
+ useColors?: boolean | undefined;
46
46
  /**
47
47
  * If `true`, specifies that the default evaluation function will use the JavaScript
48
48
  * `global` as the context as opposed to creating a new separate context for the REPL
49
49
  * instance. The node CLI REPL sets this value to `true`.
50
50
  * Default: `false`.
51
51
  */
52
- useGlobal?: boolean;
52
+ useGlobal?: boolean | undefined;
53
53
  /**
54
54
  * If `true`, specifies that the default writer will not output the return value of a
55
55
  * command if it evaluates to `undefined`.
56
56
  * Default: `false`.
57
57
  */
58
- ignoreUndefined?: boolean;
58
+ ignoreUndefined?: boolean | undefined;
59
59
  /**
60
60
  * The function to invoke to format the output of each command before writing to `output`.
61
61
  * Default: a wrapper for `util.inspect`.
62
62
  *
63
63
  * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
64
64
  */
65
- writer?: REPLWriter;
65
+ writer?: REPLWriter | undefined;
66
66
  /**
67
67
  * An optional function used for custom Tab auto completion.
68
68
  *
69
69
  * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
70
70
  */
71
- completer?: Completer | AsyncCompleter;
71
+ completer?: Completer | AsyncCompleter | undefined;
72
72
  /**
73
73
  * A flag that specifies whether the default evaluator executes all JavaScript commands in
74
74
  * strict mode or default (sloppy) mode.
@@ -77,13 +77,13 @@ declare module 'repl' {
77
77
  * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
78
78
  * prefacing every repl statement with `'use strict'`.
79
79
  */
80
- replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
80
+ replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
81
81
  /**
82
82
  * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
83
83
  * pressed. This cannot be used together with a custom `eval` function.
84
84
  * Default: `false`.
85
85
  */
86
- breakEvalOnSigint?: boolean;
86
+ breakEvalOnSigint?: boolean | undefined;
87
87
  }
88
88
 
89
89
  type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
@@ -101,7 +101,7 @@ declare module 'repl' {
101
101
  /**
102
102
  * Help text to be displayed when `.help` is entered.
103
103
  */
104
- help?: string;
104
+ help?: string | undefined;
105
105
  /**
106
106
  * The function to execute, optionally accepting a single string argument.
107
107
  */
node v12.20/stream.d.ts CHANGED
@@ -2,19 +2,19 @@ declare module 'stream' {
2
2
  import EventEmitter = require('events');
3
3
 
4
4
  class internal extends EventEmitter {
5
- pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
5
+ pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
6
6
  }
7
7
 
8
8
  namespace internal {
9
9
  class Stream extends internal { }
10
10
 
11
11
  interface ReadableOptions {
12
- highWaterMark?: number;
13
- encoding?: string;
14
- objectMode?: boolean;
12
+ highWaterMark?: number | undefined;
13
+ encoding?: string | undefined;
14
+ objectMode?: boolean | undefined;
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
+ autoDestroy?: boolean | undefined;
18
18
  }
19
19
 
20
20
  class Readable extends Stream implements NodeJS.ReadableStream {
@@ -107,16 +107,16 @@ declare module 'stream' {
107
107
  }
108
108
 
109
109
  interface WritableOptions {
110
- highWaterMark?: number;
111
- decodeStrings?: boolean;
112
- defaultEncoding?: string;
113
- objectMode?: boolean;
114
- emitClose?: boolean;
110
+ highWaterMark?: number | undefined;
111
+ decodeStrings?: boolean | undefined;
112
+ defaultEncoding?: string | undefined;
113
+ objectMode?: boolean | undefined;
114
+ emitClose?: boolean | undefined;
115
115
  write?(this: Writable, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
116
116
  writev?(this: Writable, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
117
117
  destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
118
118
  final?(this: Writable, callback: (error?: Error | null) => void): void;
119
- autoDestroy?: boolean;
119
+ autoDestroy?: boolean | undefined;
120
120
  }
121
121
 
122
122
  class Writable extends Stream implements NodeJS.WritableStream {
@@ -210,11 +210,11 @@ declare module 'stream' {
210
210
  }
211
211
 
212
212
  interface DuplexOptions extends ReadableOptions, WritableOptions {
213
- allowHalfOpen?: boolean;
214
- readableObjectMode?: boolean;
215
- writableObjectMode?: boolean;
216
- readableHighWaterMark?: number;
217
- writableHighWaterMark?: number;
213
+ allowHalfOpen?: boolean | undefined;
214
+ readableObjectMode?: boolean | undefined;
215
+ writableObjectMode?: boolean | undefined;
216
+ readableHighWaterMark?: number | undefined;
217
+ writableHighWaterMark?: number | undefined;
218
218
  read?(this: Duplex, size: number): void;
219
219
  write?(this: Duplex, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
220
220
  writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
@@ -266,9 +266,9 @@ declare module 'stream' {
266
266
  class PassThrough extends Transform { }
267
267
 
268
268
  interface FinishedOptions {
269
- error?: boolean;
270
- readable?: boolean;
271
- writable?: boolean;
269
+ error?: boolean | undefined;
270
+ readable?: boolean | undefined;
271
+ writable?: boolean | undefined;
272
272
  }
273
273
  function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
274
274
  function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;