@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/README.md +3 -3
- node/child_process.d.ts +1 -1
- node/crypto.d.ts +20 -12
- node/fs.d.ts +2141 -18
- node/globals.d.ts +600 -7
- node/http.d.ts +14 -0
- node/index.d.ts +2 -1
- node/package.json +7 -7
- node/process.d.ts +397 -3
- node/{ts3.1 → ts3.4}/assert.d.ts +0 -0
- node/ts3.4/base.d.ts +37 -4
- node/{ts3.1 → ts3.4}/globals.global.d.ts +0 -0
- node/ts3.4/index.d.ts +2 -6
- node/ts3.6/index.d.ts +1 -1
- node/util.d.ts +190 -3
- node/ts3.1/base.d.ts +0 -42
- node/ts3.1/fs.d.ts +0 -2132
- node/ts3.1/globals.d.ts +0 -598
- node/ts3.1/index.d.ts +0 -44
- node/ts3.1/process.d.ts +0 -405
- node/ts3.1/util.d.ts +0 -194
node/util.d.ts
CHANGED
|
@@ -1,9 +1,196 @@
|
|
|
1
|
-
// tslint:disable-next-line:no-bad-reference
|
|
2
|
-
/// <reference path="ts3.1/util.d.ts" />
|
|
3
|
-
|
|
4
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
|
+
|
|
5
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;
|
|
6
128
|
function isBigInt64Array(value: any): value is BigInt64Array;
|
|
7
129
|
function isBigUint64Array(value: any): value is BigUint64Array;
|
|
130
|
+
function isBooleanObject(object: any): object is Boolean;
|
|
131
|
+
function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */);
|
|
132
|
+
function isDataView(object: any): object is DataView;
|
|
133
|
+
function isDate(object: any): object is Date;
|
|
134
|
+
function isExternal(object: any): boolean;
|
|
135
|
+
function isFloat32Array(object: any): object is Float32Array;
|
|
136
|
+
function isFloat64Array(object: any): object is Float64Array;
|
|
137
|
+
function isGeneratorFunction(object: any): boolean;
|
|
138
|
+
function isGeneratorObject(object: any): boolean;
|
|
139
|
+
function isInt8Array(object: any): object is Int8Array;
|
|
140
|
+
function isInt16Array(object: any): object is Int16Array;
|
|
141
|
+
function isInt32Array(object: any): object is Int32Array;
|
|
142
|
+
function isMap(object: any): boolean;
|
|
143
|
+
function isMapIterator(object: any): boolean;
|
|
144
|
+
function isModuleNamespaceObject(value: any): boolean;
|
|
145
|
+
function isNativeError(object: any): object is Error;
|
|
146
|
+
function isNumberObject(object: any): object is Number;
|
|
147
|
+
function isPromise(object: any): boolean;
|
|
148
|
+
function isProxy(object: any): boolean;
|
|
149
|
+
function isRegExp(object: any): object is RegExp;
|
|
150
|
+
function isSet(object: any): boolean;
|
|
151
|
+
function isSetIterator(object: any): boolean;
|
|
152
|
+
function isSharedArrayBuffer(object: any): boolean;
|
|
153
|
+
function isStringObject(object: any): boolean;
|
|
154
|
+
function isSymbolObject(object: any): boolean;
|
|
155
|
+
function isTypedArray(object: any): object is NodeJS.TypedArray;
|
|
156
|
+
function isUint8Array(object: any): object is Uint8Array;
|
|
157
|
+
function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
|
|
158
|
+
function isUint16Array(object: any): object is Uint16Array;
|
|
159
|
+
function isUint32Array(object: any): object is Uint32Array;
|
|
160
|
+
function isWeakMap(object: any): boolean;
|
|
161
|
+
function isWeakSet(object: any): boolean;
|
|
162
|
+
function isWebAssemblyCompiledModule(object: any): boolean;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
class TextDecoder {
|
|
166
|
+
readonly encoding: string;
|
|
167
|
+
readonly fatal: boolean;
|
|
168
|
+
readonly ignoreBOM: boolean;
|
|
169
|
+
constructor(
|
|
170
|
+
encoding?: string,
|
|
171
|
+
options?: { fatal?: boolean; ignoreBOM?: boolean }
|
|
172
|
+
);
|
|
173
|
+
decode(
|
|
174
|
+
input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
|
|
175
|
+
options?: { stream?: boolean }
|
|
176
|
+
): string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface EncodeIntoResult {
|
|
180
|
+
/**
|
|
181
|
+
* The read Unicode code units of input.
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
read: number;
|
|
185
|
+
/**
|
|
186
|
+
* The written UTF-8 bytes of output.
|
|
187
|
+
*/
|
|
188
|
+
written: number;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
class TextEncoder {
|
|
192
|
+
readonly encoding: string;
|
|
193
|
+
encode(input?: string): Uint8Array;
|
|
194
|
+
encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
|
|
8
195
|
}
|
|
9
196
|
}
|
node/ts3.1/base.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// base definitions for all NodeJS modules that are not specific to any version of TypeScript
|
|
2
|
-
|
|
3
|
-
/// <reference path="globals.d.ts" />
|
|
4
|
-
/// <reference path="../async_hooks.d.ts" />
|
|
5
|
-
/// <reference path="../buffer.d.ts" />
|
|
6
|
-
/// <reference path="../child_process.d.ts" />
|
|
7
|
-
/// <reference path="../cluster.d.ts" />
|
|
8
|
-
/// <reference path="../console.d.ts" />
|
|
9
|
-
/// <reference path="../constants.d.ts" />
|
|
10
|
-
/// <reference path="../crypto.d.ts" />
|
|
11
|
-
/// <reference path="../dgram.d.ts" />
|
|
12
|
-
/// <reference path="../dns.d.ts" />
|
|
13
|
-
/// <reference path="../domain.d.ts" />
|
|
14
|
-
/// <reference path="../events.d.ts" />
|
|
15
|
-
/// <reference path="fs.d.ts" />
|
|
16
|
-
/// <reference path="../fs/promises.d.ts" />
|
|
17
|
-
/// <reference path="../http.d.ts" />
|
|
18
|
-
/// <reference path="../http2.d.ts" />
|
|
19
|
-
/// <reference path="../https.d.ts" />
|
|
20
|
-
/// <reference path="../inspector.d.ts" />
|
|
21
|
-
/// <reference path="../module.d.ts" />
|
|
22
|
-
/// <reference path="../net.d.ts" />
|
|
23
|
-
/// <reference path="../os.d.ts" />
|
|
24
|
-
/// <reference path="../path.d.ts" />
|
|
25
|
-
/// <reference path="../perf_hooks.d.ts" />
|
|
26
|
-
/// <reference path="process.d.ts" />
|
|
27
|
-
/// <reference path="../punycode.d.ts" />
|
|
28
|
-
/// <reference path="../querystring.d.ts" />
|
|
29
|
-
/// <reference path="../readline.d.ts" />
|
|
30
|
-
/// <reference path="../repl.d.ts" />
|
|
31
|
-
/// <reference path="../stream.d.ts" />
|
|
32
|
-
/// <reference path="../string_decoder.d.ts" />
|
|
33
|
-
/// <reference path="../timers.d.ts" />
|
|
34
|
-
/// <reference path="../tls.d.ts" />
|
|
35
|
-
/// <reference path="../trace_events.d.ts" />
|
|
36
|
-
/// <reference path="../tty.d.ts" />
|
|
37
|
-
/// <reference path="../url.d.ts" />
|
|
38
|
-
/// <reference path="util.d.ts" />
|
|
39
|
-
/// <reference path="../v8.d.ts" />
|
|
40
|
-
/// <reference path="../vm.d.ts" />
|
|
41
|
-
/// <reference path="../worker_threads.d.ts" />
|
|
42
|
-
/// <reference path="../zlib.d.ts" />
|