@types/node 14.18.9 → 15.0.0
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 +8 -7
- node v14.18/async_hooks.d.ts → node/async_hooks.d.ts +11 -7
- node/base.d.ts +19 -0
- node/buffer.d.ts +26 -0
- node v14.18/child_process.d.ts → node/child_process.d.ts +71 -71
- node v14.18/cluster.d.ts → node/cluster.d.ts +17 -16
- node v14.18/console.d.ts → node/console.d.ts +17 -22
- node v14.18/constants.d.ts → node/constants.d.ts +9 -8
- node v14.18/crypto.d.ts → node/crypto.d.ts +139 -54
- node v14.18/dgram.d.ts → node/dgram.d.ts +24 -23
- node/dns/promises.d.ts +101 -0
- node/dns.d.ts +326 -0
- node v14.18/domain.d.ts → node/domain.d.ts +5 -4
- node v14.18/events.d.ts → node/events.d.ts +13 -8
- node v14.18/fs/promises.d.ts → node/fs/promises.d.ts +23 -30
- node v14.18/fs.d.ts → node/fs.d.ts +85 -97
- node v14.18/globals.d.ts → node/globals.d.ts +60 -67
- {node v14.18 → node}/globals.global.d.ts +0 -0
- node v14.18/http.d.ts → node/http.d.ts +114 -178
- node v14.18/http2.d.ts → node/http2.d.ts +86 -79
- node/https.d.ts +40 -0
- node v14.18/index.d.ts → node/index.d.ts +16 -55
- node v14.18/inspector.d.ts → node/inspector.d.ts +159 -162
- node v14.18/module.d.ts → node/module.d.ts +6 -5
- node v14.18/net.d.ts → node/net.d.ts +77 -45
- node v14.18/os.d.ts → node/os.d.ts +4 -3
- node v14.18/package.json → node/package.json +30 -19
- node v14.18/path.d.ts → node/path.d.ts +10 -9
- node v14.18/perf_hooks.d.ts → node/perf_hooks.d.ts +10 -9
- node v14.18/process.d.ts → node/process.d.ts +58 -18
- node v14.18/punycode.d.ts → node/punycode.d.ts +11 -3
- node v14.18/querystring.d.ts → node/querystring.d.ts +7 -6
- node v14.18/readline.d.ts → node/readline.d.ts +19 -19
- node v14.18/repl.d.ts → node/repl.d.ts +24 -23
- node/stream/promises.d.ts +71 -0
- node v14.18/stream.d.ts → node/stream.d.ts +170 -61
- node v14.18/string_decoder.d.ts → node/string_decoder.d.ts +4 -3
- node/timers/promises.d.ts +17 -0
- node v14.18/timers.d.ts → node/timers.d.ts +20 -5
- node v14.18/tls.d.ts → node/tls.d.ts +56 -57
- node v14.18/trace_events.d.ts → node/trace_events.d.ts +4 -3
- node/ts3.6/assert.d.ts +103 -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 +5 -4
- node v14.18/url.d.ts → node/url.d.ts +21 -20
- node v14.18/util.d.ts → node/util.d.ts +7 -12
- node v14.18/v8.d.ts → node/v8.d.ts +5 -4
- node v14.18/vm.d.ts → node/vm.d.ts +29 -28
- node v14.18/wasi.d.ts → node/wasi.d.ts +11 -10
- node v14.18/worker_threads.d.ts → node/worker_threads.d.ts +27 -23
- node v14.18/zlib.d.ts → node/zlib.d.ts +21 -20
- 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
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
declare module 'node:module' {
|
|
2
|
+
import Module = require('module');
|
|
3
|
+
export = Module;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
declare module 'module' {
|
|
2
|
-
import { URL } from 'url';
|
|
7
|
+
import { URL } from 'node:url';
|
|
3
8
|
namespace Module {
|
|
4
9
|
/**
|
|
5
10
|
* Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
|
|
@@ -50,7 +55,3 @@ declare module 'module' {
|
|
|
50
55
|
}
|
|
51
56
|
export = Module;
|
|
52
57
|
}
|
|
53
|
-
declare module 'node:module' {
|
|
54
|
-
import module = require('module');
|
|
55
|
-
export = module;
|
|
56
|
-
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
declare module 'node:net' {
|
|
2
|
+
export * from 'net';
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'net' {
|
|
2
|
-
import * as stream from 'stream';
|
|
3
|
-
import EventEmitter = require('events');
|
|
4
|
-
import * as dns from 'dns';
|
|
6
|
+
import * as stream from 'node:stream';
|
|
7
|
+
import EventEmitter = require('node:events');
|
|
8
|
+
import * as dns from 'node:dns';
|
|
5
9
|
|
|
6
10
|
type LookupFunction = (
|
|
7
11
|
hostname: string,
|
|
@@ -16,10 +20,10 @@ declare module 'net' {
|
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
interface SocketConstructorOpts {
|
|
19
|
-
fd?: number
|
|
20
|
-
allowHalfOpen?: boolean
|
|
21
|
-
readable?: boolean
|
|
22
|
-
writable?: boolean
|
|
23
|
+
fd?: number;
|
|
24
|
+
allowHalfOpen?: boolean;
|
|
25
|
+
readable?: boolean;
|
|
26
|
+
writable?: boolean;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
interface OnReadOpts {
|
|
@@ -38,17 +42,17 @@ declare module 'net' {
|
|
|
38
42
|
* Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
|
|
39
43
|
* still be emitted as normal and methods like pause() and resume() will also behave as expected.
|
|
40
44
|
*/
|
|
41
|
-
onread?: OnReadOpts
|
|
45
|
+
onread?: OnReadOpts;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
interface TcpSocketConnectOpts extends ConnectOpts {
|
|
45
49
|
port: number;
|
|
46
|
-
host?: string
|
|
47
|
-
localAddress?: string
|
|
48
|
-
localPort?: number
|
|
49
|
-
hints?: number
|
|
50
|
-
family?: number
|
|
51
|
-
lookup?: LookupFunction
|
|
50
|
+
host?: string;
|
|
51
|
+
localAddress?: string;
|
|
52
|
+
localPort?: number;
|
|
53
|
+
hints?: number;
|
|
54
|
+
family?: number;
|
|
55
|
+
lookup?: LookupFunction;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
interface IpcSocketConnectOpts extends ConnectOpts {
|
|
@@ -87,14 +91,14 @@ declare module 'net' {
|
|
|
87
91
|
readonly destroyed: boolean;
|
|
88
92
|
readonly localAddress: string;
|
|
89
93
|
readonly localPort: number;
|
|
90
|
-
readonly remoteAddress?: string
|
|
91
|
-
readonly remoteFamily?: string
|
|
92
|
-
readonly remotePort?: number
|
|
94
|
+
readonly remoteAddress?: string;
|
|
95
|
+
readonly remoteFamily?: string;
|
|
96
|
+
readonly remotePort?: number;
|
|
93
97
|
|
|
94
98
|
// Extended base methods
|
|
95
|
-
end(cb?: () => void):
|
|
96
|
-
end(buffer: Uint8Array | string, cb?: () => void):
|
|
97
|
-
end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void):
|
|
99
|
+
end(cb?: () => void): void;
|
|
100
|
+
end(buffer: Uint8Array | string, cb?: () => void): void;
|
|
101
|
+
end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void): void;
|
|
98
102
|
|
|
99
103
|
/**
|
|
100
104
|
* events.EventEmitter
|
|
@@ -115,7 +119,6 @@ declare module 'net' {
|
|
|
115
119
|
addListener(event: "end", listener: () => void): this;
|
|
116
120
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
117
121
|
addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
118
|
-
addListener(event: "ready", listener: () => void): this;
|
|
119
122
|
addListener(event: "timeout", listener: () => void): this;
|
|
120
123
|
|
|
121
124
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
@@ -126,7 +129,6 @@ declare module 'net' {
|
|
|
126
129
|
emit(event: "end"): boolean;
|
|
127
130
|
emit(event: "error", err: Error): boolean;
|
|
128
131
|
emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
|
|
129
|
-
emit(event: "ready"): boolean;
|
|
130
132
|
emit(event: "timeout"): boolean;
|
|
131
133
|
|
|
132
134
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -137,7 +139,6 @@ declare module 'net' {
|
|
|
137
139
|
on(event: "end", listener: () => void): this;
|
|
138
140
|
on(event: "error", listener: (err: Error) => void): this;
|
|
139
141
|
on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
140
|
-
on(event: "ready", listener: () => void): this;
|
|
141
142
|
on(event: "timeout", listener: () => void): this;
|
|
142
143
|
|
|
143
144
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -148,7 +149,6 @@ declare module 'net' {
|
|
|
148
149
|
once(event: "end", listener: () => void): this;
|
|
149
150
|
once(event: "error", listener: (err: Error) => void): this;
|
|
150
151
|
once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
151
|
-
once(event: "ready", listener: () => void): this;
|
|
152
152
|
once(event: "timeout", listener: () => void): this;
|
|
153
153
|
|
|
154
154
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -159,7 +159,6 @@ declare module 'net' {
|
|
|
159
159
|
prependListener(event: "end", listener: () => void): this;
|
|
160
160
|
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
161
161
|
prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
162
|
-
prependListener(event: "ready", listener: () => void): this;
|
|
163
162
|
prependListener(event: "timeout", listener: () => void): this;
|
|
164
163
|
|
|
165
164
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
@@ -170,36 +169,33 @@ declare module 'net' {
|
|
|
170
169
|
prependOnceListener(event: "end", listener: () => void): this;
|
|
171
170
|
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
172
171
|
prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
|
173
|
-
prependOnceListener(event: "ready", listener: () => void): this;
|
|
174
172
|
prependOnceListener(event: "timeout", listener: () => void): this;
|
|
175
173
|
}
|
|
176
174
|
|
|
177
175
|
interface ListenOptions {
|
|
178
|
-
port?: number
|
|
179
|
-
host?: string
|
|
180
|
-
backlog?: number
|
|
181
|
-
path?: string
|
|
182
|
-
exclusive?: boolean
|
|
183
|
-
readableAll?: boolean
|
|
184
|
-
writableAll?: boolean
|
|
176
|
+
port?: number;
|
|
177
|
+
host?: string;
|
|
178
|
+
backlog?: number;
|
|
179
|
+
path?: string;
|
|
180
|
+
exclusive?: boolean;
|
|
181
|
+
readableAll?: boolean;
|
|
182
|
+
writableAll?: boolean;
|
|
185
183
|
/**
|
|
186
184
|
* @default false
|
|
187
185
|
*/
|
|
188
|
-
ipv6Only?: boolean
|
|
186
|
+
ipv6Only?: boolean;
|
|
189
187
|
}
|
|
190
188
|
|
|
191
189
|
interface ServerOpts {
|
|
192
190
|
/**
|
|
193
|
-
* Indicates whether half-opened TCP connections are allowed.
|
|
194
|
-
* @default false
|
|
191
|
+
* Indicates whether half-opened TCP connections are allowed. __Default:__ `false`.
|
|
195
192
|
*/
|
|
196
|
-
allowHalfOpen?: boolean
|
|
193
|
+
allowHalfOpen?: boolean;
|
|
197
194
|
|
|
198
195
|
/**
|
|
199
|
-
* Indicates whether the socket should be paused on incoming connections.
|
|
200
|
-
* @default false
|
|
196
|
+
* Indicates whether the socket should be paused on incoming connections. __Default:__ `false`.
|
|
201
197
|
*/
|
|
202
|
-
pauseOnConnect?: boolean
|
|
198
|
+
pauseOnConnect?: boolean;
|
|
203
199
|
}
|
|
204
200
|
|
|
205
201
|
// https://github.com/nodejs/node/blob/master/lib/net.js
|
|
@@ -269,12 +265,51 @@ declare module 'net' {
|
|
|
269
265
|
prependOnceListener(event: "listening", listener: () => void): this;
|
|
270
266
|
}
|
|
271
267
|
|
|
268
|
+
type IPVersion = 'ipv4' | 'ipv6';
|
|
269
|
+
|
|
270
|
+
class BlockList {
|
|
271
|
+
/**
|
|
272
|
+
* Adds a rule to block the given IP address.
|
|
273
|
+
*
|
|
274
|
+
* @param address An IPv4 or IPv6 address.
|
|
275
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
276
|
+
*/
|
|
277
|
+
addAddress(address: string, type?: IPVersion): void;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Adds a rule to block a range of IP addresses from start (inclusive) to end (inclusive).
|
|
281
|
+
*
|
|
282
|
+
* @param start The starting IPv4 or IPv6 address in the range.
|
|
283
|
+
* @param end The ending IPv4 or IPv6 address in the range.
|
|
284
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
285
|
+
*/
|
|
286
|
+
addRange(start: string, end: string, type?: IPVersion): void;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Adds a rule to block a range of IP addresses specified as a subnet mask.
|
|
290
|
+
*
|
|
291
|
+
* @param net The network IPv4 or IPv6 address.
|
|
292
|
+
* @param prefix The number of CIDR prefix bits.
|
|
293
|
+
* For IPv4, this must be a value between 0 and 32. For IPv6, this must be between 0 and 128.
|
|
294
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
295
|
+
*/
|
|
296
|
+
addSubnet(net: string, prefix: number, type?: IPVersion): void;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Returns `true` if the given IP address matches any of the rules added to the `BlockList`.
|
|
300
|
+
*
|
|
301
|
+
* @param address The IP address to check
|
|
302
|
+
* @param type Either 'ipv4' or 'ipv6'. Default: 'ipv4'.
|
|
303
|
+
*/
|
|
304
|
+
check(address: string, type?: IPVersion): boolean;
|
|
305
|
+
}
|
|
306
|
+
|
|
272
307
|
interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
|
273
|
-
timeout?: number
|
|
308
|
+
timeout?: number;
|
|
274
309
|
}
|
|
275
310
|
|
|
276
311
|
interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
|
|
277
|
-
timeout?: number
|
|
312
|
+
timeout?: number;
|
|
278
313
|
}
|
|
279
314
|
|
|
280
315
|
type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
|
|
@@ -291,6 +326,3 @@ declare module 'net' {
|
|
|
291
326
|
function isIPv4(input: string): boolean;
|
|
292
327
|
function isIPv6(input: string): boolean;
|
|
293
328
|
}
|
|
294
|
-
declare module 'node:net' {
|
|
295
|
-
export * from 'net';
|
|
296
|
-
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare module 'node:os' {
|
|
2
|
+
export * from 'os';
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'os' {
|
|
2
6
|
interface CpuInfo {
|
|
3
7
|
model: string;
|
|
@@ -237,6 +241,3 @@ declare module 'os' {
|
|
|
237
241
|
*/
|
|
238
242
|
function setPriority(pid: number, priority: number): void;
|
|
239
243
|
}
|
|
240
|
-
declare module 'node:os' {
|
|
241
|
-
export * from 'os';
|
|
242
|
-
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
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
|
{
|
|
@@ -35,6 +34,11 @@
|
|
|
35
34
|
"url": "https://github.com/btoueg",
|
|
36
35
|
"githubUsername": "btoueg"
|
|
37
36
|
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Bruno Scheufler",
|
|
39
|
+
"url": "https://github.com/brunoscheufler",
|
|
40
|
+
"githubUsername": "brunoscheufler"
|
|
41
|
+
},
|
|
38
42
|
{
|
|
39
43
|
"name": "Chigozirim C.",
|
|
40
44
|
"url": "https://github.com/smac89",
|
|
@@ -115,11 +119,6 @@
|
|
|
115
119
|
"url": "https://github.com/eps1lon",
|
|
116
120
|
"githubUsername": "eps1lon"
|
|
117
121
|
},
|
|
118
|
-
{
|
|
119
|
-
"name": "Seth Westphal",
|
|
120
|
-
"url": "https://github.com/westy92",
|
|
121
|
-
"githubUsername": "westy92"
|
|
122
|
-
},
|
|
123
122
|
{
|
|
124
123
|
"name": "Simon Schick",
|
|
125
124
|
"url": "https://github.com/SimonSchick",
|
|
@@ -165,6 +164,11 @@
|
|
|
165
164
|
"url": "https://github.com/trivikr",
|
|
166
165
|
"githubUsername": "trivikr"
|
|
167
166
|
},
|
|
167
|
+
{
|
|
168
|
+
"name": "Minh Son Nguyen",
|
|
169
|
+
"url": "https://github.com/nguymin4",
|
|
170
|
+
"githubUsername": "nguymin4"
|
|
171
|
+
},
|
|
168
172
|
{
|
|
169
173
|
"name": "Junxiao Shi",
|
|
170
174
|
"url": "https://github.com/yoursunny",
|
|
@@ -180,6 +184,11 @@
|
|
|
180
184
|
"url": "https://github.com/ExE-Boss",
|
|
181
185
|
"githubUsername": "ExE-Boss"
|
|
182
186
|
},
|
|
187
|
+
{
|
|
188
|
+
"name": "Surasak Chaisurin",
|
|
189
|
+
"url": "https://github.com/Ryan-Willpower",
|
|
190
|
+
"githubUsername": "Ryan-Willpower"
|
|
191
|
+
},
|
|
183
192
|
{
|
|
184
193
|
"name": "Piotr Błażejewicz",
|
|
185
194
|
"url": "https://github.com/peterblazejewicz",
|
|
@@ -190,6 +199,11 @@
|
|
|
190
199
|
"url": "https://github.com/addaleax",
|
|
191
200
|
"githubUsername": "addaleax"
|
|
192
201
|
},
|
|
202
|
+
{
|
|
203
|
+
"name": "Jason Kwok",
|
|
204
|
+
"url": "https://github.com/JasonHK",
|
|
205
|
+
"githubUsername": "JasonHK"
|
|
206
|
+
},
|
|
193
207
|
{
|
|
194
208
|
"name": "Victor Perin",
|
|
195
209
|
"url": "https://github.com/victorperin",
|
|
@@ -199,20 +213,17 @@
|
|
|
199
213
|
"name": "Yongsheng Zhang",
|
|
200
214
|
"url": "https://github.com/ZYSzys",
|
|
201
215
|
"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
216
|
}
|
|
213
217
|
],
|
|
214
218
|
"main": "",
|
|
215
219
|
"types": "index.d.ts",
|
|
220
|
+
"typesVersions": {
|
|
221
|
+
"<=3.6": {
|
|
222
|
+
"*": [
|
|
223
|
+
"ts3.6/*"
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
},
|
|
216
227
|
"repository": {
|
|
217
228
|
"type": "git",
|
|
218
229
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
|
@@ -220,6 +231,6 @@
|
|
|
220
231
|
},
|
|
221
232
|
"scripts": {},
|
|
222
233
|
"dependencies": {},
|
|
223
|
-
"typesPublisherContentHash": "
|
|
224
|
-
"typeScriptVersion": "3.
|
|
234
|
+
"typesPublisherContentHash": "15950df262efcf8b9198c4f5e248ae770f5a72087f8e2ba8158795b58907b6c4",
|
|
235
|
+
"typeScriptVersion": "3.5"
|
|
225
236
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
declare module 'node:path' {
|
|
2
|
+
import path = require('path');
|
|
3
|
+
export = path;
|
|
4
|
+
}
|
|
5
|
+
|
|
1
6
|
declare module 'path' {
|
|
2
7
|
namespace path {
|
|
3
8
|
/**
|
|
@@ -30,23 +35,23 @@ declare module 'path' {
|
|
|
30
35
|
/**
|
|
31
36
|
* The root of the path such as '/' or 'c:\'
|
|
32
37
|
*/
|
|
33
|
-
root?: string
|
|
38
|
+
root?: string;
|
|
34
39
|
/**
|
|
35
40
|
* The full directory path such as '/home/user/dir' or 'c:\path\dir'
|
|
36
41
|
*/
|
|
37
|
-
dir?: string
|
|
42
|
+
dir?: string;
|
|
38
43
|
/**
|
|
39
44
|
* The file name including extension (if any) such as 'index.html'
|
|
40
45
|
*/
|
|
41
|
-
base?: string
|
|
46
|
+
base?: string;
|
|
42
47
|
/**
|
|
43
48
|
* The file extension (if any) such as '.html'
|
|
44
49
|
*/
|
|
45
|
-
ext?: string
|
|
50
|
+
ext?: string;
|
|
46
51
|
/**
|
|
47
52
|
* The file name without extension (if any) such as 'index'
|
|
48
53
|
*/
|
|
49
|
-
name?: string
|
|
54
|
+
name?: string;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
interface PlatformPath {
|
|
@@ -151,7 +156,3 @@ declare module 'path' {
|
|
|
151
156
|
const path: path.PlatformPath;
|
|
152
157
|
export = path;
|
|
153
158
|
}
|
|
154
|
-
declare module 'node:path' {
|
|
155
|
-
import path = require('path');
|
|
156
|
-
export = path;
|
|
157
|
-
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
declare module 'node:perf_hooks' {
|
|
2
|
+
export * from 'perf_hooks';
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'perf_hooks' {
|
|
2
|
-
import { AsyncResource } from 'async_hooks';
|
|
6
|
+
import { AsyncResource } from 'node:async_hooks';
|
|
3
7
|
|
|
4
8
|
type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
|
|
5
9
|
|
|
@@ -31,14 +35,14 @@ declare module 'perf_hooks' {
|
|
|
31
35
|
* the type of garbage collection operation that occurred.
|
|
32
36
|
* See perf_hooks.constants for valid values.
|
|
33
37
|
*/
|
|
34
|
-
readonly kind?: number
|
|
38
|
+
readonly kind?: number;
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
* When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
|
|
38
42
|
* property contains additional information about garbage collection operation.
|
|
39
43
|
* See perf_hooks.constants for valid values.
|
|
40
44
|
*/
|
|
41
|
-
readonly flags?: number
|
|
45
|
+
readonly flags?: number;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
interface PerformanceNodeTiming extends PerformanceEntry {
|
|
@@ -116,7 +120,7 @@ declare module 'perf_hooks' {
|
|
|
116
120
|
* @param startMark
|
|
117
121
|
* @param endMark
|
|
118
122
|
*/
|
|
119
|
-
measure(name: string, startMark
|
|
123
|
+
measure(name: string, startMark: string, endMark: string): void;
|
|
120
124
|
|
|
121
125
|
/**
|
|
122
126
|
* An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
|
|
@@ -186,7 +190,7 @@ declare module 'perf_hooks' {
|
|
|
186
190
|
* Property buffered defaults to false.
|
|
187
191
|
* @param options
|
|
188
192
|
*/
|
|
189
|
-
observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean
|
|
193
|
+
observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
namespace constants {
|
|
@@ -212,7 +216,7 @@ declare module 'perf_hooks' {
|
|
|
212
216
|
* Must be greater than zero.
|
|
213
217
|
* @default 10
|
|
214
218
|
*/
|
|
215
|
-
resolution?: number
|
|
219
|
+
resolution?: number;
|
|
216
220
|
}
|
|
217
221
|
|
|
218
222
|
interface EventLoopDelayMonitor {
|
|
@@ -269,6 +273,3 @@ declare module 'perf_hooks' {
|
|
|
269
273
|
|
|
270
274
|
function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor;
|
|
271
275
|
}
|
|
272
|
-
declare module 'node:perf_hooks' {
|
|
273
|
-
export * from 'perf_hooks';
|
|
274
|
-
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
declare module 'node:process' {
|
|
2
|
+
export = process;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'process' {
|
|
2
|
-
import * as tty from 'tty';
|
|
6
|
+
import * as tty from 'node:tty';
|
|
3
7
|
|
|
4
8
|
global {
|
|
5
9
|
var process: NodeJS.Process;
|
|
@@ -26,10 +30,10 @@ declare module 'process' {
|
|
|
26
30
|
|
|
27
31
|
interface ProcessRelease {
|
|
28
32
|
name: string;
|
|
29
|
-
sourceUrl?: string
|
|
30
|
-
headersUrl?: string
|
|
31
|
-
libUrl?: string
|
|
32
|
-
lts?: string
|
|
33
|
+
sourceUrl?: string;
|
|
34
|
+
headersUrl?: string;
|
|
35
|
+
libUrl?: string;
|
|
36
|
+
lts?: string;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
interface ProcessVersions extends Dict<string> {
|
|
@@ -60,14 +64,13 @@ declare module 'process' {
|
|
|
60
64
|
"SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
|
61
65
|
"SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
|
|
62
66
|
|
|
63
|
-
type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection';
|
|
64
67
|
type MultipleResolveType = 'resolve' | 'reject';
|
|
65
68
|
|
|
66
69
|
type BeforeExitListener = (code: number) => void;
|
|
67
70
|
type DisconnectListener = () => void;
|
|
68
71
|
type ExitListener = (code: number) => void;
|
|
69
72
|
type RejectionHandledListener = (promise: Promise<any>) => void;
|
|
70
|
-
type UncaughtExceptionListener = (error: Error
|
|
73
|
+
type UncaughtExceptionListener = (error: Error) => void;
|
|
71
74
|
type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
|
|
72
75
|
type WarningListener = (warning: Error) => void;
|
|
73
76
|
type MessageListener = (message: any, sendHandle: any) => void;
|
|
@@ -77,7 +80,7 @@ declare module 'process' {
|
|
|
77
80
|
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
|
|
78
81
|
|
|
79
82
|
interface Socket extends ReadWriteStream {
|
|
80
|
-
isTTY?: true
|
|
83
|
+
isTTY?: true;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
// Alias for compatibility
|
|
@@ -120,7 +123,7 @@ declare module 'process' {
|
|
|
120
123
|
/**
|
|
121
124
|
* If true, a diagnostic report is generated when the process
|
|
122
125
|
* receives the signal specified by process.report.signal.
|
|
123
|
-
* @
|
|
126
|
+
* @defaul false
|
|
124
127
|
*/
|
|
125
128
|
reportOnSignal: boolean;
|
|
126
129
|
|
|
@@ -172,6 +175,32 @@ declare module 'process' {
|
|
|
172
175
|
voluntaryContextSwitches: number;
|
|
173
176
|
}
|
|
174
177
|
|
|
178
|
+
interface EmitWarningOptions {
|
|
179
|
+
/**
|
|
180
|
+
* When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
|
|
181
|
+
*
|
|
182
|
+
* @default 'Warning'
|
|
183
|
+
*/
|
|
184
|
+
type?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A unique identifier for the warning instance being emitted.
|
|
188
|
+
*/
|
|
189
|
+
code?: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
|
|
193
|
+
*
|
|
194
|
+
* @default process.emitWarning
|
|
195
|
+
*/
|
|
196
|
+
ctor?: Function;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Additional text to include with the error.
|
|
200
|
+
*/
|
|
201
|
+
detail?: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
175
204
|
interface Process extends EventEmitter {
|
|
176
205
|
/**
|
|
177
206
|
* Can also be a tty.WriteStream, not typed due to limitations.
|
|
@@ -197,10 +226,25 @@ declare module 'process' {
|
|
|
197
226
|
chdir(directory: string): void;
|
|
198
227
|
cwd(): string;
|
|
199
228
|
debugPort: number;
|
|
200
|
-
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
|
|
232
|
+
*
|
|
233
|
+
* These can be listened for by adding a handler to the `'warning'` event.
|
|
234
|
+
*
|
|
235
|
+
* @param warning The warning to emit.
|
|
236
|
+
* @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
|
|
237
|
+
* @param code A unique identifier for the warning instance being emitted.
|
|
238
|
+
* @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
|
|
239
|
+
*/
|
|
240
|
+
emitWarning(warning: string | Error, ctor?: Function): void;
|
|
241
|
+
emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
|
|
242
|
+
emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
|
|
243
|
+
emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
|
|
244
|
+
|
|
201
245
|
env: ProcessEnv;
|
|
202
246
|
exit(code?: number): never;
|
|
203
|
-
exitCode?: number
|
|
247
|
+
exitCode?: number;
|
|
204
248
|
getgid(): number;
|
|
205
249
|
setgid(id: number | string): void;
|
|
206
250
|
getuid(): number;
|
|
@@ -248,7 +292,7 @@ declare module 'process' {
|
|
|
248
292
|
arch: string;
|
|
249
293
|
platform: Platform;
|
|
250
294
|
/** @deprecated since v14.0.0 - use `require.main` instead. */
|
|
251
|
-
mainModule?: Module
|
|
295
|
+
mainModule?: Module;
|
|
252
296
|
memoryUsage(): MemoryUsage;
|
|
253
297
|
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
254
298
|
nextTick(callback: Function, ...args: any[]): void;
|
|
@@ -278,7 +322,7 @@ declare module 'process' {
|
|
|
278
322
|
domain: Domain;
|
|
279
323
|
|
|
280
324
|
// Worker
|
|
281
|
-
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean
|
|
325
|
+
send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
|
|
282
326
|
disconnect(): void;
|
|
283
327
|
connected: boolean;
|
|
284
328
|
|
|
@@ -292,7 +336,7 @@ declare module 'process' {
|
|
|
292
336
|
/**
|
|
293
337
|
* Only available with `--experimental-report`
|
|
294
338
|
*/
|
|
295
|
-
report?: ProcessReport
|
|
339
|
+
report?: ProcessReport;
|
|
296
340
|
|
|
297
341
|
resourceUsage(): ResourceUsage;
|
|
298
342
|
|
|
@@ -407,7 +451,3 @@ declare module 'process' {
|
|
|
407
451
|
|
|
408
452
|
export = process;
|
|
409
453
|
}
|
|
410
|
-
declare module 'node:process' {
|
|
411
|
-
import process = require('process');
|
|
412
|
-
export = process;
|
|
413
|
-
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated since v7.0.0
|
|
3
|
+
* The version of the punycode module bundled in Node.js is being deprecated.
|
|
4
|
+
* In a future major version of Node.js this module will be removed.
|
|
5
|
+
* Users currently depending on the punycode module should switch to using
|
|
6
|
+
* the userland-provided Punycode.js module instead.
|
|
7
|
+
*/
|
|
8
|
+
declare module 'node:punycode' {
|
|
9
|
+
export * from 'punycode';
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
/**
|
|
2
13
|
* @deprecated since v7.0.0
|
|
3
14
|
* The version of the punycode module bundled in Node.js is being deprecated.
|
|
@@ -73,6 +84,3 @@ declare module 'punycode' {
|
|
|
73
84
|
*/
|
|
74
85
|
const version: string;
|
|
75
86
|
}
|
|
76
|
-
declare module 'node:punycode' {
|
|
77
|
-
export * from 'punycode';
|
|
78
|
-
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
declare module 'node:querystring' {
|
|
2
|
+
export * from 'querystring';
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
declare module 'querystring' {
|
|
2
6
|
interface StringifyOptions {
|
|
3
|
-
encodeURIComponent?: (
|
|
7
|
+
encodeURIComponent?: (str: string) => string;
|
|
4
8
|
}
|
|
5
9
|
|
|
6
10
|
interface ParseOptions {
|
|
7
|
-
maxKeys?: number
|
|
8
|
-
decodeURIComponent?: (
|
|
11
|
+
maxKeys?: number;
|
|
12
|
+
decodeURIComponent?: (str: string) => string;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
|
|
@@ -26,6 +30,3 @@ declare module 'querystring' {
|
|
|
26
30
|
function escape(str: string): string;
|
|
27
31
|
function unescape(str: string): string;
|
|
28
32
|
}
|
|
29
|
-
declare module 'node:querystring' {
|
|
30
|
-
export * from 'querystring';
|
|
31
|
-
}
|