@types/node 14.10.2 → 14.11.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/ts3.1/process.d.ts DELETED
@@ -1,405 +0,0 @@
1
- declare module "process" {
2
- import * as tty from "tty";
3
-
4
- global {
5
- var process: NodeJS.Process;
6
-
7
- namespace NodeJS {
8
- // this namespace merge is here because these are specifically used
9
- // as the type for process.stdin, process.stdout, and process.stderr.
10
- // they can't live in tty.d.ts because we need to disambiguate the imported name.
11
- interface ReadStream extends tty.ReadStream {}
12
- interface WriteStream extends tty.WriteStream {}
13
-
14
- interface MemoryUsage {
15
- rss: number;
16
- heapTotal: number;
17
- heapUsed: number;
18
- external: number;
19
- arrayBuffers: number;
20
- }
21
-
22
- interface CpuUsage {
23
- user: number;
24
- system: number;
25
- }
26
-
27
- interface ProcessRelease {
28
- name: string;
29
- sourceUrl?: string;
30
- headersUrl?: string;
31
- libUrl?: string;
32
- lts?: string;
33
- }
34
-
35
- interface ProcessVersions extends Dict<string> {
36
- http_parser: string;
37
- node: string;
38
- v8: string;
39
- ares: string;
40
- uv: string;
41
- zlib: string;
42
- modules: string;
43
- openssl: string;
44
- }
45
-
46
- type Platform = 'aix'
47
- | 'android'
48
- | 'darwin'
49
- | 'freebsd'
50
- | 'linux'
51
- | 'openbsd'
52
- | 'sunos'
53
- | 'win32'
54
- | 'cygwin'
55
- | 'netbsd';
56
-
57
- type Signals =
58
- "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
59
- "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" |
60
- "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
61
- "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
62
-
63
- type MultipleResolveType = 'resolve' | 'reject';
64
-
65
- type BeforeExitListener = (code: number) => void;
66
- type DisconnectListener = () => void;
67
- type ExitListener = (code: number) => void;
68
- type RejectionHandledListener = (promise: Promise<any>) => void;
69
- type UncaughtExceptionListener = (error: Error) => void;
70
- type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
71
- type WarningListener = (warning: Error) => void;
72
- type MessageListener = (message: any, sendHandle: any) => void;
73
- type SignalsListener = (signal: Signals) => void;
74
- type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
75
- type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
76
- type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
77
-
78
- interface Socket extends ReadWriteStream {
79
- isTTY?: true;
80
- }
81
-
82
- // Alias for compatibility
83
- interface ProcessEnv extends Dict<string> {}
84
-
85
- interface HRTime {
86
- (time?: [number, number]): [number, number];
87
- }
88
-
89
- interface ProcessReport {
90
- /**
91
- * Directory where the report is written.
92
- * working directory of the Node.js process.
93
- * @default '' indicating that reports are written to the current
94
- */
95
- directory: string;
96
-
97
- /**
98
- * Filename where the report is written.
99
- * The default value is the empty string.
100
- * @default '' the output filename will be comprised of a timestamp,
101
- * PID, and sequence number.
102
- */
103
- filename: string;
104
-
105
- /**
106
- * Returns a JSON-formatted diagnostic report for the running process.
107
- * The report's JavaScript stack trace is taken from err, if present.
108
- */
109
- getReport(err?: Error): string;
110
-
111
- /**
112
- * If true, a diagnostic report is generated on fatal errors,
113
- * such as out of memory errors or failed C++ assertions.
114
- * @default false
115
- */
116
- reportOnFatalError: boolean;
117
-
118
- /**
119
- * If true, a diagnostic report is generated when the process
120
- * receives the signal specified by process.report.signal.
121
- * @defaul false
122
- */
123
- reportOnSignal: boolean;
124
-
125
- /**
126
- * If true, a diagnostic report is generated on uncaught exception.
127
- * @default false
128
- */
129
- reportOnUncaughtException: boolean;
130
-
131
- /**
132
- * The signal used to trigger the creation of a diagnostic report.
133
- * @default 'SIGUSR2'
134
- */
135
- signal: Signals;
136
-
137
- /**
138
- * Writes a diagnostic report to a file. If filename is not provided, the default filename
139
- * includes the date, time, PID, and a sequence number.
140
- * The report's JavaScript stack trace is taken from err, if present.
141
- *
142
- * @param fileName Name of the file where the report is written.
143
- * This should be a relative path, that will be appended to the directory specified in
144
- * `process.report.directory`, or the current working directory of the Node.js process,
145
- * if unspecified.
146
- * @param error A custom error used for reporting the JavaScript stack.
147
- * @return Filename of the generated report.
148
- */
149
- writeReport(fileName?: string): string;
150
- writeReport(error?: Error): string;
151
- writeReport(fileName?: string, err?: Error): string;
152
- }
153
-
154
- interface ResourceUsage {
155
- fsRead: number;
156
- fsWrite: number;
157
- involuntaryContextSwitches: number;
158
- ipcReceived: number;
159
- ipcSent: number;
160
- majorPageFault: number;
161
- maxRSS: number;
162
- minorPageFault: number;
163
- sharedMemorySize: number;
164
- signalsCount: number;
165
- swappedOut: number;
166
- systemCPUTime: number;
167
- unsharedDataSize: number;
168
- unsharedStackSize: number;
169
- userCPUTime: number;
170
- voluntaryContextSwitches: number;
171
- }
172
-
173
- interface Process extends EventEmitter {
174
- /**
175
- * Can also be a tty.WriteStream, not typed due to limitations.
176
- */
177
- stdout: WriteStream & {
178
- fd: 1;
179
- };
180
- /**
181
- * Can also be a tty.WriteStream, not typed due to limitations.
182
- */
183
- stderr: WriteStream & {
184
- fd: 2;
185
- };
186
- stdin: ReadStream & {
187
- fd: 0;
188
- };
189
- openStdin(): Socket;
190
- argv: string[];
191
- argv0: string;
192
- execArgv: string[];
193
- execPath: string;
194
- abort(): void;
195
- chdir(directory: string): void;
196
- cwd(): string;
197
- debugPort: number;
198
- emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
199
- env: ProcessEnv;
200
- exit(code?: number): never;
201
- exitCode?: number;
202
- getgid(): number;
203
- setgid(id: number | string): void;
204
- getuid(): number;
205
- setuid(id: number | string): void;
206
- geteuid(): number;
207
- seteuid(id: number | string): void;
208
- getegid(): number;
209
- setegid(id: number | string): void;
210
- getgroups(): number[];
211
- setgroups(groups: Array<string | number>): void;
212
- setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
213
- hasUncaughtExceptionCaptureCallback(): boolean;
214
- version: string;
215
- versions: ProcessVersions;
216
- config: {
217
- target_defaults: {
218
- cflags: any[];
219
- default_configuration: string;
220
- defines: string[];
221
- include_dirs: string[];
222
- libraries: string[];
223
- };
224
- variables: {
225
- clang: number;
226
- host_arch: string;
227
- node_install_npm: boolean;
228
- node_install_waf: boolean;
229
- node_prefix: string;
230
- node_shared_openssl: boolean;
231
- node_shared_v8: boolean;
232
- node_shared_zlib: boolean;
233
- node_use_dtrace: boolean;
234
- node_use_etw: boolean;
235
- node_use_openssl: boolean;
236
- target_arch: string;
237
- v8_no_strict_aliasing: number;
238
- v8_use_snapshot: boolean;
239
- visibility: string;
240
- };
241
- };
242
- kill(pid: number, signal?: string | number): true;
243
- pid: number;
244
- ppid: number;
245
- title: string;
246
- arch: string;
247
- platform: Platform;
248
- /** @deprecated since v14.0.0 - use `require.main` instead. */
249
- mainModule?: Module;
250
- memoryUsage(): MemoryUsage;
251
- cpuUsage(previousValue?: CpuUsage): CpuUsage;
252
- nextTick(callback: Function, ...args: any[]): void;
253
- release: ProcessRelease;
254
- features: {
255
- inspector: boolean;
256
- debug: boolean;
257
- uv: boolean;
258
- ipv6: boolean;
259
- tls_alpn: boolean;
260
- tls_sni: boolean;
261
- tls_ocsp: boolean;
262
- tls: boolean;
263
- };
264
- /**
265
- * @deprecated since v14.0.0 - Calling process.umask() with no argument causes
266
- * the process-wide umask to be written twice. This introduces a race condition between threads,
267
- * and is a potential security vulnerability. There is no safe, cross-platform alternative API.
268
- */
269
- umask(): number;
270
- /**
271
- * Can only be set if not in worker thread.
272
- */
273
- umask(mask: number): number;
274
- uptime(): number;
275
- hrtime: HRTime;
276
- domain: Domain;
277
-
278
- // Worker
279
- send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
280
- disconnect(): void;
281
- connected: boolean;
282
-
283
- /**
284
- * The `process.allowedNodeEnvironmentFlags` property is a special,
285
- * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][]
286
- * environment variable.
287
- */
288
- allowedNodeEnvironmentFlags: ReadonlySet<string>;
289
-
290
- /**
291
- * Only available with `--experimental-report`
292
- */
293
- report?: ProcessReport;
294
-
295
- resourceUsage(): ResourceUsage;
296
-
297
- /* EventEmitter */
298
- addListener(event: "beforeExit", listener: BeforeExitListener): this;
299
- addListener(event: "disconnect", listener: DisconnectListener): this;
300
- addListener(event: "exit", listener: ExitListener): this;
301
- addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
302
- addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
303
- addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
304
- addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
305
- addListener(event: "warning", listener: WarningListener): this;
306
- addListener(event: "message", listener: MessageListener): this;
307
- addListener(event: Signals, listener: SignalsListener): this;
308
- addListener(event: "newListener", listener: NewListenerListener): this;
309
- addListener(event: "removeListener", listener: RemoveListenerListener): this;
310
- addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
311
-
312
- emit(event: "beforeExit", code: number): boolean;
313
- emit(event: "disconnect"): boolean;
314
- emit(event: "exit", code: number): boolean;
315
- emit(event: "rejectionHandled", promise: Promise<any>): boolean;
316
- emit(event: "uncaughtException", error: Error): boolean;
317
- emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
318
- emit(event: "unhandledRejection", reason: any, promise: Promise<any>): boolean;
319
- emit(event: "warning", warning: Error): boolean;
320
- emit(event: "message", message: any, sendHandle: any): this;
321
- emit(event: Signals, signal: Signals): boolean;
322
- emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
323
- emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
324
- emit(event: "multipleResolves", listener: MultipleResolveListener): this;
325
-
326
- on(event: "beforeExit", listener: BeforeExitListener): this;
327
- on(event: "disconnect", listener: DisconnectListener): this;
328
- on(event: "exit", listener: ExitListener): this;
329
- on(event: "rejectionHandled", listener: RejectionHandledListener): this;
330
- on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
331
- on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
332
- on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
333
- on(event: "warning", listener: WarningListener): this;
334
- on(event: "message", listener: MessageListener): this;
335
- on(event: Signals, listener: SignalsListener): this;
336
- on(event: "newListener", listener: NewListenerListener): this;
337
- on(event: "removeListener", listener: RemoveListenerListener): this;
338
- on(event: "multipleResolves", listener: MultipleResolveListener): this;
339
- on(event: string | symbol, listener: (...args: any[]) => void): this;
340
-
341
- once(event: "beforeExit", listener: BeforeExitListener): this;
342
- once(event: "disconnect", listener: DisconnectListener): this;
343
- once(event: "exit", listener: ExitListener): this;
344
- once(event: "rejectionHandled", listener: RejectionHandledListener): this;
345
- once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
346
- once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
347
- once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
348
- once(event: "warning", listener: WarningListener): this;
349
- once(event: "message", listener: MessageListener): this;
350
- once(event: Signals, listener: SignalsListener): this;
351
- once(event: "newListener", listener: NewListenerListener): this;
352
- once(event: "removeListener", listener: RemoveListenerListener): this;
353
- once(event: "multipleResolves", listener: MultipleResolveListener): this;
354
-
355
- prependListener(event: "beforeExit", listener: BeforeExitListener): this;
356
- prependListener(event: "disconnect", listener: DisconnectListener): this;
357
- prependListener(event: "exit", listener: ExitListener): this;
358
- prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
359
- prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
360
- prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
361
- prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
362
- prependListener(event: "warning", listener: WarningListener): this;
363
- prependListener(event: "message", listener: MessageListener): this;
364
- prependListener(event: Signals, listener: SignalsListener): this;
365
- prependListener(event: "newListener", listener: NewListenerListener): this;
366
- prependListener(event: "removeListener", listener: RemoveListenerListener): this;
367
- prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
368
-
369
- prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
370
- prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
371
- prependOnceListener(event: "exit", listener: ExitListener): this;
372
- prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
373
- prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
374
- prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
375
- prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
376
- prependOnceListener(event: "warning", listener: WarningListener): this;
377
- prependOnceListener(event: "message", listener: MessageListener): this;
378
- prependOnceListener(event: Signals, listener: SignalsListener): this;
379
- prependOnceListener(event: "newListener", listener: NewListenerListener): this;
380
- prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
381
- prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
382
-
383
- listeners(event: "beforeExit"): BeforeExitListener[];
384
- listeners(event: "disconnect"): DisconnectListener[];
385
- listeners(event: "exit"): ExitListener[];
386
- listeners(event: "rejectionHandled"): RejectionHandledListener[];
387
- listeners(event: "uncaughtException"): UncaughtExceptionListener[];
388
- listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[];
389
- listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
390
- listeners(event: "warning"): WarningListener[];
391
- listeners(event: "message"): MessageListener[];
392
- listeners(event: Signals): SignalsListener[];
393
- listeners(event: "newListener"): NewListenerListener[];
394
- listeners(event: "removeListener"): RemoveListenerListener[];
395
- listeners(event: "multipleResolves"): MultipleResolveListener[];
396
- }
397
-
398
- interface Global {
399
- process: Process;
400
- }
401
- }
402
- }
403
-
404
- export = process;
405
- }
node/ts3.1/util.d.ts DELETED
@@ -1,194 +0,0 @@
1
- declare module "util" {
2
- interface InspectOptions extends NodeJS.InspectOptions { }
3
- type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
4
- type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
5
- interface InspectOptionsStylized extends InspectOptions {
6
- stylize(text: string, styleType: Style): string;
7
- }
8
- function format(format: any, ...param: any[]): string;
9
- function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string;
10
- /** @deprecated since v0.11.3 - use a third party module instead. */
11
- function log(string: string): void;
12
- function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
13
- function inspect(object: any, options: InspectOptions): string;
14
- namespace inspect {
15
- let colors: NodeJS.Dict<[number, number]>;
16
- let styles: {
17
- [K in Style]: string
18
- };
19
- let defaultOptions: InspectOptions;
20
- /**
21
- * Allows changing inspect settings from the repl.
22
- */
23
- let replDefaults: InspectOptions;
24
- const custom: unique symbol;
25
- }
26
- /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */
27
- function isArray(object: any): object is any[];
28
- /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */
29
- function isRegExp(object: any): object is RegExp;
30
- /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */
31
- function isDate(object: any): object is Date;
32
- /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
33
- function isError(object: any): object is Error;
34
- function inherits(constructor: any, superConstructor: any): void;
35
- function debuglog(key: string): (msg: string, ...param: any[]) => void;
36
- /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
37
- function isBoolean(object: any): object is boolean;
38
- /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
39
- function isBuffer(object: any): object is Buffer;
40
- /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */
41
- function isFunction(object: any): boolean;
42
- /** @deprecated since v4.0.0 - use `value === null` instead. */
43
- function isNull(object: any): object is null;
44
- /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */
45
- function isNullOrUndefined(object: any): object is null | undefined;
46
- /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */
47
- function isNumber(object: any): object is number;
48
- /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */
49
- function isObject(object: any): boolean;
50
- /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */
51
- function isPrimitive(object: any): boolean;
52
- /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
53
- function isString(object: any): object is string;
54
- /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */
55
- function isSymbol(object: any): object is symbol;
56
- /** @deprecated since v4.0.0 - use `value === undefined` instead. */
57
- function isUndefined(object: any): object is undefined;
58
- function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
59
- function isDeepStrictEqual(val1: any, val2: any): boolean;
60
-
61
- function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
62
- function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
63
- function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
64
- function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
65
- function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
66
- function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
67
- function callbackify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
68
- function callbackify<T1, T2, T3, TResult>(
69
- fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
70
- function callbackify<T1, T2, T3, T4>(
71
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
72
- function callbackify<T1, T2, T3, T4, TResult>(
73
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
74
- function callbackify<T1, T2, T3, T4, T5>(
75
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
76
- function callbackify<T1, T2, T3, T4, T5, TResult>(
77
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
78
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
79
- function callbackify<T1, T2, T3, T4, T5, T6>(
80
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
81
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
82
- function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
83
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>
84
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
85
-
86
- interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
87
- __promisify__: TCustom;
88
- }
89
-
90
- interface CustomPromisifySymbol<TCustom extends Function> extends Function {
91
- [promisify.custom]: TCustom;
92
- }
93
-
94
- type CustomPromisify<TCustom extends Function> = CustomPromisifySymbol<TCustom> | CustomPromisifyLegacy<TCustom>;
95
-
96
- function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
97
- function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
98
- function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
99
- function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
100
- function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
101
- function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
102
- function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
103
- function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
104
- (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
105
- function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
106
- function promisify<T1, T2, T3, T4, TResult>(
107
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
108
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
109
- function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
110
- (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
111
- function promisify<T1, T2, T3, T4, T5, TResult>(
112
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
113
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
114
- function promisify<T1, T2, T3, T4, T5>(
115
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
116
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
117
- function promisify(fn: Function): Function;
118
- namespace promisify {
119
- const custom: unique symbol;
120
- }
121
-
122
- namespace types {
123
- function isAnyArrayBuffer(object: any): boolean;
124
- function isArgumentsObject(object: any): object is IArguments;
125
- function isArrayBuffer(object: any): object is ArrayBuffer;
126
- function isArrayBufferView(object: any): object is ArrayBufferView;
127
- function isAsyncFunction(object: any): boolean;
128
- function isBooleanObject(object: any): object is Boolean;
129
- function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */);
130
- function isDataView(object: any): object is DataView;
131
- function isDate(object: any): object is Date;
132
- function isExternal(object: any): boolean;
133
- function isFloat32Array(object: any): object is Float32Array;
134
- function isFloat64Array(object: any): object is Float64Array;
135
- function isGeneratorFunction(object: any): boolean;
136
- function isGeneratorObject(object: any): boolean;
137
- function isInt8Array(object: any): object is Int8Array;
138
- function isInt16Array(object: any): object is Int16Array;
139
- function isInt32Array(object: any): object is Int32Array;
140
- function isMap(object: any): boolean;
141
- function isMapIterator(object: any): boolean;
142
- function isModuleNamespaceObject(value: any): boolean;
143
- function isNativeError(object: any): object is Error;
144
- function isNumberObject(object: any): object is Number;
145
- function isPromise(object: any): boolean;
146
- function isProxy(object: any): boolean;
147
- function isRegExp(object: any): object is RegExp;
148
- function isSet(object: any): boolean;
149
- function isSetIterator(object: any): boolean;
150
- function isSharedArrayBuffer(object: any): boolean;
151
- function isStringObject(object: any): boolean;
152
- function isSymbolObject(object: any): boolean;
153
- function isTypedArray(object: any): object is NodeJS.TypedArray;
154
- function isUint8Array(object: any): object is Uint8Array;
155
- function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
156
- function isUint16Array(object: any): object is Uint16Array;
157
- function isUint32Array(object: any): object is Uint32Array;
158
- function isWeakMap(object: any): boolean;
159
- function isWeakSet(object: any): boolean;
160
- function isWebAssemblyCompiledModule(object: any): boolean;
161
- }
162
-
163
- class TextDecoder {
164
- readonly encoding: string;
165
- readonly fatal: boolean;
166
- readonly ignoreBOM: boolean;
167
- constructor(
168
- encoding?: string,
169
- options?: { fatal?: boolean; ignoreBOM?: boolean }
170
- );
171
- decode(
172
- input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
173
- options?: { stream?: boolean }
174
- ): string;
175
- }
176
-
177
- interface EncodeIntoResult {
178
- /**
179
- * The read Unicode code units of input.
180
- */
181
-
182
- read: number;
183
- /**
184
- * The written UTF-8 bytes of output.
185
- */
186
- written: number;
187
- }
188
-
189
- class TextEncoder {
190
- readonly encoding: string;
191
- encode(input?: string): Uint8Array;
192
- encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
193
- }
194
- }