@types/node 14.18.8 → 15.0.2
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.18 → node}/LICENSE +0 -0
- node/README.md +16 -0
- node/assert/strict.d.ts +4 -0
- node v14.18/assert.d.ts → node/assert.d.ts +3 -7
- node v14.18/async_hooks.d.ts → node/async_hooks.d.ts +4 -7
- node/base.d.ts +19 -0
- node/buffer.d.ts +22 -0
- node v14.18/child_process.d.ts → node/child_process.d.ts +63 -67
- node v14.18/cluster.d.ts → node/cluster.d.ts +10 -13
- node v14.18/console.d.ts → node/console.d.ts +13 -22
- node v14.18/constants.d.ts → node/constants.d.ts +0 -5
- node v14.18/crypto.d.ts → node/crypto.d.ts +134 -53
- node v14.18/dgram.d.ts → node/dgram.d.ts +17 -20
- node/dns/promises.d.ts +97 -0
- node/dns.d.ts +322 -0
- node v14.18/domain.d.ts → node/domain.d.ts +0 -3
- node v14.18/events.d.ts → node/events.d.ts +8 -8
- node v14.18/fs/promises.d.ts → node/fs/promises.d.ts +18 -29
- node v14.18/fs.d.ts → node/fs.d.ts +77 -93
- node v14.18/globals.d.ts → node/globals.d.ts +60 -24
- {node v14.18 → node}/globals.global.d.ts +0 -0
- node v14.18/http.d.ts → node/http.d.ts +108 -176
- node v14.18/http2.d.ts → node/http2.d.ts +74 -71
- node/https.d.ts +36 -0
- node v14.18/index.d.ts → node/index.d.ts +15 -55
- node v14.18/inspector.d.ts → node/inspector.d.ts +151 -161
- node v14.18/module.d.ts → node/module.d.ts +0 -4
- node v14.18/net.d.ts → node/net.d.ts +70 -42
- node v14.18/os.d.ts → node/os.d.ts +0 -3
- node v14.18/package.json → node/package.json +25 -19
- node v14.18/path.d.ts → node/path.d.ts +5 -9
- node v14.18/perf_hooks.d.ts → node/perf_hooks.d.ts +5 -8
- node v14.18/process.d.ts → node/process.d.ts +53 -17
- node v14.18/punycode.d.ts → node/punycode.d.ts +0 -3
- node v14.18/querystring.d.ts → node/querystring.d.ts +3 -6
- node v14.18/readline.d.ts → node/readline.d.ts +14 -18
- node v14.18/repl.d.ts → node/repl.d.ts +17 -20
- node/stream/promises.d.ts +67 -0
- node v14.18/stream.d.ts → node/stream.d.ts +164 -60
- node v14.18/string_decoder.d.ts → node/string_decoder.d.ts +0 -3
- node/timers/promises.d.ts +13 -0
- node v14.18/timers.d.ts → node/timers.d.ts +16 -5
- node v14.18/tls.d.ts → node/tls.d.ts +51 -56
- node v14.18/trace_events.d.ts → node/trace_events.d.ts +0 -3
- node/ts3.6/assert.d.ts +98 -0
- node/ts3.6/base.d.ts +66 -0
- node/ts3.6/index.d.ts +7 -0
- node v14.18/tty.d.ts → node/tty.d.ts +0 -3
- node v14.18/url.d.ts → node/url.d.ts +16 -19
- node v14.18/util.d.ts → node/util.d.ts +3 -12
- node v14.18/v8.d.ts → node/v8.d.ts +0 -3
- node v14.18/vm.d.ts → node/vm.d.ts +25 -28
- node v14.18/wasi.d.ts → node/wasi.d.ts +7 -10
- node v14.18/worker_threads.d.ts → node/worker_threads.d.ts +18 -18
- node v14.18/zlib.d.ts → node/zlib.d.ts +16 -19
- node v14.18/README.md +0 -16
- node v14.18/buffer.d.ts +0 -89
- node v14.18/dns.d.ts +0 -387
- node v14.18/https.d.ts +0 -142
|
@@ -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;
|
|
20
|
+
allowHalfOpen?: boolean;
|
|
21
|
+
readable?: boolean;
|
|
22
|
+
writable?: boolean;
|
|
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;
|
|
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;
|
|
47
|
+
localAddress?: string;
|
|
48
|
+
localPort?: number;
|
|
49
|
+
hints?: number;
|
|
50
|
+
family?: number;
|
|
51
|
+
lookup?: LookupFunction;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
interface IpcSocketConnectOpts extends ConnectOpts {
|
|
@@ -87,14 +87,14 @@ 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;
|
|
91
|
+
readonly remoteFamily?: string;
|
|
92
|
+
readonly remotePort?: number;
|
|
93
93
|
|
|
94
94
|
// Extended base methods
|
|
95
|
-
end(cb?: () => void):
|
|
96
|
-
end(buffer: Uint8Array | string, cb?: () => void):
|
|
97
|
-
end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void):
|
|
95
|
+
end(cb?: () => void): void;
|
|
96
|
+
end(buffer: Uint8Array | string, cb?: () => void): void;
|
|
97
|
+
end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void): void;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* events.EventEmitter
|
|
@@ -115,7 +115,6 @@ 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;
|
|
119
118
|
addListener(event: "timeout", listener: () => void): this;
|
|
120
119
|
|
|
121
120
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
@@ -126,7 +125,6 @@ declare module 'net' {
|
|
|
126
125
|
emit(event: "end"): boolean;
|
|
127
126
|
emit(event: "error", err: Error): boolean;
|
|
128
127
|
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
|
|
129
|
-
emit(event: "ready"): boolean;
|
|
130
128
|
emit(event: "timeout"): boolean;
|
|
131
129
|
|
|
132
130
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -137,7 +135,6 @@ declare module 'net' {
|
|
|
137
135
|
on(event: "end", listener: () => void): this;
|
|
138
136
|
on(event: "error", listener: (err: Error) => void): this;
|
|
139
137
|
on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
140
|
-
on(event: "ready", listener: () => void): this;
|
|
141
138
|
on(event: "timeout", listener: () => void): this;
|
|
142
139
|
|
|
143
140
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -148,7 +145,6 @@ declare module 'net' {
|
|
|
148
145
|
once(event: "end", listener: () => void): this;
|
|
149
146
|
once(event: "error", listener: (err: Error) => void): this;
|
|
150
147
|
once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
151
|
-
once(event: "ready", listener: () => void): this;
|
|
152
148
|
once(event: "timeout", listener: () => void): this;
|
|
153
149
|
|
|
154
150
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -159,7 +155,6 @@ declare module 'net' {
|
|
|
159
155
|
prependListener(event: "end", listener: () => void): this;
|
|
160
156
|
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
161
157
|
prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
162
|
-
prependListener(event: "ready", listener: () => void): this;
|
|
163
158
|
prependListener(event: "timeout", listener: () => void): this;
|
|
164
159
|
|
|
165
160
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -170,36 +165,33 @@ declare module 'net' {
|
|
|
170
165
|
prependOnceListener(event: "end", listener: () => void): this;
|
|
171
166
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
172
167
|
prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
173
|
-
prependOnceListener(event: "ready", listener: () => void): this;
|
|
174
168
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
175
169
|
}
|
|
176
170
|
|
|
177
171
|
interface ListenOptions {
|
|
178
|
-
port?: number
|
|
179
|
-
host?: string
|
|
180
|
-
backlog?: number
|
|
181
|
-
path?: string
|
|
182
|
-
exclusive?: boolean
|
|
183
|
-
readableAll?: boolean
|
|
184
|
-
writableAll?: boolean
|
|
172
|
+
port?: number;
|
|
173
|
+
host?: string;
|
|
174
|
+
backlog?: number;
|
|
175
|
+
path?: string;
|
|
176
|
+
exclusive?: boolean;
|
|
177
|
+
readableAll?: boolean;
|
|
178
|
+
writableAll?: boolean;
|
|
185
179
|
/**
|
|
186
180
|
* @default false
|
|
187
181
|
*/
|
|
188
|
-
ipv6Only?: boolean
|
|
182
|
+
ipv6Only?: boolean;
|
|
189
183
|
}
|
|
190
184
|
|
|
191
185
|
interface ServerOpts {
|
|
192
186
|
/**
|
|
193
|
-
* Indicates whether half-opened TCP connections are allowed.
|
|
194
|
-
* @default false
|
|
187
|
+
* Indicates whether half-opened TCP connections are allowed. __Default:__ `false`.
|
|
195
188
|
*/
|
|
196
|
-
allowHalfOpen?: boolean
|
|
189
|
+
allowHalfOpen?: boolean;
|
|
197
190
|
|
|
198
191
|
/**
|
|
199
|
-
* Indicates whether the socket should be paused on incoming connections.
|
|
200
|
-
* @default false
|
|
192
|
+
* Indicates whether the socket should be paused on incoming connections. __Default:__ `false`.
|
|
201
193
|
*/
|
|
202
|
-
pauseOnConnect?: boolean
|
|
194
|
+
pauseOnConnect?: boolean;
|
|
203
195
|
}
|
|
204
196
|
|
|
205
197
|
// https://github.com/nodejs/node/blob/master/lib/net.js
|
|
@@ -269,12 +261,51 @@ declare module 'net' {
|
|
|
269
261
|
prependOnceListener(event: "listening", listener: () => void): this;
|
|
270
262
|
}
|
|
271
263
|
|
|
264
|
+
type IPVersion = 'ipv4' | 'ipv6';
|
|
265
|
+
|
|
266
|
+
class BlockList {
|
|
267
|
+
/**
|
|
268
|
+
* Adds a rule to block the given IP address.
|
|
269
|
+
*
|
|
270
|
+
* @param address An IPv4 or IPv6 address.
|
|
271
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
272
|
+
*/
|
|
273
|
+
addAddress(address: string, type?: IPVersion): void;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Adds a rule to block a range of IP addresses from start (inclusive) to end (inclusive).
|
|
277
|
+
*
|
|
278
|
+
* @param start The starting IPv4 or IPv6 address in the range.
|
|
279
|
+
* @param end The ending IPv4 or IPv6 address in the range.
|
|
280
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
281
|
+
*/
|
|
282
|
+
addRange(start: string, end: string, type?: IPVersion): void;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Adds a rule to block a range of IP addresses specified as a subnet mask.
|
|
286
|
+
*
|
|
287
|
+
* @param net The network IPv4 or IPv6 address.
|
|
288
|
+
* @param prefix The number of CIDR prefix bits.
|
|
289
|
+
* For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128.
|
|
290
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
291
|
+
*/
|
|
292
|
+
addSubnet(net: string, prefix: number, type?: IPVersion): void;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Returns `true` if the given IP address matches any of the rules added to the `BlockList`.
|
|
296
|
+
*
|
|
297
|
+
* @param address The IP address to check
|
|
298
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
299
|
+
*/
|
|
300
|
+
check(address: string, type?: IPVersion): boolean;
|
|
301
|
+
}
|
|
302
|
+
|
|
272
303
|
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
|
273
|
-
timeout?: number
|
|
304
|
+
timeout?: number;
|
|
274
305
|
}
|
|
275
306
|
|
|
276
307
|
interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
|
|
277
|
-
timeout?: number
|
|
308
|
+
timeout?: number;
|
|
278
309
|
}
|
|
279
310
|
|
|
280
311
|
type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
|
|
@@ -291,6 +322,3 @@ declare module 'net' {
|
|
|
291
322
|
function isIPv4(input: string): boolean;
|
|
292
323
|
function isIPv6(input: string): boolean;
|
|
293
324
|
}
|
|
294
|
-
declare module 'node:net' {
|
|
295
|
-
export * from 'net';
|
|
296
|
-
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
|
-
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
5
|
"license": "MIT",
|
|
7
6
|
"contributors": [
|
|
8
7
|
{
|
|
@@ -115,11 +114,6 @@
|
|
|
115
114
|
"url": "https://github.com/eps1lon",
|
|
116
115
|
"githubUsername": "eps1lon"
|
|
117
116
|
},
|
|
118
|
-
{
|
|
119
|
-
"name": "Seth Westphal",
|
|
120
|
-
"url": "https://github.com/westy92",
|
|
121
|
-
"githubUsername": "westy92"
|
|
122
|
-
},
|
|
123
117
|
{
|
|
124
118
|
"name": "Simon Schick",
|
|
125
119
|
"url": "https://github.com/SimonSchick",
|
|
@@ -165,6 +159,11 @@
|
|
|
165
159
|
"url": "https://github.com/trivikr",
|
|
166
160
|
"githubUsername": "trivikr"
|
|
167
161
|
},
|
|
162
|
+
{
|
|
163
|
+
"name": "Minh Son Nguyen",
|
|
164
|
+
"url": "https://github.com/nguymin4",
|
|
165
|
+
"githubUsername": "nguymin4"
|
|
166
|
+
},
|
|
168
167
|
{
|
|
169
168
|
"name": "Junxiao Shi",
|
|
170
169
|
"url": "https://github.com/yoursunny",
|
|
@@ -180,6 +179,11 @@
|
|
|
180
179
|
"url": "https://github.com/ExE-Boss",
|
|
181
180
|
"githubUsername": "ExE-Boss"
|
|
182
181
|
},
|
|
182
|
+
{
|
|
183
|
+
"name": "Surasak Chaisurin",
|
|
184
|
+
"url": "https://github.com/Ryan-Willpower",
|
|
185
|
+
"githubUsername": "Ryan-Willpower"
|
|
186
|
+
},
|
|
183
187
|
{
|
|
184
188
|
"name": "Piotr Błażejewicz",
|
|
185
189
|
"url": "https://github.com/peterblazejewicz",
|
|
@@ -190,6 +194,11 @@
|
|
|
190
194
|
"url": "https://github.com/addaleax",
|
|
191
195
|
"githubUsername": "addaleax"
|
|
192
196
|
},
|
|
197
|
+
{
|
|
198
|
+
"name": "Jason Kwok",
|
|
199
|
+
"url": "https://github.com/JasonHK",
|
|
200
|
+
"githubUsername": "JasonHK"
|
|
201
|
+
},
|
|
193
202
|
{
|
|
194
203
|
"name": "Victor Perin",
|
|
195
204
|
"url": "https://github.com/victorperin",
|
|
@@ -199,20 +208,17 @@
|
|
|
199
208
|
"name": "Yongsheng Zhang",
|
|
200
209
|
"url": "https://github.com/ZYSzys",
|
|
201
210
|
"githubUsername": "ZYSzys"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"name": "Bond",
|
|
205
|
-
"url": "https://github.com/bondz",
|
|
206
|
-
"githubUsername": "bondz"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"name": "Linus Unnebäck",
|
|
210
|
-
"url": "https://github.com/LinusU",
|
|
211
|
-
"githubUsername": "LinusU"
|
|
212
211
|
}
|
|
213
212
|
],
|
|
214
213
|
"main": "",
|
|
215
214
|
"types": "index.d.ts",
|
|
215
|
+
"typesVersions": {
|
|
216
|
+
"<=3.6": {
|
|
217
|
+
"*": [
|
|
218
|
+
"ts3.6/*"
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
},
|
|
216
222
|
"repository": {
|
|
217
223
|
"type": "git",
|
|
218
224
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
@@ -220,6 +226,6 @@
|
|
|
220
226
|
},
|
|
221
227
|
"scripts": {},
|
|
222
228
|
"dependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
224
|
-
"typeScriptVersion": "3.
|
|
229
|
+
"typesPublisherContentHash": "b9f4badc74a3b8d0d3d6d7d094196c4851f8a80a2c34e8ba50f75d7de65c3c63",
|
|
230
|
+
"typeScriptVersion": "3.5"
|
|
225
231
|
}
|
|
@@ -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;
|
|
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;
|
|
38
38
|
/**
|
|
39
39
|
* The file name including extension (if any) such as 'index.html'
|
|
40
40
|
*/
|
|
41
|
-
base?: string
|
|
41
|
+
base?: string;
|
|
42
42
|
/**
|
|
43
43
|
* The file extension (if any) such as '.html'
|
|
44
44
|
*/
|
|
45
|
-
ext?: string
|
|
45
|
+
ext?: string;
|
|
46
46
|
/**
|
|
47
47
|
* The file name without extension (if any) such as 'index'
|
|
48
48
|
*/
|
|
49
|
-
name?: string
|
|
49
|
+
name?: string;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
interface PlatformPath {
|
|
@@ -151,7 +151,3 @@ declare module 'path' {
|
|
|
151
151
|
const path: path.PlatformPath;
|
|
152
152
|
export = path;
|
|
153
153
|
}
|
|
154
|
-
declare module 'node:path' {
|
|
155
|
-
import path = require('path');
|
|
156
|
-
export = path;
|
|
157
|
-
}
|
|
@@ -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;
|
|
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;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
interface PerformanceNodeTiming extends PerformanceEntry {
|
|
@@ -116,7 +116,7 @@ declare module 'perf_hooks' {
|
|
|
116
116
|
* @param startMark
|
|
117
117
|
* @param endMark
|
|
118
118
|
*/
|
|
119
|
-
measure(name: string, startMark
|
|
119
|
+
measure(name: string, startMark: string, endMark: string): void;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
|
|
@@ -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
|
|
189
|
+
observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): 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;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
interface EventLoopDelayMonitor {
|
|
@@ -269,6 +269,3 @@ declare module 'perf_hooks' {
|
|
|
269
269
|
|
|
270
270
|
function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor;
|
|
271
271
|
}
|
|
272
|
-
declare module 'node:perf_hooks' {
|
|
273
|
-
export * from 'perf_hooks';
|
|
274
|
-
}
|
|
@@ -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;
|
|
30
|
+
headersUrl?: string;
|
|
31
|
+
libUrl?: string;
|
|
32
|
+
lts?: string;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
interface ProcessVersions extends Dict<string> {
|
|
@@ -60,14 +60,13 @@ declare module 'process' {
|
|
|
60
60
|
"SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
|
61
61
|
"SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
|
|
62
62
|
|
|
63
|
-
type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection';
|
|
64
63
|
type MultipleResolveType = 'resolve' | 'reject';
|
|
65
64
|
|
|
66
65
|
type BeforeExitListener = (code: number) => void;
|
|
67
66
|
type DisconnectListener = () => void;
|
|
68
67
|
type ExitListener = (code: number) => void;
|
|
69
68
|
type RejectionHandledListener = (promise: Promise<any>) => void;
|
|
70
|
-
type UncaughtExceptionListener = (error: Error
|
|
69
|
+
type UncaughtExceptionListener = (error: Error) => void;
|
|
71
70
|
type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
|
|
72
71
|
type WarningListener = (warning: Error) => void;
|
|
73
72
|
type MessageListener = (message: any, sendHandle: any) => void;
|
|
@@ -77,7 +76,7 @@ declare module 'process' {
|
|
|
77
76
|
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
|
|
78
77
|
|
|
79
78
|
interface Socket extends ReadWriteStream {
|
|
80
|
-
isTTY?: true
|
|
79
|
+
isTTY?: true;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
// Alias for compatibility
|
|
@@ -120,7 +119,7 @@ declare module 'process' {
|
|
|
120
119
|
/**
|
|
121
120
|
* If true, a diagnostic report is generated when the process
|
|
122
121
|
* receives the signal specified by process.report.signal.
|
|
123
|
-
* @
|
|
122
|
+
* @defaul false
|
|
124
123
|
*/
|
|
125
124
|
reportOnSignal: boolean;
|
|
126
125
|
|
|
@@ -172,6 +171,32 @@ declare module 'process' {
|
|
|
172
171
|
voluntaryContextSwitches: number;
|
|
173
172
|
}
|
|
174
173
|
|
|
174
|
+
interface EmitWarningOptions {
|
|
175
|
+
/**
|
|
176
|
+
* When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
|
|
177
|
+
*
|
|
178
|
+
* @default 'Warning'
|
|
179
|
+
*/
|
|
180
|
+
type?: string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* A unique identifier for the warning instance being emitted.
|
|
184
|
+
*/
|
|
185
|
+
code?: string;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
|
|
189
|
+
*
|
|
190
|
+
* @default process.emitWarning
|
|
191
|
+
*/
|
|
192
|
+
ctor?: Function;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Additional text to include with the error.
|
|
196
|
+
*/
|
|
197
|
+
detail?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
175
200
|
interface Process extends EventEmitter {
|
|
176
201
|
/**
|
|
177
202
|
* Can also be a tty.WriteStream, not typed due to limitations.
|
|
@@ -197,10 +222,25 @@ declare module 'process' {
|
|
|
197
222
|
chdir(directory: string): void;
|
|
198
223
|
cwd(): string;
|
|
199
224
|
debugPort: number;
|
|
200
|
-
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
|
|
228
|
+
*
|
|
229
|
+
* These can be listened for by adding a handler to the `'warning'` event.
|
|
230
|
+
*
|
|
231
|
+
* @param warning The warning to emit.
|
|
232
|
+
* @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
|
|
233
|
+
* @param code A unique identifier for the warning instance being emitted.
|
|
234
|
+
* @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
|
|
235
|
+
*/
|
|
236
|
+
emitWarning(warning: string | Error, ctor?: Function): void;
|
|
237
|
+
emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
|
|
238
|
+
emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
|
|
239
|
+
emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
|
|
240
|
+
|
|
201
241
|
env: ProcessEnv;
|
|
202
242
|
exit(code?: number): never;
|
|
203
|
-
exitCode?: number
|
|
243
|
+
exitCode?: number;
|
|
204
244
|
getgid(): number;
|
|
205
245
|
setgid(id: number | string): void;
|
|
206
246
|
getuid(): number;
|
|
@@ -248,7 +288,7 @@ declare module 'process' {
|
|
|
248
288
|
arch: string;
|
|
249
289
|
platform: Platform;
|
|
250
290
|
/** @deprecated since v14.0.0 - use `require.main` instead. */
|
|
251
|
-
mainModule?: Module
|
|
291
|
+
mainModule?: Module;
|
|
252
292
|
memoryUsage(): MemoryUsage;
|
|
253
293
|
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
254
294
|
nextTick(callback: Function, ...args: any[]): void;
|
|
@@ -278,7 +318,7 @@ declare module 'process' {
|
|
|
278
318
|
domain: Domain;
|
|
279
319
|
|
|
280
320
|
// Worker
|
|
281
|
-
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean
|
|
321
|
+
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
|
|
282
322
|
disconnect(): void;
|
|
283
323
|
connected: boolean;
|
|
284
324
|
|
|
@@ -292,7 +332,7 @@ declare module 'process' {
|
|
|
292
332
|
/**
|
|
293
333
|
* Only available with `--experimental-report`
|
|
294
334
|
*/
|
|
295
|
-
report?: ProcessReport
|
|
335
|
+
report?: ProcessReport;
|
|
296
336
|
|
|
297
337
|
resourceUsage(): ResourceUsage;
|
|
298
338
|
|
|
@@ -407,7 +447,3 @@ declare module 'process' {
|
|
|
407
447
|
|
|
408
448
|
export = process;
|
|
409
449
|
}
|
|
410
|
-
declare module 'node:process' {
|
|
411
|
-
import process = require('process');
|
|
412
|
-
export = process;
|
|
413
|
-
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare module 'querystring' {
|
|
2
2
|
interface StringifyOptions {
|
|
3
|
-
encodeURIComponent?: (
|
|
3
|
+
encodeURIComponent?: (str: string) => string;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
interface ParseOptions {
|
|
7
|
-
maxKeys?: number
|
|
8
|
-
decodeURIComponent?: (
|
|
7
|
+
maxKeys?: number;
|
|
8
|
+
decodeURIComponent?: (str: string) => string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
|
|
@@ -26,6 +26,3 @@ declare module 'querystring' {
|
|
|
26
26
|
function escape(str: string): string;
|
|
27
27
|
function unescape(str: string): string;
|
|
28
28
|
}
|
|
29
|
-
declare module 'node:querystring' {
|
|
30
|
-
export * from 'querystring';
|
|
31
|
-
}
|
|
@@ -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;
|
|
6
|
+
name?: string;
|
|
7
|
+
ctrl?: boolean;
|
|
8
|
+
meta?: boolean;
|
|
9
|
+
shift?: boolean;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class Interface extends EventEmitter {
|
|
@@ -45,7 +45,6 @@ declare module 'readline' {
|
|
|
45
45
|
resume(): this;
|
|
46
46
|
close(): void;
|
|
47
47
|
write(data: string | Buffer, key?: Key): void;
|
|
48
|
-
write(data: undefined | null | string | Buffer, key: Key): void;
|
|
49
48
|
|
|
50
49
|
/**
|
|
51
50
|
* Returns the real position of the cursor in relation to the input
|
|
@@ -130,15 +129,15 @@ declare module 'readline' {
|
|
|
130
129
|
|
|
131
130
|
interface ReadLineOptions {
|
|
132
131
|
input: NodeJS.ReadableStream;
|
|
133
|
-
output?: NodeJS.WritableStream
|
|
134
|
-
completer?: Completer | AsyncCompleter
|
|
135
|
-
terminal?: boolean
|
|
136
|
-
historySize?: number
|
|
137
|
-
prompt?: string
|
|
138
|
-
crlfDelay?: number
|
|
139
|
-
removeHistoryDuplicates?: boolean
|
|
140
|
-
escapeCodeTimeout?: number
|
|
141
|
-
tabSize?: number
|
|
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;
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
|
|
@@ -169,6 +168,3 @@ declare module 'readline' {
|
|
|
169
168
|
*/
|
|
170
169
|
function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
|
|
171
170
|
}
|
|
172
|
-
declare module 'node:readline' {
|
|
173
|
-
export * from 'readline';
|
|
174
|
-
}
|