@types/node 14.17.3 → 14.17.7

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 v14.17/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 {
@@ -87,9 +87,9 @@ declare module 'net' {
87
87
  readonly destroyed: boolean;
88
88
  readonly localAddress: string;
89
89
  readonly localPort: number;
90
- readonly remoteAddress?: string;
91
- readonly remoteFamily?: string;
92
- readonly remotePort?: number;
90
+ readonly remoteAddress?: string | undefined;
91
+ readonly remoteFamily?: string | undefined;
92
+ readonly remotePort?: number | undefined;
93
93
 
94
94
  // Extended base methods
95
95
  end(cb?: () => void): void;
@@ -115,6 +115,7 @@ declare module 'net' {
115
115
  addListener(event: "end", listener: () => void): this;
116
116
  addListener(event: "error", listener: (err: Error) => void): this;
117
117
  addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
118
+ addListener(event: "ready", listener: () => void): this;
118
119
  addListener(event: "timeout", listener: () => void): this;
119
120
 
120
121
  emit(event: string | symbol, ...args: any[]): boolean;
@@ -125,6 +126,7 @@ declare module 'net' {
125
126
  emit(event: "end"): boolean;
126
127
  emit(event: "error", err: Error): boolean;
127
128
  emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
129
+ emit(event: "ready"): boolean;
128
130
  emit(event: "timeout"): boolean;
129
131
 
130
132
  on(event: string, listener: (...args: any[]) => void): this;
@@ -135,6 +137,7 @@ declare module 'net' {
135
137
  on(event: "end", listener: () => void): this;
136
138
  on(event: "error", listener: (err: Error) => void): this;
137
139
  on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
140
+ on(event: "ready", listener: () => void): this;
138
141
  on(event: "timeout", listener: () => void): this;
139
142
 
140
143
  once(event: string, listener: (...args: any[]) => void): this;
@@ -145,6 +148,7 @@ declare module 'net' {
145
148
  once(event: "end", listener: () => void): this;
146
149
  once(event: "error", listener: (err: Error) => void): this;
147
150
  once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
151
+ once(event: "ready", listener: () => void): this;
148
152
  once(event: "timeout", listener: () => void): this;
149
153
 
150
154
  prependListener(event: string, listener: (...args: any[]) => void): this;
@@ -155,6 +159,7 @@ declare module 'net' {
155
159
  prependListener(event: "end", listener: () => void): this;
156
160
  prependListener(event: "error", listener: (err: Error) => void): this;
157
161
  prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
162
+ prependListener(event: "ready", listener: () => void): this;
158
163
  prependListener(event: "timeout", listener: () => void): this;
159
164
 
160
165
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
@@ -165,21 +170,22 @@ declare module 'net' {
165
170
  prependOnceListener(event: "end", listener: () => void): this;
166
171
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
167
172
  prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
173
+ prependOnceListener(event: "ready", listener: () => void): this;
168
174
  prependOnceListener(event: "timeout", listener: () => void): this;
169
175
  }
170
176
 
171
177
  interface ListenOptions {
172
- port?: number;
173
- host?: string;
174
- backlog?: number;
175
- path?: string;
176
- exclusive?: boolean;
177
- readableAll?: boolean;
178
- writableAll?: boolean;
178
+ port?: number | undefined;
179
+ host?: string | undefined;
180
+ backlog?: number | undefined;
181
+ path?: string | undefined;
182
+ exclusive?: boolean | undefined;
183
+ readableAll?: boolean | undefined;
184
+ writableAll?: boolean | undefined;
179
185
  /**
180
186
  * @default false
181
187
  */
182
- ipv6Only?: boolean;
188
+ ipv6Only?: boolean | undefined;
183
189
  }
184
190
 
185
191
  interface ServerOpts {
@@ -187,13 +193,13 @@ declare module 'net' {
187
193
  * Indicates whether half-opened TCP connections are allowed.
188
194
  * @default false
189
195
  */
190
- allowHalfOpen?: boolean;
196
+ allowHalfOpen?: boolean | undefined;
191
197
 
192
198
  /**
193
199
  * Indicates whether the socket should be paused on incoming connections.
194
200
  * @default false
195
201
  */
196
- pauseOnConnect?: boolean;
202
+ pauseOnConnect?: boolean | undefined;
197
203
  }
198
204
 
199
205
  // https://github.com/nodejs/node/blob/master/lib/net.js
@@ -264,11 +270,11 @@ declare module 'net' {
264
270
  }
265
271
 
266
272
  interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
267
- timeout?: number;
273
+ timeout?: number | undefined;
268
274
  }
269
275
 
270
276
  interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
271
- timeout?: number;
277
+ timeout?: number | undefined;
272
278
  }
273
279
 
274
280
  type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.17.3",
3
+ "version": "14.17.7",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "21b80964aacace964d05159c9f156d5179d213c02067527da6017a0ffed88eb4",
235
+ "typesPublisherContentHash": "3875b3e05e0f1b762571e0756d27ebb7f8595eb9534690304edaf97f148d7e6d",
236
236
  "typeScriptVersion": "3.6"
237
237
  }
node v14.17/path.d.ts CHANGED
@@ -30,23 +30,23 @@ declare module 'path' {
30
30
  /**
31
31
  * The root of the path such as '/' or 'c:\'
32
32
  */
33
- root?: string;
33
+ root?: string | undefined;
34
34
  /**
35
35
  * The full directory path such as '/home/user/dir' or 'c:\path\dir'
36
36
  */
37
- dir?: string;
37
+ dir?: string | undefined;
38
38
  /**
39
39
  * The file name including extension (if any) such as 'index.html'
40
40
  */
41
- base?: string;
41
+ base?: string | undefined;
42
42
  /**
43
43
  * The file extension (if any) such as '.html'
44
44
  */
45
- ext?: string;
45
+ ext?: string | undefined;
46
46
  /**
47
47
  * The file name without extension (if any) such as 'index'
48
48
  */
49
- name?: string;
49
+ name?: string | undefined;
50
50
  }
51
51
 
52
52
  interface PlatformPath {
@@ -31,14 +31,14 @@ declare module 'perf_hooks' {
31
31
  * the type of garbage collection operation that occurred.
32
32
  * See perf_hooks.constants for valid values.
33
33
  */
34
- readonly kind?: number;
34
+ readonly kind?: number | undefined;
35
35
 
36
36
  /**
37
37
  * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
38
38
  * property contains additional information about garbage collection operation.
39
39
  * See perf_hooks.constants for valid values.
40
40
  */
41
- readonly flags?: number;
41
+ readonly flags?: number | undefined;
42
42
  }
43
43
 
44
44
  interface PerformanceNodeTiming extends PerformanceEntry {
@@ -186,7 +186,7 @@ declare module 'perf_hooks' {
186
186
  * Property buffered defaults to false.
187
187
  * @param options
188
188
  */
189
- observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
189
+ observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean | undefined }): void;
190
190
  }
191
191
 
192
192
  namespace constants {
@@ -212,7 +212,7 @@ declare module 'perf_hooks' {
212
212
  * Must be greater than zero.
213
213
  * @default 10
214
214
  */
215
- resolution?: number;
215
+ resolution?: number | undefined;
216
216
  }
217
217
 
218
218
  interface EventLoopDelayMonitor {
@@ -26,10 +26,10 @@ declare module 'process' {
26
26
 
27
27
  interface ProcessRelease {
28
28
  name: string;
29
- sourceUrl?: string;
30
- headersUrl?: string;
31
- libUrl?: string;
32
- lts?: string;
29
+ sourceUrl?: string | undefined;
30
+ headersUrl?: string | undefined;
31
+ libUrl?: string | undefined;
32
+ lts?: string | undefined;
33
33
  }
34
34
 
35
35
  interface ProcessVersions extends Dict<string> {
@@ -76,7 +76,7 @@ declare module 'process' {
76
76
  type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
77
77
 
78
78
  interface Socket extends ReadWriteStream {
79
- isTTY?: true;
79
+ isTTY?: true | undefined;
80
80
  }
81
81
 
82
82
  // Alias for compatibility
@@ -199,7 +199,7 @@ declare module 'process' {
199
199
  emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
200
200
  env: ProcessEnv;
201
201
  exit(code?: number): never;
202
- exitCode?: number;
202
+ exitCode?: number | undefined;
203
203
  getgid(): number;
204
204
  setgid(id: number | string): void;
205
205
  getuid(): number;
@@ -247,7 +247,7 @@ declare module 'process' {
247
247
  arch: string;
248
248
  platform: Platform;
249
249
  /** @deprecated since v14.0.0 - use `require.main` instead. */
250
- mainModule?: Module;
250
+ mainModule?: Module | undefined;
251
251
  memoryUsage(): MemoryUsage;
252
252
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
253
253
  nextTick(callback: Function, ...args: any[]): void;
@@ -277,7 +277,7 @@ declare module 'process' {
277
277
  domain: Domain;
278
278
 
279
279
  // Worker
280
- send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
280
+ send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean | undefined}, callback?: (error: Error | null) => void): boolean;
281
281
  disconnect(): void;
282
282
  connected: boolean;
283
283
 
@@ -291,7 +291,7 @@ declare module 'process' {
291
291
  /**
292
292
  * Only available with `--experimental-report`
293
293
  */
294
- report?: ProcessReport;
294
+ report?: ProcessReport | undefined;
295
295
 
296
296
  resourceUsage(): ResourceUsage;
297
297
 
@@ -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 extends NodeJS.Dict<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 {
@@ -129,15 +129,15 @@ declare module 'readline' {
129
129
 
130
130
  interface ReadLineOptions {
131
131
  input: NodeJS.ReadableStream;
132
- output?: NodeJS.WritableStream;
133
- completer?: Completer | AsyncCompleter;
134
- terminal?: boolean;
135
- historySize?: number;
136
- prompt?: string;
137
- crlfDelay?: number;
138
- removeHistoryDuplicates?: boolean;
139
- escapeCodeTimeout?: number;
140
- tabSize?: number;
132
+ output?: NodeJS.WritableStream | undefined;
133
+ completer?: Completer | AsyncCompleter | undefined;
134
+ terminal?: boolean | undefined;
135
+ historySize?: number | undefined;
136
+ prompt?: string | undefined;
137
+ crlfDelay?: number | undefined;
138
+ removeHistoryDuplicates?: boolean | undefined;
139
+ escapeCodeTimeout?: number | undefined;
140
+ tabSize?: number | undefined;
141
141
  }
142
142
 
143
143
  function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
node v14.17/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,45 +35,45 @@ 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
  * Defines if the repl prints output previews or not.
41
41
  * @default `true` Always `false` in case `terminal` is falsy.
42
42
  */
43
- preview?: boolean;
43
+ preview?: boolean | undefined;
44
44
  /**
45
45
  * If `true`, specifies that the default `writer` function should include ANSI color
46
46
  * styling to REPL output. If a custom `writer` function is provided then this has no
47
47
  * effect.
48
48
  * Default: the REPL instance's `terminal` value.
49
49
  */
50
- useColors?: boolean;
50
+ useColors?: boolean | undefined;
51
51
  /**
52
52
  * If `true`, specifies that the default evaluation function will use the JavaScript
53
53
  * `global` as the context as opposed to creating a new separate context for the REPL
54
54
  * instance. The node CLI REPL sets this value to `true`.
55
55
  * Default: `false`.
56
56
  */
57
- useGlobal?: boolean;
57
+ useGlobal?: boolean | undefined;
58
58
  /**
59
59
  * If `true`, specifies that the default writer will not output the return value of a
60
60
  * command if it evaluates to `undefined`.
61
61
  * Default: `false`.
62
62
  */
63
- ignoreUndefined?: boolean;
63
+ ignoreUndefined?: boolean | undefined;
64
64
  /**
65
65
  * The function to invoke to format the output of each command before writing to `output`.
66
66
  * Default: a wrapper for `util.inspect`.
67
67
  *
68
68
  * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
69
69
  */
70
- writer?: REPLWriter;
70
+ writer?: REPLWriter | undefined;
71
71
  /**
72
72
  * An optional function used for custom Tab auto completion.
73
73
  *
74
74
  * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
75
75
  */
76
- completer?: Completer | AsyncCompleter;
76
+ completer?: Completer | AsyncCompleter | undefined;
77
77
  /**
78
78
  * A flag that specifies whether the default evaluator executes all JavaScript commands in
79
79
  * strict mode or default (sloppy) mode.
@@ -82,13 +82,13 @@ declare module 'repl' {
82
82
  * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
83
83
  * prefacing every repl statement with `'use strict'`.
84
84
  */
85
- replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
85
+ replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined;
86
86
  /**
87
87
  * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
88
88
  * pressed. This cannot be used together with a custom `eval` function.
89
89
  * Default: `false`.
90
90
  */
91
- breakEvalOnSigint?: boolean;
91
+ breakEvalOnSigint?: boolean | undefined;
92
92
  }
93
93
 
94
94
  type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
@@ -106,7 +106,7 @@ declare module 'repl' {
106
106
  /**
107
107
  * Help text to be displayed when `.help` is entered.
108
108
  */
109
- help?: string;
109
+ help?: string | undefined;
110
110
  /**
111
111
  * The function to execute, optionally accepting a single string argument.
112
112
  */
node v14.17/stream.d.ts CHANGED
@@ -2,7 +2,7 @@ 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 {
@@ -11,12 +11,12 @@ declare module 'stream' {
11
11
  }
12
12
 
13
13
  interface ReadableOptions {
14
- highWaterMark?: number;
15
- encoding?: BufferEncoding;
16
- objectMode?: boolean;
14
+ highWaterMark?: number | undefined;
15
+ encoding?: BufferEncoding | undefined;
16
+ objectMode?: boolean | undefined;
17
17
  read?(this: Readable, size: number): void;
18
18
  destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void;
19
- autoDestroy?: boolean;
19
+ autoDestroy?: boolean | undefined;
20
20
  }
21
21
 
22
22
  class Readable extends Stream implements NodeJS.ReadableStream {
@@ -125,16 +125,16 @@ declare module 'stream' {
125
125
  }
126
126
 
127
127
  interface WritableOptions {
128
- highWaterMark?: number;
129
- decodeStrings?: boolean;
130
- defaultEncoding?: BufferEncoding;
131
- objectMode?: boolean;
132
- emitClose?: boolean;
128
+ highWaterMark?: number | undefined;
129
+ decodeStrings?: boolean | undefined;
130
+ defaultEncoding?: BufferEncoding | undefined;
131
+ objectMode?: boolean | undefined;
132
+ emitClose?: boolean | undefined;
133
133
  write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
134
134
  writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
135
135
  destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
136
136
  final?(this: Writable, callback: (error?: Error | null) => void): void;
137
- autoDestroy?: boolean;
137
+ autoDestroy?: boolean | undefined;
138
138
  }
139
139
 
140
140
  class Writable extends Stream implements NodeJS.WritableStream {
@@ -229,12 +229,12 @@ declare module 'stream' {
229
229
  }
230
230
 
231
231
  interface DuplexOptions extends ReadableOptions, WritableOptions {
232
- allowHalfOpen?: boolean;
233
- readableObjectMode?: boolean;
234
- writableObjectMode?: boolean;
235
- readableHighWaterMark?: number;
236
- writableHighWaterMark?: number;
237
- writableCorked?: number;
232
+ allowHalfOpen?: boolean | undefined;
233
+ readableObjectMode?: boolean | undefined;
234
+ writableObjectMode?: boolean | undefined;
235
+ readableHighWaterMark?: number | undefined;
236
+ writableHighWaterMark?: number | undefined;
237
+ writableCorked?: number | undefined;
238
238
  read?(this: Duplex, size: number): void;
239
239
  write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
240
240
  writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
@@ -287,9 +287,9 @@ declare module 'stream' {
287
287
  class PassThrough extends Transform { }
288
288
 
289
289
  interface FinishedOptions {
290
- error?: boolean;
291
- readable?: boolean;
292
- writable?: boolean;
290
+ error?: boolean | undefined;
291
+ readable?: boolean | undefined;
292
+ writable?: boolean | undefined;
293
293
  }
294
294
  function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
295
295
  function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;