@types/node 11.15.51 → 12.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 v11.15/LICENSE → node/LICENSE +21 -21
- node/README.md +16 -0
- node v11.15/ts3.6/assert.d.ts → node/assert.d.ts +12 -33
- node v11.15/async_hooks.d.ts → node/async_hooks.d.ts +1 -13
- node/base.d.ts +41 -0
- {node v11.15 → node}/buffer.d.ts +0 -0
- node v11.15/child_process.d.ts → node/child_process.d.ts +8 -10
- {node v11.15 → node}/cluster.d.ts +0 -0
- {node v11.15 → node}/console.d.ts +0 -0
- node v11.15/constants.d.ts → node/constants.d.ts +0 -36
- node v11.15/crypto.d.ts → node/crypto.d.ts +112 -264
- node v11.15/dgram.d.ts → node/dgram.d.ts +1 -1
- node v11.15/dns.d.ts → node/dns.d.ts +1 -75
- node/domain.d.ts +16 -0
- node/events.d.ts +30 -0
- node v11.15/fs.d.ts → node/fs.d.ts +9 -17
- node v11.15/globals.d.ts → node/globals.d.ts +18 -93
- node v11.15/http.d.ts → node/http.d.ts +5 -9
- node v11.15/http2.d.ts → node/http2.d.ts +3 -3
- {node v11.15 → node}/https.d.ts +0 -0
- node/index.d.ts +99 -0
- node v11.15/inspector.d.ts → node/inspector.d.ts +2 -2
- {node v11.15 → node}/module.d.ts +0 -0
- {node v11.15 → node}/net.d.ts +0 -0
- node v11.15/os.d.ts → node/os.d.ts +0 -4
- node v11.15/package.json → node/package.json +34 -24
- {node v11.15 → node}/path.d.ts +0 -0
- node v11.15/perf_hooks.d.ts → node/perf_hooks.d.ts +77 -5
- {node v11.15 → node}/process.d.ts +0 -0
- node/punycode.d.ts +12 -0
- node v11.15/querystring.d.ts → node/querystring.d.ts +4 -9
- node v11.15/readline.d.ts → node/readline.d.ts +1 -2
- node v11.15/repl.d.ts → node/repl.d.ts +2 -10
- node v11.15/stream.d.ts → node/stream.d.ts +6 -16
- {node v11.15 → node}/string_decoder.d.ts +0 -0
- {node v11.15 → node}/timers.d.ts +0 -0
- node v11.15/tls.d.ts → node/tls.d.ts +3 -4
- {node v11.15 → node}/trace_events.d.ts +0 -0
- node/ts3.2/globals.d.ts +19 -0
- node v11.15/base.d.ts → node/ts3.2/index.d.ts +7 -6
- node/ts3.2/util.d.ts +15 -0
- node v11.15/tty.d.ts → node/tty.d.ts +0 -2
- node v11.15/url.d.ts → node/url.d.ts +1 -7
- node v11.15/util.d.ts → node/util.d.ts +20 -49
- {node v11.15 → node}/v8.d.ts +0 -0
- node v11.15/vm.d.ts → node/vm.d.ts +1 -3
- node v11.15/worker_threads.d.ts → node/worker_threads.d.ts +2 -4
- node v11.15/zlib.d.ts → node/zlib.d.ts +0 -1
- node v11.15/README.md +0 -16
- node v11.15/assert.d.ts +0 -99
- node v11.15/domain.d.ts +0 -16
- node v11.15/events.d.ts +0 -30
- node v11.15/index.d.ts +0 -44
- node v11.15/punycode.d.ts +0 -68
- node v11.15/ts3.6/base.d.ts +0 -54
- node v11.15/ts3.6/index.d.ts +0 -6
node/events.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare module "events" {
|
|
2
|
+
class internal extends NodeJS.EventEmitter { }
|
|
3
|
+
|
|
4
|
+
namespace internal {
|
|
5
|
+
function once(emitter: EventEmitter, event: string | symbol): Promise<any[]>;
|
|
6
|
+
class EventEmitter extends internal {
|
|
7
|
+
/** @deprecated since v4.0.0 */
|
|
8
|
+
static listenerCount(emitter: EventEmitter, event: string | symbol): number;
|
|
9
|
+
static defaultMaxListeners: number;
|
|
10
|
+
|
|
11
|
+
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
12
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
13
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
14
|
+
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
15
|
+
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
16
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
17
|
+
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
18
|
+
removeAllListeners(event?: string | symbol): this;
|
|
19
|
+
setMaxListeners(n: number): this;
|
|
20
|
+
getMaxListeners(): number;
|
|
21
|
+
listeners(event: string | symbol): Function[];
|
|
22
|
+
rawListeners(event: string | symbol): Function[];
|
|
23
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
24
|
+
eventNames(): Array<string | symbol>;
|
|
25
|
+
listenerCount(type: string | symbol): number;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export = internal;
|
|
30
|
+
}
|
|
@@ -442,7 +442,7 @@ declare module "fs" {
|
|
|
442
442
|
* @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
443
443
|
* @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
444
444
|
*/
|
|
445
|
-
function
|
|
445
|
+
function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
/**
|
|
@@ -710,7 +710,7 @@ declare module "fs" {
|
|
|
710
710
|
* A file mode. If a string is passed, it is parsed as an octal integer. If not specified
|
|
711
711
|
* @default 0o777.
|
|
712
712
|
*/
|
|
713
|
-
mode?: number
|
|
713
|
+
mode?: number;
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
/**
|
|
@@ -858,7 +858,7 @@ declare module "fs" {
|
|
|
858
858
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
859
859
|
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
|
|
860
860
|
*/
|
|
861
|
-
function readdir(path: PathLike, options: {
|
|
861
|
+
function readdir(path: PathLike, options: { withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void;
|
|
862
862
|
|
|
863
863
|
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
|
864
864
|
namespace readdir {
|
|
@@ -888,7 +888,7 @@ declare module "fs" {
|
|
|
888
888
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
889
889
|
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent
|
|
890
890
|
*/
|
|
891
|
-
function __promisify__(path: PathLike, options: {
|
|
891
|
+
function __promisify__(path: PathLike, options: { withFileTypes: true }): Promise<Dirent[]>;
|
|
892
892
|
}
|
|
893
893
|
|
|
894
894
|
/**
|
|
@@ -913,11 +913,11 @@ declare module "fs" {
|
|
|
913
913
|
function readdirSync(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): string[] | Buffer[];
|
|
914
914
|
|
|
915
915
|
/**
|
|
916
|
-
*
|
|
916
|
+
* Asynchronous readdir(3) - read a directory.
|
|
917
917
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
918
918
|
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
|
|
919
919
|
*/
|
|
920
|
-
function readdirSync(path: PathLike, options: {
|
|
920
|
+
function readdirSync(path: PathLike, options: { withFileTypes: true }): Dirent[];
|
|
921
921
|
|
|
922
922
|
/**
|
|
923
923
|
* Asynchronous close(2) - close a file descriptor.
|
|
@@ -1724,7 +1724,6 @@ declare module "fs" {
|
|
|
1724
1724
|
mode?: number;
|
|
1725
1725
|
autoClose?: boolean;
|
|
1726
1726
|
start?: number;
|
|
1727
|
-
highWaterMark?: number;
|
|
1728
1727
|
}): WriteStream;
|
|
1729
1728
|
|
|
1730
1729
|
/**
|
|
@@ -2057,28 +2056,21 @@ declare module "fs" {
|
|
|
2057
2056
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2058
2057
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2059
2058
|
*/
|
|
2060
|
-
function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null
|
|
2059
|
+
function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string[]>;
|
|
2061
2060
|
|
|
2062
2061
|
/**
|
|
2063
2062
|
* Asynchronous readdir(3) - read a directory.
|
|
2064
2063
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2065
2064
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2066
2065
|
*/
|
|
2067
|
-
function readdir(path: PathLike, options: { encoding: "buffer"
|
|
2066
|
+
function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer[]>;
|
|
2068
2067
|
|
|
2069
2068
|
/**
|
|
2070
2069
|
* Asynchronous readdir(3) - read a directory.
|
|
2071
2070
|
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2072
2071
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
|
2073
2072
|
*/
|
|
2074
|
-
function readdir(path: PathLike, options?: { encoding?: string | null
|
|
2075
|
-
|
|
2076
|
-
/**
|
|
2077
|
-
* Asynchronous readdir(3) - read a directory.
|
|
2078
|
-
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
|
2079
|
-
* @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
|
|
2080
|
-
*/
|
|
2081
|
-
function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise<Dirent[]>;
|
|
2073
|
+
function readdir(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string[] | Buffer[]>;
|
|
2082
2074
|
|
|
2083
2075
|
/**
|
|
2084
2076
|
* Asynchronous readlink(2) - read value of a symbolic link.
|
|
@@ -62,7 +62,7 @@ interface Console {
|
|
|
62
62
|
* This method does not display anything unless used in the inspector.
|
|
63
63
|
* Prints to `stdout` the array `array` formatted as a table.
|
|
64
64
|
*/
|
|
65
|
-
table(tabularData: any, properties?:
|
|
65
|
+
table(tabularData: any, properties?: string[]): void;
|
|
66
66
|
/**
|
|
67
67
|
* Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
|
|
68
68
|
*/
|
|
@@ -152,11 +152,6 @@ interface String {
|
|
|
152
152
|
trimLeft(): string;
|
|
153
153
|
/** Removes whitespace from the right end of a string. */
|
|
154
154
|
trimRight(): string;
|
|
155
|
-
|
|
156
|
-
/** Returns a copy with leading whitespace removed. */
|
|
157
|
-
trimStart(): string;
|
|
158
|
-
/** Returns a copy with trailing whitespace removed. */
|
|
159
|
-
trimEnd(): string;
|
|
160
155
|
}
|
|
161
156
|
|
|
162
157
|
/*-----------------------------------------------*
|
|
@@ -193,6 +188,7 @@ declare function queueMicrotask(callback: () => void): void;
|
|
|
193
188
|
|
|
194
189
|
// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
|
|
195
190
|
interface NodeRequireFunction {
|
|
191
|
+
/* tslint:disable-next-line:callable-types */
|
|
196
192
|
(id: string): any;
|
|
197
193
|
}
|
|
198
194
|
|
|
@@ -228,12 +224,6 @@ interface NodeModule {
|
|
|
228
224
|
loaded: boolean;
|
|
229
225
|
parent: NodeModule | null;
|
|
230
226
|
children: NodeModule[];
|
|
231
|
-
/**
|
|
232
|
-
* @since 11.14.0
|
|
233
|
-
*
|
|
234
|
-
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
|
|
235
|
-
*/
|
|
236
|
-
path: string;
|
|
237
227
|
paths: string[];
|
|
238
228
|
}
|
|
239
229
|
|
|
@@ -348,7 +338,7 @@ declare const Buffer: {
|
|
|
348
338
|
* @param array The octets to store.
|
|
349
339
|
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
|
350
340
|
*/
|
|
351
|
-
new(array:
|
|
341
|
+
new(array: any[]): Buffer;
|
|
352
342
|
/**
|
|
353
343
|
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
|
354
344
|
*
|
|
@@ -370,14 +360,8 @@ declare const Buffer: {
|
|
|
370
360
|
* Creates a new Buffer using the passed {data}
|
|
371
361
|
* @param data data to create a new Buffer
|
|
372
362
|
*/
|
|
373
|
-
from(data:
|
|
363
|
+
from(data: number[]): Buffer;
|
|
374
364
|
from(data: Uint8Array): Buffer;
|
|
375
|
-
/**
|
|
376
|
-
* Creates a new buffer containing the coerced value of an object
|
|
377
|
-
* A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
|
|
378
|
-
* @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
|
|
379
|
-
*/
|
|
380
|
-
from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
|
|
381
365
|
/**
|
|
382
366
|
* Creates a new Buffer containing the given JavaScript string {str}.
|
|
383
367
|
* If provided, the {encoding} parameter identifies the character encoding.
|
|
@@ -421,7 +405,7 @@ declare const Buffer: {
|
|
|
421
405
|
* @param totalLength Total length of the buffers when concatenated.
|
|
422
406
|
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
|
|
423
407
|
*/
|
|
424
|
-
concat(list:
|
|
408
|
+
concat(list: Uint8Array[], totalLength?: number): Buffer;
|
|
425
409
|
/**
|
|
426
410
|
* The same as buf1.compare(buf2).
|
|
427
411
|
*/
|
|
@@ -735,7 +719,6 @@ declare namespace NodeJS {
|
|
|
735
719
|
destroy(error?: Error): void;
|
|
736
720
|
}
|
|
737
721
|
interface ReadStream extends Socket {
|
|
738
|
-
readonly readableFlowing: boolean | null;
|
|
739
722
|
readonly readableHighWaterMark: number;
|
|
740
723
|
readonly readableLength: number;
|
|
741
724
|
isRaw?: boolean;
|
|
@@ -748,7 +731,6 @@ declare namespace NodeJS {
|
|
|
748
731
|
|
|
749
732
|
interface HRTime {
|
|
750
733
|
(time?: [number, number]): [number, number];
|
|
751
|
-
bigint(): bigint;
|
|
752
734
|
}
|
|
753
735
|
|
|
754
736
|
interface ProcessReport {
|
|
@@ -816,32 +798,6 @@ declare namespace NodeJS {
|
|
|
816
798
|
writeReport(fileName?: string, err?: Error): string;
|
|
817
799
|
}
|
|
818
800
|
|
|
819
|
-
interface EmitWarningOptions {
|
|
820
|
-
/**
|
|
821
|
-
* When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
|
|
822
|
-
*
|
|
823
|
-
* @default 'Warning'
|
|
824
|
-
*/
|
|
825
|
-
type?: string;
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* A unique identifier for the warning instance being emitted.
|
|
829
|
-
*/
|
|
830
|
-
code?: string;
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
|
|
834
|
-
*
|
|
835
|
-
* @default process.emitWarning
|
|
836
|
-
*/
|
|
837
|
-
ctor?: Function;
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Additional text to include with the error.
|
|
841
|
-
*/
|
|
842
|
-
detail?: string;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
801
|
interface Process extends EventEmitter {
|
|
846
802
|
/**
|
|
847
803
|
* Can also be a tty.WriteStream, not typed due to limitation.s
|
|
@@ -857,29 +813,14 @@ declare namespace NodeJS {
|
|
|
857
813
|
argv0: string;
|
|
858
814
|
execArgv: string[];
|
|
859
815
|
execPath: string;
|
|
860
|
-
abort():
|
|
816
|
+
abort(): void;
|
|
861
817
|
chdir(directory: string): void;
|
|
862
818
|
cwd(): string;
|
|
863
819
|
debugPort: number;
|
|
864
|
-
|
|
865
|
-
/**
|
|
866
|
-
* The `process.emitWarning()` method can be used to emit custom or application specific process warnings.
|
|
867
|
-
*
|
|
868
|
-
* These can be listened for by adding a handler to the `'warning'` event.
|
|
869
|
-
*
|
|
870
|
-
* @param warning The warning to emit.
|
|
871
|
-
* @param type When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. Default: `'Warning'`.
|
|
872
|
-
* @param code A unique identifier for the warning instance being emitted.
|
|
873
|
-
* @param ctor When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. Default: `process.emitWarning`.
|
|
874
|
-
*/
|
|
875
|
-
emitWarning(warning: string | Error, ctor?: Function): void;
|
|
876
|
-
emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
|
|
877
|
-
emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
|
|
878
|
-
emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
|
|
879
|
-
|
|
820
|
+
emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
|
|
880
821
|
env: ProcessEnv;
|
|
881
822
|
exit(code?: number): never;
|
|
882
|
-
exitCode
|
|
823
|
+
exitCode: number;
|
|
883
824
|
getgid(): number;
|
|
884
825
|
setgid(id: number | string): void;
|
|
885
826
|
getuid(): number;
|
|
@@ -889,7 +830,7 @@ declare namespace NodeJS {
|
|
|
889
830
|
getegid(): number;
|
|
890
831
|
setegid(id: number | string): void;
|
|
891
832
|
getgroups(): number[];
|
|
892
|
-
setgroups(groups:
|
|
833
|
+
setgroups(groups: Array<string | number>): void;
|
|
893
834
|
setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
|
|
894
835
|
hasUncaughtExceptionCaptureCallback(): boolean;
|
|
895
836
|
version: string;
|
|
@@ -1140,25 +1081,21 @@ declare namespace NodeJS {
|
|
|
1140
1081
|
}
|
|
1141
1082
|
|
|
1142
1083
|
interface Timer {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
unref(): this;
|
|
1084
|
+
ref(): void;
|
|
1085
|
+
refresh(): void;
|
|
1086
|
+
unref(): void;
|
|
1147
1087
|
}
|
|
1148
1088
|
|
|
1149
1089
|
class Immediate {
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
refresh(): this;
|
|
1153
|
-
unref(): this;
|
|
1090
|
+
ref(): void;
|
|
1091
|
+
unref(): void;
|
|
1154
1092
|
_onImmediate: Function; // to distinguish it from the Timeout class
|
|
1155
1093
|
}
|
|
1156
1094
|
|
|
1157
1095
|
class Timeout implements Timer {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
unref(): this;
|
|
1096
|
+
ref(): void;
|
|
1097
|
+
refresh(): void;
|
|
1098
|
+
unref(): void;
|
|
1162
1099
|
}
|
|
1163
1100
|
|
|
1164
1101
|
class Module {
|
|
@@ -1181,17 +1118,5 @@ declare namespace NodeJS {
|
|
|
1181
1118
|
constructor(id: string, parent?: Module);
|
|
1182
1119
|
}
|
|
1183
1120
|
|
|
1184
|
-
type TypedArray =
|
|
1185
|
-
| Uint8Array
|
|
1186
|
-
| Uint8ClampedArray
|
|
1187
|
-
| Uint16Array
|
|
1188
|
-
| Uint32Array
|
|
1189
|
-
| Int8Array
|
|
1190
|
-
| Int16Array
|
|
1191
|
-
| Int32Array
|
|
1192
|
-
| BigUint64Array
|
|
1193
|
-
| BigInt64Array
|
|
1194
|
-
| Float32Array
|
|
1195
|
-
| Float64Array;
|
|
1196
|
-
type ArrayBufferView = TypedArray | DataView;
|
|
1121
|
+
type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
|
|
1197
1122
|
}
|
|
@@ -16,8 +16,6 @@ declare module "http" {
|
|
|
16
16
|
'access-control-allow-origin'?: string;
|
|
17
17
|
'access-control-expose-headers'?: string;
|
|
18
18
|
'access-control-max-age'?: string;
|
|
19
|
-
'access-control-request-headers'?: string;
|
|
20
|
-
'access-control-request-method'?: string;
|
|
21
19
|
'age'?: string;
|
|
22
20
|
'allow'?: string;
|
|
23
21
|
'alt-svc'?: string;
|
|
@@ -44,7 +42,6 @@ declare module "http" {
|
|
|
44
42
|
'if-unmodified-since'?: string;
|
|
45
43
|
'last-modified'?: string;
|
|
46
44
|
'location'?: string;
|
|
47
|
-
'origin'?: string;
|
|
48
45
|
'pragma'?: string;
|
|
49
46
|
'proxy-authenticate'?: string;
|
|
50
47
|
'proxy-authorization'?: string;
|
|
@@ -135,13 +132,13 @@ declare module "http" {
|
|
|
135
132
|
constructor();
|
|
136
133
|
|
|
137
134
|
setTimeout(msecs: number, callback?: () => void): this;
|
|
138
|
-
setHeader(name: string, value: number | string |
|
|
135
|
+
setHeader(name: string, value: number | string | string[]): void;
|
|
139
136
|
getHeader(name: string): number | string | string[] | undefined;
|
|
140
137
|
getHeaders(): OutgoingHttpHeaders;
|
|
141
138
|
getHeaderNames(): string[];
|
|
142
139
|
hasHeader(name: string): boolean;
|
|
143
140
|
removeHeader(name: string): void;
|
|
144
|
-
addTrailers(headers: OutgoingHttpHeaders |
|
|
141
|
+
addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
|
|
145
142
|
flushHeaders(): void;
|
|
146
143
|
}
|
|
147
144
|
|
|
@@ -161,15 +158,14 @@ declare module "http" {
|
|
|
161
158
|
writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
|
|
162
159
|
}
|
|
163
160
|
|
|
164
|
-
// https://github.com/nodejs/node/blob/
|
|
161
|
+
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
|
|
165
162
|
class ClientRequest extends OutgoingMessage {
|
|
166
163
|
connection: Socket;
|
|
167
164
|
socket: Socket;
|
|
168
|
-
aborted:
|
|
165
|
+
aborted: number;
|
|
169
166
|
|
|
170
167
|
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
|
171
168
|
|
|
172
|
-
method: string;
|
|
173
169
|
readonly path: string;
|
|
174
170
|
abort(): void;
|
|
175
171
|
onSocket(socket: Socket): void;
|
|
@@ -190,7 +186,7 @@ declare module "http" {
|
|
|
190
186
|
rawHeaders: string[];
|
|
191
187
|
trailers: { [key: string]: string | undefined };
|
|
192
188
|
rawTrailers: string[];
|
|
193
|
-
setTimeout(msecs: number, callback
|
|
189
|
+
setTimeout(msecs: number, callback: () => void): this;
|
|
194
190
|
/**
|
|
195
191
|
* Only valid for request obtained from http.Server.
|
|
196
192
|
*/
|
|
@@ -364,7 +364,7 @@ declare module "http2" {
|
|
|
364
364
|
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
365
365
|
|
|
366
366
|
emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
|
|
367
|
-
emit(event: "origin", origins:
|
|
367
|
+
emit(event: "origin", origins: string[]): boolean;
|
|
368
368
|
emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
|
369
369
|
emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
|
370
370
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
@@ -649,7 +649,7 @@ declare module "http2" {
|
|
|
649
649
|
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
-
export class Http2ServerResponse extends stream.
|
|
652
|
+
export class Http2ServerResponse extends stream.Stream {
|
|
653
653
|
private constructor();
|
|
654
654
|
|
|
655
655
|
addTrailers(trailers: OutgoingHttpHeaders): void;
|
|
@@ -665,7 +665,7 @@ declare module "http2" {
|
|
|
665
665
|
readonly headersSent: boolean;
|
|
666
666
|
removeHeader(name: string): void;
|
|
667
667
|
sendDate: boolean;
|
|
668
|
-
setHeader(name: string, value: number | string |
|
|
668
|
+
setHeader(name: string, value: number | string | string[]): void;
|
|
669
669
|
setTimeout(msecs: number, callback?: () => void): void;
|
|
670
670
|
readonly socket: net.Socket | tls.TLSSocket;
|
|
671
671
|
statusCode: number;
|
{node v11.15 → node}/https.d.ts
RENAMED
|
File without changes
|
node/index.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Type definitions for non-npm package Node.js 12.0
|
|
2
|
+
// Project: http://nodejs.org/
|
|
3
|
+
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
|
4
|
+
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
|
5
|
+
// Alberto Schiabel <https://github.com/jkomyno>
|
|
6
|
+
// Alexander T. <https://github.com/a-tarasyuk>
|
|
7
|
+
// Alvis HT Tang <https://github.com/alvis>
|
|
8
|
+
// Andrew Makarov <https://github.com/r3nya>
|
|
9
|
+
// Benjamin Toueg <https://github.com/btoueg>
|
|
10
|
+
// Bruno Scheufler <https://github.com/brunoscheufler>
|
|
11
|
+
// Chigozirim C. <https://github.com/smac89>
|
|
12
|
+
// Christian Vaagland Tellnes <https://github.com/tellnes>
|
|
13
|
+
// David Junger <https://github.com/touffy>
|
|
14
|
+
// Deividas Bakanas <https://github.com/DeividasBakanas>
|
|
15
|
+
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
|
16
|
+
// Flarna <https://github.com/Flarna>
|
|
17
|
+
// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
|
|
18
|
+
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
|
19
|
+
// Huw <https://github.com/hoo29>
|
|
20
|
+
// Kelvin Jin <https://github.com/kjin>
|
|
21
|
+
// Klaus Meinhardt <https://github.com/ajafff>
|
|
22
|
+
// Lishude <https://github.com/islishude>
|
|
23
|
+
// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
|
|
24
|
+
// Matthieu Sieben <https://github.com/matthieusieben>
|
|
25
|
+
// Mohsen Azimi <https://github.com/mohsen1>
|
|
26
|
+
// Nicolas Even <https://github.com/n-e>
|
|
27
|
+
// Nicolas Voigt <https://github.com/octo-sniffle>
|
|
28
|
+
// Parambir Singh <https://github.com/parambirs>
|
|
29
|
+
// Sebastian Silbermann <https://github.com/eps1lon>
|
|
30
|
+
// Simon Schick <https://github.com/SimonSchick>
|
|
31
|
+
// Thomas den Hollander <https://github.com/ThomasdenH>
|
|
32
|
+
// Wilco Bakker <https://github.com/WilcoBakker>
|
|
33
|
+
// wwwy3y3 <https://github.com/wwwy3y3>
|
|
34
|
+
// Zane Hannan AU <https://github.com/ZaneHannanAU>
|
|
35
|
+
// Jeremie Rodriguez <https://github.com/jeremiergz>
|
|
36
|
+
// Samuel Ainsworth <https://github.com/samuela>
|
|
37
|
+
// Kyle Uehlein <https://github.com/kuehlein>
|
|
38
|
+
// Jordi Oliveras Rovira <https://github.com/j-oliveras>
|
|
39
|
+
// Thanik Bhongbhibhat <https://github.com/bhongy>
|
|
40
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
41
|
+
|
|
42
|
+
// NOTE: These definitions support NodeJS and TypeScript 3.2.
|
|
43
|
+
|
|
44
|
+
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
|
45
|
+
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
|
46
|
+
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
|
|
47
|
+
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
|
|
48
|
+
|
|
49
|
+
// NOTE: Augmentations for TypeScript 3.2 and later should use individual files for overrides
|
|
50
|
+
// within the respective ~/ts3.2 (or later) folder. However, this is disallowed for versions
|
|
51
|
+
// prior to TypeScript 3.2, so the older definitions will be found here.
|
|
52
|
+
|
|
53
|
+
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
|
54
|
+
/// <reference path="base.d.ts" />
|
|
55
|
+
|
|
56
|
+
// TypeScript 2.1-specific augmentations:
|
|
57
|
+
|
|
58
|
+
// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
|
|
59
|
+
// Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
|
|
60
|
+
// just to ensure the names are known and node typings can be sued without importing these libs.
|
|
61
|
+
// if someone really needs these types the libs need to be added via --lib or in tsconfig.json
|
|
62
|
+
interface MapConstructor { }
|
|
63
|
+
interface WeakMapConstructor { }
|
|
64
|
+
interface SetConstructor { }
|
|
65
|
+
interface WeakSetConstructor { }
|
|
66
|
+
interface Set<T> {}
|
|
67
|
+
interface Map<K, V> {}
|
|
68
|
+
interface ReadonlySet<T> {}
|
|
69
|
+
interface IteratorResult<T> { }
|
|
70
|
+
interface Iterable<T> { }
|
|
71
|
+
interface Iterator<T> {
|
|
72
|
+
next(value?: any): IteratorResult<T>;
|
|
73
|
+
}
|
|
74
|
+
interface IterableIterator<T> { }
|
|
75
|
+
interface AsyncIterableIterator<T> {}
|
|
76
|
+
interface SymbolConstructor {
|
|
77
|
+
readonly iterator: symbol;
|
|
78
|
+
readonly asyncIterator: symbol;
|
|
79
|
+
}
|
|
80
|
+
declare var Symbol: SymbolConstructor;
|
|
81
|
+
// even this is just a forward declaration some properties are added otherwise
|
|
82
|
+
// it would be allowed to pass anything to e.g. Buffer.from()
|
|
83
|
+
interface SharedArrayBuffer {
|
|
84
|
+
readonly byteLength: number;
|
|
85
|
+
slice(begin?: number, end?: number): SharedArrayBuffer;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare module "util" {
|
|
89
|
+
namespace inspect {
|
|
90
|
+
const custom: symbol;
|
|
91
|
+
}
|
|
92
|
+
namespace promisify {
|
|
93
|
+
const custom: symbol;
|
|
94
|
+
}
|
|
95
|
+
namespace types {
|
|
96
|
+
function isBigInt64Array(value: any): boolean;
|
|
97
|
+
function isBigUint64Array(value: any): boolean;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -3251,7 +3251,7 @@ declare module "inspector" {
|
|
|
3251
3251
|
function close(): void;
|
|
3252
3252
|
|
|
3253
3253
|
/**
|
|
3254
|
-
* Return the URL of the active inspector, or
|
|
3254
|
+
* Return the URL of the active inspector, or undefined if there is none.
|
|
3255
3255
|
*/
|
|
3256
|
-
function url(): string
|
|
3256
|
+
function url(): string;
|
|
3257
3257
|
}
|
{node v11.15 → node}/module.d.ts
RENAMED
|
File without changes
|
{node v11.15 → node}/net.d.ts
RENAMED
|
File without changes
|
|
@@ -52,7 +52,6 @@ declare module "os" {
|
|
|
52
52
|
function userInfo(options?: { encoding: string }): UserInfo<string>;
|
|
53
53
|
const constants: {
|
|
54
54
|
UV_UDP_REUSEADDR: number;
|
|
55
|
-
// signals: { [key in NodeJS.Signals]: number; }; @todo: change after migration to typescript 2.1
|
|
56
55
|
signals: {
|
|
57
56
|
SIGHUP: number;
|
|
58
57
|
SIGINT: number;
|
|
@@ -75,7 +74,6 @@ declare module "os" {
|
|
|
75
74
|
SIGCONT: number;
|
|
76
75
|
SIGSTOP: number;
|
|
77
76
|
SIGTSTP: number;
|
|
78
|
-
SIGBREAK: number;
|
|
79
77
|
SIGTTIN: number;
|
|
80
78
|
SIGTTOU: number;
|
|
81
79
|
SIGURG: number;
|
|
@@ -86,9 +84,7 @@ declare module "os" {
|
|
|
86
84
|
SIGWINCH: number;
|
|
87
85
|
SIGIO: number;
|
|
88
86
|
SIGPOLL: number;
|
|
89
|
-
SIGLOST: number;
|
|
90
87
|
SIGPWR: number;
|
|
91
|
-
SIGINFO: number;
|
|
92
88
|
SIGSYS: number;
|
|
93
89
|
SIGUNUSED: number;
|
|
94
90
|
};
|