@types/node 12.20.13 → 12.20.17

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;
@@ -168,23 +168,23 @@ declare module 'net' {
168
168
  }
169
169
 
170
170
  interface ListenOptions {
171
- port?: number;
172
- host?: string;
173
- backlog?: number;
174
- path?: string;
175
- exclusive?: boolean;
176
- readableAll?: boolean;
177
- writableAll?: boolean;
171
+ port?: number | undefined;
172
+ host?: string | undefined;
173
+ backlog?: number | undefined;
174
+ path?: string | undefined;
175
+ exclusive?: boolean | undefined;
176
+ readableAll?: boolean | undefined;
177
+ writableAll?: boolean | undefined;
178
178
  /**
179
179
  * @default false
180
180
  */
181
- ipv6Only?: boolean;
181
+ ipv6Only?: boolean | undefined;
182
182
  }
183
183
 
184
184
  // https://github.com/nodejs/node/blob/master/lib/net.js
185
185
  class Server extends EventEmitter {
186
186
  constructor(connectionListener?: (socket: Socket) => void);
187
- constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
187
+ constructor(options?: { allowHalfOpen?: boolean | undefined, pauseOnConnect?: boolean | undefined }, connectionListener?: (socket: Socket) => void);
188
188
 
189
189
  listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
190
190
  listen(port?: number, hostname?: string, listeningListener?: () => void): this;
@@ -249,17 +249,17 @@ declare module 'net' {
249
249
  }
250
250
 
251
251
  interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
252
- timeout?: number;
252
+ timeout?: number | undefined;
253
253
  }
254
254
 
255
255
  interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
256
- timeout?: number;
256
+ timeout?: number | undefined;
257
257
  }
258
258
 
259
259
  type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
260
260
 
261
261
  function createServer(connectionListener?: (socket: Socket) => void): Server;
262
- function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
262
+ function createServer(options?: { allowHalfOpen?: boolean | undefined, pauseOnConnect?: boolean | undefined }, connectionListener?: (socket: Socket) => void): Server;
263
263
  function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
264
264
  function connect(port: number, host?: string, connectionListener?: () => void): Socket;
265
265
  function connect(path: string, connectionListener?: () => void): Socket;
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.20.13",
3
+ "version": "12.20.17",
4
4
  "description": "TypeScript definitions for Node.js",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
5
6
  "license": "MIT",
6
7
  "contributors": [
7
8
  {
@@ -206,6 +207,6 @@
206
207
  },
207
208
  "scripts": {},
208
209
  "dependencies": {},
209
- "typesPublisherContentHash": "0bfd0d8c2bb28d5b12b7e3e14b8cdb5ea97fdce0381b1760b5b2a48f625ba5fe",
210
- "typeScriptVersion": "3.5"
210
+ "typesPublisherContentHash": "03ad51e0fae8319fed49fd88e752a5d29156ac54196b416d61da70af5a27e0e0",
211
+ "typeScriptVersion": "3.6"
211
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 {
@@ -112,7 +112,7 @@ declare module 'perf_hooks' {
112
112
  * @param startMark
113
113
  * @param endMark
114
114
  */
115
- measure(name: string, startMark: string, endMark: string): void;
115
+ measure(name: string, startMark?: string, endMark?: string): void;
116
116
 
117
117
  /**
118
118
  * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
@@ -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;