@types/node 16.0.0 → 16.0.1
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 +1 -1
- node/assert.d.ts +5 -5
- node/async_hooks.d.ts +2 -2
- node/buffer.d.ts +2 -2
- node/child_process.d.ts +49 -49
- node/cluster.d.ts +10 -10
- node/console.d.ts +4 -4
- node/crypto.d.ts +61 -61
- node/dgram.d.ts +9 -9
- node/dns.d.ts +11 -11
- node/events.d.ts +3 -3
- node/fs/promises.d.ts +21 -17
- node/fs.d.ts +64 -60
- node/globals.d.ts +8 -8
- node/http.d.ts +97 -97
- node/http2.d.ts +65 -65
- node/https.d.ts +4 -4
- node/inspector.d.ts +148 -148
- node/net.d.ts +30 -30
- node/package.json +2 -2
- node/path.d.ts +5 -5
- node/perf_hooks.d.ts +14 -14
- node/process.d.ts +13 -13
- node/querystring.d.ts +3 -3
- node/readline.d.ts +15 -15
- node/repl.d.ts +14 -14
- node/stream.d.ts +17 -17
- node/timers.d.ts +1 -1
- node/tls.d.ts +50 -50
- node/url.d.ts +15 -15
- node/util.d.ts +13 -13
- node/vm.d.ts +24 -24
- node/wasi.d.ts +7 -7
- node/worker_threads.d.ts +15 -15
- node/zlib.d.ts +16 -16
node/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;
|
|
@@ -169,17 +169,17 @@ declare module 'net' {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
interface ListenOptions extends Abortable {
|
|
172
|
-
port?: number;
|
|
173
|
-
host?: string;
|
|
174
|
-
backlog?: number;
|
|
175
|
-
path?: string;
|
|
176
|
-
exclusive?: boolean;
|
|
177
|
-
readableAll?: boolean;
|
|
178
|
-
writableAll?: boolean;
|
|
172
|
+
port?: number | undefined;
|
|
173
|
+
host?: string | undefined;
|
|
174
|
+
backlog?: number | undefined;
|
|
175
|
+
path?: string | undefined;
|
|
176
|
+
exclusive?: boolean | undefined;
|
|
177
|
+
readableAll?: boolean | undefined;
|
|
178
|
+
writableAll?: boolean | undefined;
|
|
179
179
|
/**
|
|
180
180
|
* @default false
|
|
181
181
|
*/
|
|
182
|
-
ipv6Only?: boolean;
|
|
182
|
+
ipv6Only?: boolean | undefined;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
interface ServerOpts {
|
|
@@ -187,13 +187,13 @@ declare module 'net' {
|
|
|
187
187
|
* Indicates whether half-opened TCP connections are allowed.
|
|
188
188
|
* @default false
|
|
189
189
|
*/
|
|
190
|
-
allowHalfOpen?: boolean;
|
|
190
|
+
allowHalfOpen?: boolean | undefined;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Indicates whether the socket should be paused on incoming connections.
|
|
194
194
|
* @default false
|
|
195
195
|
*/
|
|
196
|
-
pauseOnConnect?: boolean;
|
|
196
|
+
pauseOnConnect?: boolean | undefined;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// https://github.com/nodejs/node/blob/master/lib/net.js
|
|
@@ -307,11 +307,11 @@ declare module 'net' {
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
|
310
|
-
timeout?: number;
|
|
310
|
+
timeout?: number | undefined;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
|
|
314
|
-
timeout?: number;
|
|
314
|
+
timeout?: number | undefined;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
|
|
@@ -333,21 +333,21 @@ declare module 'net' {
|
|
|
333
333
|
* The network address as either an IPv4 or IPv6 string.
|
|
334
334
|
* @default 127.0.0.1
|
|
335
335
|
*/
|
|
336
|
-
address?: string;
|
|
336
|
+
address?: string | undefined;
|
|
337
337
|
/**
|
|
338
338
|
* @default `'ipv4'`
|
|
339
339
|
*/
|
|
340
|
-
family?: IPVersion;
|
|
340
|
+
family?: IPVersion | undefined;
|
|
341
341
|
/**
|
|
342
342
|
* An IPv6 flow-label used only if `family` is `'ipv6'`.
|
|
343
343
|
* @default 0
|
|
344
344
|
*/
|
|
345
|
-
flowlabel?: number;
|
|
345
|
+
flowlabel?: number | undefined;
|
|
346
346
|
/**
|
|
347
347
|
* An IP port.
|
|
348
348
|
* @default 0
|
|
349
349
|
*/
|
|
350
|
-
port?: number;
|
|
350
|
+
port?: number | undefined;
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
// TODO: Mark as clonable if `kClone` symbol is set in node.
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -227,6 +227,6 @@
|
|
|
227
227
|
},
|
|
228
228
|
"scripts": {},
|
|
229
229
|
"dependencies": {},
|
|
230
|
-
"typesPublisherContentHash": "
|
|
230
|
+
"typesPublisherContentHash": "439cbcc286cf9e49d4bb3d391b53e338b23d39ce5de6ced5355197c306990b02",
|
|
231
231
|
"typeScriptVersion": "3.6"
|
|
232
232
|
}
|
node/path.d.ts
CHANGED
|
@@ -40,23 +40,23 @@ declare module 'path' {
|
|
|
40
40
|
/**
|
|
41
41
|
* The root of the path such as '/' or 'c:\'
|
|
42
42
|
*/
|
|
43
|
-
root?: string;
|
|
43
|
+
root?: string | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* The full directory path such as '/home/user/dir' or 'c:\path\dir'
|
|
46
46
|
*/
|
|
47
|
-
dir?: string;
|
|
47
|
+
dir?: string | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* The file name including extension (if any) such as 'index.html'
|
|
50
50
|
*/
|
|
51
|
-
base?: string;
|
|
51
|
+
base?: string | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* The file extension (if any) such as '.html'
|
|
54
54
|
*/
|
|
55
|
-
ext?: string;
|
|
55
|
+
ext?: string | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* The file name without extension (if any) such as 'index'
|
|
58
58
|
*/
|
|
59
|
-
name?: string;
|
|
59
|
+
name?: string | undefined;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
interface PlatformPath {
|
node/perf_hooks.d.ts
CHANGED
|
@@ -9,14 +9,14 @@ declare module 'perf_hooks' {
|
|
|
9
9
|
* the type of garbage collection operation that occurred.
|
|
10
10
|
* See perf_hooks.constants for valid values.
|
|
11
11
|
*/
|
|
12
|
-
readonly kind?: number;
|
|
12
|
+
readonly kind?: number | undefined;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
|
|
16
16
|
* property contains additional information about garbage collection operation.
|
|
17
17
|
* See perf_hooks.constants for valid values.
|
|
18
18
|
*/
|
|
19
|
-
readonly flags?: number;
|
|
19
|
+
readonly flags?: number | undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
class PerformanceEntry {
|
|
@@ -43,7 +43,7 @@ declare module 'perf_hooks' {
|
|
|
43
43
|
*/
|
|
44
44
|
readonly entryType: EntryType;
|
|
45
45
|
|
|
46
|
-
readonly details?: NodeGCPerformanceDetail | unknown; // TODO: Narrow this based on entry type.
|
|
46
|
+
readonly details?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
class PerformanceNodeTiming extends PerformanceEntry {
|
|
@@ -102,31 +102,31 @@ declare module 'perf_hooks' {
|
|
|
102
102
|
/**
|
|
103
103
|
* Additional optional detail to include with the mark.
|
|
104
104
|
*/
|
|
105
|
-
detail?: unknown;
|
|
105
|
+
detail?: unknown | undefined;
|
|
106
106
|
/**
|
|
107
107
|
* An optional timestamp to be used as the mark time.
|
|
108
108
|
* @default `performance.now()`.
|
|
109
109
|
*/
|
|
110
|
-
startTime?: number;
|
|
110
|
+
startTime?: number | undefined;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
interface MeasureOptions {
|
|
114
114
|
/**
|
|
115
115
|
* Additional optional detail to include with the mark.
|
|
116
116
|
*/
|
|
117
|
-
detail?: unknown;
|
|
117
|
+
detail?: unknown | undefined;
|
|
118
118
|
/**
|
|
119
119
|
* Duration between start and end times.
|
|
120
120
|
*/
|
|
121
|
-
duration?: number;
|
|
121
|
+
duration?: number | undefined;
|
|
122
122
|
/**
|
|
123
123
|
* Timestamp to be used as the end time, or a string identifying a previously recorded mark.
|
|
124
124
|
*/
|
|
125
|
-
end?: number | string;
|
|
125
|
+
end?: number | string | undefined;
|
|
126
126
|
/**
|
|
127
127
|
* Timestamp to be used as the start time, or a string identifying a previously recorded mark.
|
|
128
128
|
*/
|
|
129
|
-
start?: number | string;
|
|
129
|
+
start?: number | string | undefined;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
interface TimerifyOptions {
|
|
@@ -135,7 +135,7 @@ declare module 'perf_hooks' {
|
|
|
135
135
|
* `perf_hooks.createHistogram()` that will record runtime durations in
|
|
136
136
|
* nanoseconds.
|
|
137
137
|
*/
|
|
138
|
-
histogram?: RecordableHistogram;
|
|
138
|
+
histogram?: RecordableHistogram | undefined;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
interface Performance {
|
|
@@ -262,7 +262,7 @@ declare module 'perf_hooks' {
|
|
|
262
262
|
* Must be greater than zero.
|
|
263
263
|
* @default 10
|
|
264
264
|
*/
|
|
265
|
-
resolution?: number;
|
|
265
|
+
resolution?: number | undefined;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
interface Histogram {
|
|
@@ -335,18 +335,18 @@ declare module 'perf_hooks' {
|
|
|
335
335
|
* The minimum recordable value. Must be an integer value greater than 0.
|
|
336
336
|
* @default 1
|
|
337
337
|
*/
|
|
338
|
-
min?: number | bigint;
|
|
338
|
+
min?: number | bigint | undefined;
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
341
|
* The maximum recordable value. Must be an integer value greater than min.
|
|
342
342
|
* @default Number.MAX_SAFE_INTEGER
|
|
343
343
|
*/
|
|
344
|
-
max?: number | bigint;
|
|
344
|
+
max?: number | bigint | undefined;
|
|
345
345
|
/**
|
|
346
346
|
* The number of accuracy digits. Must be a number between 1 and 5.
|
|
347
347
|
* @default 3
|
|
348
348
|
*/
|
|
349
|
-
figures?: number;
|
|
349
|
+
figures?: number | undefined;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
node/process.d.ts
CHANGED
|
@@ -38,10 +38,10 @@ declare module 'process' {
|
|
|
38
38
|
|
|
39
39
|
interface ProcessRelease {
|
|
40
40
|
name: string;
|
|
41
|
-
sourceUrl?: string;
|
|
42
|
-
headersUrl?: string;
|
|
43
|
-
libUrl?: string;
|
|
44
|
-
lts?: string;
|
|
41
|
+
sourceUrl?: string | undefined;
|
|
42
|
+
headersUrl?: string | undefined;
|
|
43
|
+
libUrl?: string | undefined;
|
|
44
|
+
lts?: string | undefined;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
interface ProcessVersions extends Dict<string> {
|
|
@@ -89,7 +89,7 @@ declare module 'process' {
|
|
|
89
89
|
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
|
|
90
90
|
|
|
91
91
|
interface Socket extends ReadWriteStream {
|
|
92
|
-
isTTY?: true;
|
|
92
|
+
isTTY?: true | undefined;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// Alias for compatibility
|
|
@@ -190,24 +190,24 @@ declare module 'process' {
|
|
|
190
190
|
*
|
|
191
191
|
* @default 'Warning'
|
|
192
192
|
*/
|
|
193
|
-
type?: string;
|
|
193
|
+
type?: string | undefined;
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* A unique identifier for the warning instance being emitted.
|
|
197
197
|
*/
|
|
198
|
-
code?: string;
|
|
198
|
+
code?: string | undefined;
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
|
|
202
202
|
*
|
|
203
203
|
* @default process.emitWarning
|
|
204
204
|
*/
|
|
205
|
-
ctor?: Function;
|
|
205
|
+
ctor?: Function | undefined;
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
208
|
* Additional text to include with the error.
|
|
209
209
|
*/
|
|
210
|
-
detail?: string;
|
|
210
|
+
detail?: string | undefined;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
interface ProcessConfig {
|
|
@@ -280,7 +280,7 @@ declare module 'process' {
|
|
|
280
280
|
|
|
281
281
|
env: ProcessEnv;
|
|
282
282
|
exit(code?: number): never;
|
|
283
|
-
exitCode?: number;
|
|
283
|
+
exitCode?: number | undefined;
|
|
284
284
|
getgid(): number;
|
|
285
285
|
setgid(id: number | string): void;
|
|
286
286
|
getuid(): number;
|
|
@@ -303,7 +303,7 @@ declare module 'process' {
|
|
|
303
303
|
readonly arch: string;
|
|
304
304
|
readonly platform: Platform;
|
|
305
305
|
/** @deprecated since v14.0.0 - use `require.main` instead. */
|
|
306
|
-
mainModule?: Module;
|
|
306
|
+
mainModule?: Module | undefined;
|
|
307
307
|
memoryUsage: MemoryUsageFn;
|
|
308
308
|
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
309
309
|
nextTick(callback: Function, ...args: any[]): void;
|
|
@@ -332,7 +332,7 @@ declare module 'process' {
|
|
|
332
332
|
hrtime: HRTime;
|
|
333
333
|
|
|
334
334
|
// Worker
|
|
335
|
-
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
|
|
335
|
+
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean | undefined}, callback?: (error: Error | null) => void): boolean;
|
|
336
336
|
disconnect(): void;
|
|
337
337
|
connected: boolean;
|
|
338
338
|
|
|
@@ -346,7 +346,7 @@ declare module 'process' {
|
|
|
346
346
|
/**
|
|
347
347
|
* Only available with `--experimental-report`
|
|
348
348
|
*/
|
|
349
|
-
report?: ProcessReport;
|
|
349
|
+
report?: ProcessReport | undefined;
|
|
350
350
|
|
|
351
351
|
resourceUsage(): ResourceUsage;
|
|
352
352
|
|
node/querystring.d.ts
CHANGED
|
@@ -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[]> { }
|
node/readline.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ declare module 'readline' {
|
|
|
2
2
|
import { Abortable, EventEmitter } from '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 {
|
|
@@ -138,28 +138,28 @@ declare module 'readline' {
|
|
|
138
138
|
|
|
139
139
|
interface ReadLineOptions {
|
|
140
140
|
input: NodeJS.ReadableStream;
|
|
141
|
-
output?: NodeJS.WritableStream;
|
|
142
|
-
completer?: Completer | AsyncCompleter;
|
|
143
|
-
terminal?: boolean;
|
|
141
|
+
output?: NodeJS.WritableStream | undefined;
|
|
142
|
+
completer?: Completer | AsyncCompleter | undefined;
|
|
143
|
+
terminal?: boolean | undefined;
|
|
144
144
|
/**
|
|
145
145
|
* Initial list of history lines. This option makes sense
|
|
146
146
|
* only if `terminal` is set to `true` by the user or by an internal `output`
|
|
147
147
|
* check, otherwise the history caching mechanism is not initialized at all.
|
|
148
148
|
* @default []
|
|
149
149
|
*/
|
|
150
|
-
history?: string[];
|
|
151
|
-
historySize?: number;
|
|
152
|
-
prompt?: string;
|
|
153
|
-
crlfDelay?: number;
|
|
150
|
+
history?: string[] | undefined;
|
|
151
|
+
historySize?: number | undefined;
|
|
152
|
+
prompt?: string | undefined;
|
|
153
|
+
crlfDelay?: number | undefined;
|
|
154
154
|
/**
|
|
155
155
|
* If `true`, when a new input line added
|
|
156
156
|
* to the history list duplicates an older one, this removes the older line
|
|
157
157
|
* from the list.
|
|
158
158
|
* @default false
|
|
159
159
|
*/
|
|
160
|
-
removeHistoryDuplicates?: boolean;
|
|
161
|
-
escapeCodeTimeout?: number;
|
|
162
|
-
tabSize?: number;
|
|
160
|
+
removeHistoryDuplicates?: boolean | undefined;
|
|
161
|
+
escapeCodeTimeout?: number | undefined;
|
|
162
|
+
tabSize?: number | undefined;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
|
node/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/stream.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare module 'stream' {
|
|
|
3
3
|
import * as streamPromises from "stream/promises";
|
|
4
4
|
|
|
5
5
|
class internal extends EventEmitter {
|
|
6
|
-
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
|
6
|
+
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
namespace internal {
|
|
@@ -12,16 +12,16 @@ declare module 'stream' {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface StreamOptions<T extends Stream> extends Abortable {
|
|
15
|
-
emitClose?: boolean;
|
|
16
|
-
highWaterMark?: number;
|
|
17
|
-
objectMode?: boolean;
|
|
15
|
+
emitClose?: boolean | undefined;
|
|
16
|
+
highWaterMark?: number | undefined;
|
|
17
|
+
objectMode?: boolean | undefined;
|
|
18
18
|
construct?(this: T, callback: (error?: Error | null) => void): void;
|
|
19
19
|
destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void;
|
|
20
|
-
autoDestroy?: boolean;
|
|
20
|
+
autoDestroy?: boolean | undefined;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface ReadableOptions extends StreamOptions<Readable> {
|
|
24
|
-
encoding?: BufferEncoding;
|
|
24
|
+
encoding?: BufferEncoding | undefined;
|
|
25
25
|
read?(this: Readable, size: number): void;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -132,8 +132,8 @@ declare module 'stream' {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
interface WritableOptions extends StreamOptions<Writable> {
|
|
135
|
-
decodeStrings?: boolean;
|
|
136
|
-
defaultEncoding?: BufferEncoding;
|
|
135
|
+
decodeStrings?: boolean | undefined;
|
|
136
|
+
defaultEncoding?: BufferEncoding | undefined;
|
|
137
137
|
write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
138
138
|
writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void;
|
|
139
139
|
final?(this: Writable, callback: (error?: Error | null) => void): void;
|
|
@@ -232,12 +232,12 @@ declare module 'stream' {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
interface DuplexOptions extends ReadableOptions, WritableOptions {
|
|
235
|
-
allowHalfOpen?: boolean;
|
|
236
|
-
readableObjectMode?: boolean;
|
|
237
|
-
writableObjectMode?: boolean;
|
|
238
|
-
readableHighWaterMark?: number;
|
|
239
|
-
writableHighWaterMark?: number;
|
|
240
|
-
writableCorked?: number;
|
|
235
|
+
allowHalfOpen?: boolean | undefined;
|
|
236
|
+
readableObjectMode?: boolean | undefined;
|
|
237
|
+
writableObjectMode?: boolean | undefined;
|
|
238
|
+
readableHighWaterMark?: number | undefined;
|
|
239
|
+
writableHighWaterMark?: number | undefined;
|
|
240
|
+
writableCorked?: number | undefined;
|
|
241
241
|
construct?(this: Duplex, callback: (error?: Error | null) => void): void;
|
|
242
242
|
read?(this: Duplex, size: number): void;
|
|
243
243
|
write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
|
|
@@ -302,9 +302,9 @@ declare module 'stream' {
|
|
|
302
302
|
function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
|
|
303
303
|
|
|
304
304
|
interface FinishedOptions extends Abortable {
|
|
305
|
-
error?: boolean;
|
|
306
|
-
readable?: boolean;
|
|
307
|
-
writable?: boolean;
|
|
305
|
+
error?: boolean | undefined;
|
|
306
|
+
readable?: boolean | undefined;
|
|
307
|
+
writable?: boolean | undefined;
|
|
308
308
|
}
|
|
309
309
|
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
|
|
310
310
|
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
|