@types/node 15.14.9 → 16.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 v15.14 → node}/LICENSE +0 -0
- node v15.14/README.md → node/README.md +3 -3
- node/assert/strict.d.ts +9 -0
- node v15.14/assert.d.ts → node/assert.d.ts +32 -27
- node v15.14/async_hooks.d.ts → node/async_hooks.d.ts +5 -1
- {node v15.14 → node}/base.d.ts +0 -0
- node/buffer.d.ts +357 -0
- node v15.14/child_process.d.ts → node/child_process.d.ts +6 -2
- node v15.14/cluster.d.ts → node/cluster.d.ts +25 -100
- node v15.14/console.d.ts → node/console.d.ts +21 -20
- node v15.14/constants.d.ts → node/constants.d.ts +5 -0
- node v15.14/crypto.d.ts → node/crypto.d.ts +21 -6
- node v15.14/dgram.d.ts → node/dgram.d.ts +4 -0
- node v15.14/diagnostic_channel.d.ts → node/diagnostic_channel.d.ts +4 -0
- node v15.14/dns/promises.d.ts → node/dns/promises.d.ts +4 -0
- node v15.14/dns.d.ts → node/dns.d.ts +4 -0
- node/domain.d.ts +25 -0
- node v15.14/events.d.ts → node/events.d.ts +5 -0
- node v15.14/fs/promises.d.ts → node/fs/promises.d.ts +4 -0
- node v15.14/fs.d.ts → node/fs.d.ts +12 -20
- node/globals.d.ts +274 -0
- node/globals.global.d.ts +1 -0
- node v15.14/http.d.ts → node/http.d.ts +12 -70
- node v15.14/http2.d.ts → node/http2.d.ts +4 -1
- node/https.d.ts +40 -0
- node v15.14/index.d.ts → node/index.d.ts +1 -1
- node v15.14/inspector.d.ts → node/inspector.d.ts +4 -322
- node v15.14/module.d.ts → node/module.d.ts +25 -4
- node v15.14/net.d.ts → node/net.d.ts +4 -6
- node v15.14/os.d.ts → node/os.d.ts +4 -0
- node v15.14/package.json → node/package.json +3 -3
- node v15.14/path.d.ts → node/path.d.ts +5 -0
- node v15.14/perf_hooks.d.ts → node/perf_hooks.d.ts +66 -19
- node v15.14/process.d.ts → node/process.d.ts +42 -40
- node v15.14/punycode.d.ts → node/punycode.d.ts +4 -0
- node v15.14/querystring.d.ts → node/querystring.d.ts +4 -0
- node v15.14/readline.d.ts → node/readline.d.ts +5 -1
- node v15.14/repl.d.ts → node/repl.d.ts +4 -0
- node v15.14/stream/promises.d.ts → node/stream/promises.d.ts +4 -0
- node v15.14/stream.d.ts → node/stream.d.ts +5 -0
- node v15.14/string_decoder.d.ts → node/string_decoder.d.ts +4 -0
- node v15.14/timers/promises.d.ts → node/timers/promises.d.ts +4 -0
- node/timers.d.ts +92 -0
- node v15.14/tls.d.ts → node/tls.d.ts +4 -0
- node v15.14/trace_events.d.ts → node/trace_events.d.ts +4 -0
- node v15.14/ts3.6/assert.d.ts → node/ts3.6/assert.d.ts +26 -26
- {node v15.14 → node}/ts3.6/base.d.ts +0 -0
- {node v15.14 → node}/ts3.6/index.d.ts +0 -0
- node v15.14/tty.d.ts → node/tty.d.ts +4 -0
- node v15.14/url.d.ts → node/url.d.ts +4 -0
- node/util/types.d.ts +57 -0
- node v15.14/util.d.ts → node/util.d.ts +65 -19
- node v15.14/v8.d.ts → node/v8.d.ts +4 -0
- node v15.14/vm.d.ts → node/vm.d.ts +4 -0
- node v15.14/wasi.d.ts → node/wasi.d.ts +4 -0
- node v15.14/worker_threads.d.ts → node/worker_threads.d.ts +4 -0
- node v15.14/zlib.d.ts → node/zlib.d.ts +4 -0
- node v15.14/assert/strict.d.ts +0 -4
- node v15.14/buffer.d.ts +0 -112
- node v15.14/domain.d.ts +0 -24
- node v15.14/globals.d.ts +0 -659
- node v15.14/globals.global.d.ts +0 -1
- node v15.14/https.d.ts +0 -139
- node v15.14/timers.d.ts +0 -27
- node v15.14/util/types.d.ts +0 -53
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
// Requires `esModuleInterop: true`
|
|
1
2
|
declare module 'cluster' {
|
|
2
3
|
import * as child from 'child_process';
|
|
3
4
|
import EventEmitter = require('events');
|
|
4
5
|
import * as net from 'net';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
interface ClusterSettings {
|
|
7
|
+
export interface ClusterSettings {
|
|
8
8
|
execArgv?: string[]; // default: process.execArgv
|
|
9
9
|
exec?: string;
|
|
10
10
|
args?: string[];
|
|
@@ -15,13 +15,13 @@ declare module 'cluster' {
|
|
|
15
15
|
inspectPort?: number | (() => number);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
interface Address {
|
|
18
|
+
export interface Address {
|
|
19
19
|
address: string;
|
|
20
20
|
port: number;
|
|
21
21
|
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
class Worker extends EventEmitter {
|
|
24
|
+
export class Worker extends EventEmitter {
|
|
25
25
|
id: number;
|
|
26
26
|
process: child.ChildProcess;
|
|
27
27
|
send(message: child.Serializable, sendHandle?: child.SendHandle, callback?: (error: Error | null) => void): boolean;
|
|
@@ -90,17 +90,23 @@ declare module 'cluster' {
|
|
|
90
90
|
prependOnceListener(event: "online", listener: () => void): this;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
interface Cluster extends EventEmitter {
|
|
94
|
-
Worker: Worker;
|
|
93
|
+
export interface Cluster extends EventEmitter {
|
|
95
94
|
disconnect(callback?: () => void): void;
|
|
96
95
|
fork(env?: any): Worker;
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
/** @deprecated since v16.0.0 - use setupPrimary. */
|
|
97
|
+
readonly isMaster: boolean;
|
|
98
|
+
readonly isPrimary: boolean;
|
|
99
|
+
readonly isWorker: boolean;
|
|
99
100
|
schedulingPolicy: number;
|
|
100
|
-
settings: ClusterSettings;
|
|
101
|
+
readonly settings: ClusterSettings;
|
|
102
|
+
/** @deprecated since v16.0.0 - use setupPrimary. */
|
|
101
103
|
setupMaster(settings?: ClusterSettings): void;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
/**
|
|
105
|
+
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings.
|
|
106
|
+
*/
|
|
107
|
+
setupPrimary(settings?: ClusterSettings): void;
|
|
108
|
+
readonly worker?: Worker;
|
|
109
|
+
readonly workers?: NodeJS.Dict<Worker>;
|
|
104
110
|
|
|
105
111
|
readonly SCHED_NONE: number;
|
|
106
112
|
readonly SCHED_RR: number;
|
|
@@ -147,7 +153,7 @@ declare module 'cluster' {
|
|
|
147
153
|
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
148
154
|
once(event: "fork", listener: (worker: Worker) => void): this;
|
|
149
155
|
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
150
|
-
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
|
156
|
+
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
|
151
157
|
once(event: "online", listener: (worker: Worker) => void): this;
|
|
152
158
|
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
153
159
|
|
|
@@ -156,7 +162,8 @@ declare module 'cluster' {
|
|
|
156
162
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
157
163
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
158
164
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
159
|
-
|
|
165
|
+
// the handle is a net.Socket or net.Server object, or undefined.
|
|
166
|
+
prependListener(event: "message", listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this;
|
|
160
167
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
161
168
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
162
169
|
|
|
@@ -171,92 +178,10 @@ declare module 'cluster' {
|
|
|
171
178
|
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
172
179
|
}
|
|
173
180
|
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
function disconnect(callback?: () => void): void;
|
|
178
|
-
function fork(env?: any): Worker;
|
|
179
|
-
const isMaster: boolean;
|
|
180
|
-
const isWorker: boolean;
|
|
181
|
-
let schedulingPolicy: number;
|
|
182
|
-
const settings: ClusterSettings;
|
|
183
|
-
function setupMaster(settings?: ClusterSettings): void;
|
|
184
|
-
const worker: Worker;
|
|
185
|
-
const workers: NodeJS.Dict<Worker>;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* events.EventEmitter
|
|
189
|
-
* 1. disconnect
|
|
190
|
-
* 2. exit
|
|
191
|
-
* 3. fork
|
|
192
|
-
* 4. listening
|
|
193
|
-
* 5. message
|
|
194
|
-
* 6. online
|
|
195
|
-
* 7. setup
|
|
196
|
-
*/
|
|
197
|
-
function addListener(event: string, listener: (...args: any[]) => void): Cluster;
|
|
198
|
-
function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
|
199
|
-
function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
200
|
-
function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
201
|
-
function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
202
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
203
|
-
function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
|
|
204
|
-
function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
205
|
-
function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
206
|
-
|
|
207
|
-
function emit(event: string | symbol, ...args: any[]): boolean;
|
|
208
|
-
function emit(event: "disconnect", worker: Worker): boolean;
|
|
209
|
-
function emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
|
210
|
-
function emit(event: "fork", worker: Worker): boolean;
|
|
211
|
-
function emit(event: "listening", worker: Worker, address: Address): boolean;
|
|
212
|
-
function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
|
213
|
-
function emit(event: "online", worker: Worker): boolean;
|
|
214
|
-
function emit(event: "setup", settings: ClusterSettings): boolean;
|
|
215
|
-
|
|
216
|
-
function on(event: string, listener: (...args: any[]) => void): Cluster;
|
|
217
|
-
function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
|
218
|
-
function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
219
|
-
function on(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
220
|
-
function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
221
|
-
function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
|
|
222
|
-
function on(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
223
|
-
function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
224
|
-
|
|
225
|
-
function once(event: string, listener: (...args: any[]) => void): Cluster;
|
|
226
|
-
function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
|
227
|
-
function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
228
|
-
function once(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
229
|
-
function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
230
|
-
function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
|
|
231
|
-
function once(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
232
|
-
function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
233
|
-
|
|
234
|
-
function removeListener(event: string, listener: (...args: any[]) => void): Cluster;
|
|
235
|
-
function removeAllListeners(event?: string): Cluster;
|
|
236
|
-
function setMaxListeners(n: number): Cluster;
|
|
237
|
-
function getMaxListeners(): number;
|
|
238
|
-
function listeners(event: string): Function[];
|
|
239
|
-
function listenerCount(type: string): number;
|
|
240
|
-
|
|
241
|
-
function prependListener(event: string, listener: (...args: any[]) => void): Cluster;
|
|
242
|
-
function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
|
243
|
-
function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
244
|
-
function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
245
|
-
function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
246
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
247
|
-
function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
|
|
248
|
-
function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
249
|
-
function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
250
|
-
|
|
251
|
-
function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
|
|
252
|
-
function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
|
253
|
-
function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
|
254
|
-
function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
|
255
|
-
function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
|
256
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
257
|
-
function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
|
|
258
|
-
function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
|
259
|
-
function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
|
|
181
|
+
const cluster: Cluster;
|
|
182
|
+
export default cluster;
|
|
183
|
+
}
|
|
260
184
|
|
|
261
|
-
|
|
185
|
+
declare module 'node:cluster' {
|
|
186
|
+
export * from 'cluster';
|
|
262
187
|
}
|
|
@@ -4,7 +4,7 @@ declare module 'console' {
|
|
|
4
4
|
global {
|
|
5
5
|
// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
|
|
6
6
|
interface Console {
|
|
7
|
-
Console:
|
|
7
|
+
Console: console.ConsoleConstructor;
|
|
8
8
|
/**
|
|
9
9
|
* A simple assertion test that verifies whether `value` is truthy.
|
|
10
10
|
* If it is not, an `AssertionError` is thrown.
|
|
@@ -25,16 +25,16 @@ declare module 'console' {
|
|
|
25
25
|
*/
|
|
26
26
|
countReset(label?: string): void;
|
|
27
27
|
/**
|
|
28
|
-
* The `console.debug()` function is an alias for {@link console.log
|
|
28
|
+
* The `console.debug()` function is an alias for {@link console.log}.
|
|
29
29
|
*/
|
|
30
30
|
debug(message?: any, ...optionalParams: any[]): void;
|
|
31
31
|
/**
|
|
32
|
-
* Uses {@link util.inspect
|
|
32
|
+
* Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
|
|
33
33
|
* This function bypasses any custom `inspect()` function defined on `obj`.
|
|
34
34
|
*/
|
|
35
35
|
dir(obj: any, options?: InspectOptions): void;
|
|
36
36
|
/**
|
|
37
|
-
* This method calls {@link console.log
|
|
37
|
+
* This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
|
|
38
38
|
*/
|
|
39
39
|
dirxml(...data: any[]): void;
|
|
40
40
|
/**
|
|
@@ -47,7 +47,7 @@ declare module 'console' {
|
|
|
47
47
|
*/
|
|
48
48
|
group(...label: any[]): void;
|
|
49
49
|
/**
|
|
50
|
-
* The `console.groupCollapsed()` function is an alias for {@link console.group
|
|
50
|
+
* The `console.groupCollapsed()` function is an alias for {@link console.group}.
|
|
51
51
|
*/
|
|
52
52
|
groupCollapsed(...label: any[]): void;
|
|
53
53
|
/**
|
|
@@ -55,7 +55,7 @@ declare module 'console' {
|
|
|
55
55
|
*/
|
|
56
56
|
groupEnd(): void;
|
|
57
57
|
/**
|
|
58
|
-
* The {@link console.info
|
|
58
|
+
* The {@link console.info} function is an alias for {@link console.log}.
|
|
59
59
|
*/
|
|
60
60
|
info(message?: any, ...optionalParams: any[]): void;
|
|
61
61
|
/**
|
|
@@ -72,19 +72,19 @@ declare module 'console' {
|
|
|
72
72
|
*/
|
|
73
73
|
time(label?: string): void;
|
|
74
74
|
/**
|
|
75
|
-
* Stops a timer that was previously started by calling {@link console.time
|
|
75
|
+
* Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
|
|
76
76
|
*/
|
|
77
77
|
timeEnd(label?: string): void;
|
|
78
78
|
/**
|
|
79
|
-
* For a timer that was previously started by calling {@link console.time
|
|
79
|
+
* For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
|
|
80
80
|
*/
|
|
81
81
|
timeLog(label?: string, ...data: any[]): void;
|
|
82
82
|
/**
|
|
83
|
-
* Prints to `stderr` the string 'Trace :', followed by the {@link util.format
|
|
83
|
+
* Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
|
|
84
84
|
*/
|
|
85
85
|
trace(message?: any, ...optionalParams: any[]): void;
|
|
86
86
|
/**
|
|
87
|
-
* The {@link console.warn
|
|
87
|
+
* The {@link console.warn} function is an alias for {@link console.error}.
|
|
88
88
|
*/
|
|
89
89
|
warn(message?: any, ...optionalParams: any[]): void;
|
|
90
90
|
|
|
@@ -106,12 +106,10 @@ declare module 'console' {
|
|
|
106
106
|
timeStamp(label?: string): void;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
namespace NodeJS {
|
|
109
|
+
namespace console {
|
|
112
110
|
interface ConsoleConstructorOptions {
|
|
113
|
-
stdout: WritableStream;
|
|
114
|
-
stderr?: WritableStream;
|
|
111
|
+
stdout: NodeJS.WritableStream;
|
|
112
|
+
stderr?: NodeJS.WritableStream;
|
|
115
113
|
ignoreErrors?: boolean;
|
|
116
114
|
colorMode?: boolean | 'auto';
|
|
117
115
|
inspectOptions?: InspectOptions;
|
|
@@ -119,15 +117,18 @@ declare module 'console' {
|
|
|
119
117
|
|
|
120
118
|
interface ConsoleConstructor {
|
|
121
119
|
prototype: Console;
|
|
122
|
-
new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
|
|
120
|
+
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
|
123
121
|
new(options: ConsoleConstructorOptions): Console;
|
|
124
122
|
}
|
|
125
|
-
|
|
126
|
-
interface Global {
|
|
127
|
-
console: typeof console;
|
|
128
|
-
}
|
|
129
123
|
}
|
|
124
|
+
|
|
125
|
+
var console: Console;
|
|
130
126
|
}
|
|
131
127
|
|
|
128
|
+
export = globalThis.console;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare module 'node:console' {
|
|
132
|
+
import console = require('console');
|
|
132
133
|
export = console;
|
|
133
134
|
}
|
|
@@ -196,11 +196,9 @@ declare module 'crypto' {
|
|
|
196
196
|
cipher?: string;
|
|
197
197
|
passphrase?: string | Buffer;
|
|
198
198
|
}
|
|
199
|
-
|
|
200
199
|
interface JwkKeyExportOptions {
|
|
201
200
|
format: 'jwk';
|
|
202
201
|
}
|
|
203
|
-
|
|
204
202
|
interface JsonWebKey {
|
|
205
203
|
crv?: string;
|
|
206
204
|
d?: string;
|
|
@@ -215,6 +213,7 @@ declare module 'crypto' {
|
|
|
215
213
|
qi?: string;
|
|
216
214
|
x?: string;
|
|
217
215
|
y?: string;
|
|
216
|
+
[key: string]: unknown;
|
|
218
217
|
}
|
|
219
218
|
|
|
220
219
|
interface AsymmetricKeyDetails {
|
|
@@ -236,6 +235,10 @@ declare module 'crypto' {
|
|
|
236
235
|
namedCurve?: string;
|
|
237
236
|
}
|
|
238
237
|
|
|
238
|
+
interface JwkKeyExportOptions {
|
|
239
|
+
format: 'jwk';
|
|
240
|
+
}
|
|
241
|
+
|
|
239
242
|
class KeyObject {
|
|
240
243
|
private constructor();
|
|
241
244
|
asymmetricKeyType?: KeyType;
|
|
@@ -253,6 +256,7 @@ declare module 'crypto' {
|
|
|
253
256
|
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
254
257
|
export(options: KeyExportOptions<'pem'>): string | Buffer;
|
|
255
258
|
export(options?: KeyExportOptions<'der'>): Buffer;
|
|
259
|
+
export(options?: JwkKeyExportOptions): JsonWebKey;
|
|
256
260
|
symmetricKeySize?: number;
|
|
257
261
|
type: KeyObjectType;
|
|
258
262
|
}
|
|
@@ -376,8 +380,15 @@ declare module 'crypto' {
|
|
|
376
380
|
type?: 'pkcs1' | 'spki';
|
|
377
381
|
}
|
|
378
382
|
|
|
379
|
-
function
|
|
380
|
-
|
|
383
|
+
function generateKey(type: 'hmac' | 'aes', options: {length: number}, callback: (err: Error | null, key: KeyObject) => void): void;
|
|
384
|
+
|
|
385
|
+
interface JsonWebKeyInput {
|
|
386
|
+
key: JsonWebKey;
|
|
387
|
+
format: 'jwk';
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
|
|
391
|
+
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
|
|
381
392
|
function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
|
|
382
393
|
|
|
383
394
|
function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
|
|
@@ -481,7 +492,7 @@ declare module 'crypto' {
|
|
|
481
492
|
iterations: number,
|
|
482
493
|
keylen: number,
|
|
483
494
|
digest: string,
|
|
484
|
-
callback: (err: Error | null, derivedKey: Buffer) =>
|
|
495
|
+
callback: (err: Error | null, derivedKey: Buffer) => void,
|
|
485
496
|
): void;
|
|
486
497
|
function pbkdf2Sync(
|
|
487
498
|
password: BinaryLike,
|
|
@@ -1316,7 +1327,7 @@ declare module 'crypto' {
|
|
|
1316
1327
|
* The successfully generated `derivedKey` will be passed to the callback as an `ArrayBuffer`.
|
|
1317
1328
|
* An error will be thrown if any of the input aguments specify invalid values or types.
|
|
1318
1329
|
*/
|
|
1319
|
-
function hkdf(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) =>
|
|
1330
|
+
function hkdf(digest: string, key: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void;
|
|
1320
1331
|
|
|
1321
1332
|
/**
|
|
1322
1333
|
* Provides a synchronous HKDF key derivation function as defined in RFC 5869.
|
|
@@ -1576,3 +1587,7 @@ declare module 'crypto' {
|
|
|
1576
1587
|
*/
|
|
1577
1588
|
function checkPrimeSync(value: LargeNumberLike, options?: CheckPrimeOptions): boolean;
|
|
1578
1589
|
}
|
|
1590
|
+
|
|
1591
|
+
declare module 'node:crypto' {
|
|
1592
|
+
export * from 'crypto';
|
|
1593
|
+
}
|
node/domain.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated
|
|
3
|
+
*/
|
|
4
|
+
declare module 'domain' {
|
|
5
|
+
import EventEmitter = require('events');
|
|
6
|
+
class Domain extends EventEmitter {
|
|
7
|
+
members: Array<EventEmitter | NodeJS.Timer>;
|
|
8
|
+
enter(): void;
|
|
9
|
+
exit(): void;
|
|
10
|
+
run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
|
|
11
|
+
add(emitter: EventEmitter | NodeJS.Timer): void;
|
|
12
|
+
remove(emitter: EventEmitter | NodeJS.Timer): void;
|
|
13
|
+
bind<T extends Function>(cb: T): T;
|
|
14
|
+
intercept<T extends Function>(cb: T): T;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function create(): Domain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
*/
|
|
23
|
+
declare module 'node:domain' {
|
|
24
|
+
export * from 'domain';
|
|
25
|
+
}
|
|
@@ -875,17 +875,6 @@ declare module 'fs' {
|
|
|
875
875
|
* @default 0
|
|
876
876
|
*/
|
|
877
877
|
maxRetries?: number;
|
|
878
|
-
/**
|
|
879
|
-
* @deprecated since v14.14.0 In future versions of Node.js,
|
|
880
|
-
* `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file.
|
|
881
|
-
* Use `fs.rm(path, { recursive: true, force: true })` instead.
|
|
882
|
-
*
|
|
883
|
-
* If `true`, perform a recursive directory removal. In
|
|
884
|
-
* recursive mode, errors are not reported if `path` does not exist, and
|
|
885
|
-
* operations are retried on failure.
|
|
886
|
-
* @default false
|
|
887
|
-
*/
|
|
888
|
-
recursive?: boolean;
|
|
889
878
|
/**
|
|
890
879
|
* The amount of time in milliseconds to wait between retries.
|
|
891
880
|
* This option is ignored if the `recursive` option is not `true`.
|
|
@@ -933,8 +922,7 @@ declare module 'fs' {
|
|
|
933
922
|
maxRetries?: number;
|
|
934
923
|
/**
|
|
935
924
|
* If `true`, perform a recursive directory removal. In
|
|
936
|
-
* recursive mode,
|
|
937
|
-
* operations are retried on failure.
|
|
925
|
+
* recursive mode, operations are retried on failure.
|
|
938
926
|
* @default false
|
|
939
927
|
*/
|
|
940
928
|
recursive?: boolean;
|
|
@@ -1572,7 +1560,7 @@ declare module 'fs' {
|
|
|
1572
1560
|
*/
|
|
1573
1561
|
export function readFile(
|
|
1574
1562
|
path: PathLike | number,
|
|
1575
|
-
options: { encoding: BufferEncoding; flag?: string; } & Abortable |
|
|
1563
|
+
options: { encoding: BufferEncoding; flag?: string; } & Abortable | string,
|
|
1576
1564
|
callback: (err: NodeJS.ErrnoException | null, data: string) => void,
|
|
1577
1565
|
): void;
|
|
1578
1566
|
|
|
@@ -1586,7 +1574,7 @@ declare module 'fs' {
|
|
|
1586
1574
|
export function readFile(
|
|
1587
1575
|
path: PathLike | number,
|
|
1588
1576
|
// TODO: unify the options across all readfile functions
|
|
1589
|
-
options: BaseEncodingOptions & { flag?: string; } & Abortable |
|
|
1577
|
+
options: BaseEncodingOptions & { flag?: string; } & Abortable | string | undefined | null,
|
|
1590
1578
|
callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void,
|
|
1591
1579
|
): void;
|
|
1592
1580
|
|
|
@@ -1616,7 +1604,7 @@ declare module 'fs' {
|
|
|
1616
1604
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1617
1605
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1618
1606
|
*/
|
|
1619
|
-
function __promisify__(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } |
|
|
1607
|
+
function __promisify__(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | string): Promise<string>;
|
|
1620
1608
|
|
|
1621
1609
|
/**
|
|
1622
1610
|
* Asynchronously reads the entire contents of a file.
|
|
@@ -1626,7 +1614,7 @@ declare module 'fs' {
|
|
|
1626
1614
|
* @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
|
|
1627
1615
|
* If a flag is not provided, it defaults to `'r'`.
|
|
1628
1616
|
*/
|
|
1629
|
-
function __promisify__(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } |
|
|
1617
|
+
function __promisify__(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | string | null): Promise<string | Buffer>;
|
|
1630
1618
|
}
|
|
1631
1619
|
|
|
1632
1620
|
/**
|
|
@@ -1655,7 +1643,7 @@ declare module 'fs' {
|
|
|
1655
1643
|
*/
|
|
1656
1644
|
export function readFileSync(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | BufferEncoding | null): string | Buffer;
|
|
1657
1645
|
|
|
1658
|
-
export type WriteFileOptions = (BaseEncodingOptions & Abortable & { mode?: Mode; flag?: string; }) |
|
|
1646
|
+
export type WriteFileOptions = (BaseEncodingOptions & Abortable & { mode?: Mode; flag?: string; }) | string | null;
|
|
1659
1647
|
|
|
1660
1648
|
/**
|
|
1661
1649
|
* Asynchronously writes data to a file, replacing the file if it already exists.
|
|
@@ -2059,13 +2047,13 @@ declare module 'fs' {
|
|
|
2059
2047
|
* Returns a new `ReadStream` object.
|
|
2060
2048
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2061
2049
|
*/
|
|
2062
|
-
export function createReadStream(path: PathLike, options?:
|
|
2050
|
+
export function createReadStream(path: PathLike, options?: string | ReadStreamOptions): ReadStream;
|
|
2063
2051
|
|
|
2064
2052
|
/**
|
|
2065
2053
|
* Returns a new `WriteStream` object.
|
|
2066
2054
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2067
2055
|
*/
|
|
2068
|
-
export function createWriteStream(path: PathLike, options?:
|
|
2056
|
+
export function createWriteStream(path: PathLike, options?: string | StreamOptions): WriteStream;
|
|
2069
2057
|
|
|
2070
2058
|
/**
|
|
2071
2059
|
* Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
|
|
@@ -2237,3 +2225,7 @@ declare module 'fs' {
|
|
|
2237
2225
|
throwIfNoEntry?: boolean;
|
|
2238
2226
|
}
|
|
2239
2227
|
}
|
|
2228
|
+
|
|
2229
|
+
declare module 'node:fs' {
|
|
2230
|
+
export * from 'fs';
|
|
2231
|
+
}
|