1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | interface Console {
|
36 | Console: NodeJS.ConsoleConstructor;
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 | assert(value: any, message?: string, ...optionalParams: any[]): void;
|
43 | |
44 |
|
45 |
|
46 |
|
47 | clear(): void;
|
48 | |
49 |
|
50 |
|
51 | count(label?: string): void;
|
52 | |
53 |
|
54 |
|
55 | countReset(label?: string): void;
|
56 | |
57 |
|
58 |
|
59 | debug(message?: any, ...optionalParams: any[]): void;
|
60 | |
61 |
|
62 |
|
63 |
|
64 | dir(obj: any, options?: NodeJS.InspectOptions): void;
|
65 | |
66 |
|
67 |
|
68 | dirxml(...data: any[]): void;
|
69 | |
70 |
|
71 |
|
72 | error(message?: any, ...optionalParams: any[]): void;
|
73 | |
74 |
|
75 |
|
76 |
|
77 | group(...label: any[]): void;
|
78 | |
79 |
|
80 |
|
81 | groupCollapsed(): void;
|
82 | |
83 |
|
84 |
|
85 | groupEnd(): void;
|
86 | |
87 |
|
88 |
|
89 | info(message?: any, ...optionalParams: any[]): void;
|
90 | |
91 |
|
92 |
|
93 | log(message?: any, ...optionalParams: any[]): void;
|
94 | |
95 |
|
96 |
|
97 |
|
98 | table(tabularData: any, properties?: string[]): void;
|
99 | |
100 |
|
101 |
|
102 | time(label?: string): void;
|
103 | |
104 |
|
105 |
|
106 | timeEnd(label?: string): void;
|
107 | |
108 |
|
109 |
|
110 | trace(message?: any, ...optionalParams: any[]): void;
|
111 | |
112 |
|
113 |
|
114 | warn(message?: any, ...optionalParams: any[]): void;
|
115 |
|
116 |
|
117 | |
118 |
|
119 |
|
120 |
|
121 | profile(label?: string): void;
|
122 | |
123 |
|
124 |
|
125 |
|
126 | profileEnd(): void;
|
127 | |
128 |
|
129 |
|
130 |
|
131 | timeStamp(label?: string): void;
|
132 | }
|
133 |
|
134 | interface Error {
|
135 | stack?: string;
|
136 | }
|
137 |
|
138 |
|
139 | interface ErrorConstructor {
|
140 |
|
141 | captureStackTrace(targetObject: Object, constructorOpt?: Function): void;
|
142 |
|
143 | |
144 |
|
145 |
|
146 |
|
147 |
|
148 | prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any;
|
149 |
|
150 | stackTraceLimit: number;
|
151 | }
|
152 |
|
153 |
|
154 |
|
155 |
|
156 | interface MapConstructor { }
|
157 | interface WeakMapConstructor { }
|
158 | interface SetConstructor { }
|
159 | interface WeakSetConstructor { }
|
160 |
|
161 |
|
162 | interface Iterable<T> { }
|
163 | interface Iterator<T> {
|
164 | next(value?: any): IteratorResult<T>;
|
165 | }
|
166 | interface IteratorResult<T> { }
|
167 | interface AsyncIterableIterator<T> {}
|
168 | interface SymbolConstructor {
|
169 | readonly observable: symbol;
|
170 | readonly iterator: symbol;
|
171 | readonly asyncIterator: symbol;
|
172 | }
|
173 | declare var Symbol: SymbolConstructor;
|
174 |
|
175 |
|
176 | interface String {
|
177 |
|
178 | trimLeft(): string;
|
179 |
|
180 | trimRight(): string;
|
181 | }
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 | declare var process: NodeJS.Process;
|
189 | declare var global: NodeJS.Global;
|
190 | declare var console: Console;
|
191 |
|
192 | declare var __filename: string;
|
193 | declare var __dirname: string;
|
194 |
|
195 | declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
|
196 | declare namespace setTimeout {
|
197 | export function __promisify__(ms: number): Promise<void>;
|
198 | export function __promisify__<T>(ms: number, value: T): Promise<T>;
|
199 | }
|
200 | declare function clearTimeout(timeoutId: NodeJS.Timer): void;
|
201 | declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
|
202 | declare function clearInterval(intervalId: NodeJS.Timer): void;
|
203 | declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
|
204 | declare namespace setImmediate {
|
205 | export function __promisify__(): Promise<void>;
|
206 | export function __promisify__<T>(value: T): Promise<T>;
|
207 | }
|
208 | declare function clearImmediate(immediateId: any): void;
|
209 |
|
210 |
|
211 | interface NodeRequireFunction {
|
212 |
|
213 | (id: string): any;
|
214 | }
|
215 |
|
216 | interface NodeRequire extends NodeRequireFunction {
|
217 | resolve: RequireResolve;
|
218 | cache: any;
|
219 | extensions: NodeExtensions;
|
220 | main: NodeModule | undefined;
|
221 | }
|
222 |
|
223 | interface RequireResolve {
|
224 | (id: string, options?: { paths?: string[]; }): string;
|
225 | paths(request: string): string[] | null;
|
226 | }
|
227 |
|
228 | interface NodeExtensions {
|
229 | '.js': (m: NodeModule, filename: string) => any;
|
230 | '.json': (m: NodeModule, filename: string) => any;
|
231 | '.node': (m: NodeModule, filename: string) => any;
|
232 | [ext: string]: (m: NodeModule, filename: string) => any;
|
233 | }
|
234 |
|
235 | declare var require: NodeRequire;
|
236 |
|
237 | interface NodeModule {
|
238 | exports: any;
|
239 | require: NodeRequireFunction;
|
240 | id: string;
|
241 | filename: string;
|
242 | loaded: boolean;
|
243 | parent: NodeModule | null;
|
244 | children: NodeModule[];
|
245 | paths: string[];
|
246 | }
|
247 |
|
248 | declare var module: NodeModule;
|
249 |
|
250 | // Same as module.exports
|
251 | declare var exports: any;
|
252 | declare var SlowBuffer: {
|
253 | new(str: string, encoding?: string): Buffer;
|
254 | new(size: number): Buffer;
|
255 | new(size: Uint8Array): Buffer;
|
256 | new(array: any[]): Buffer;
|
257 | prototype: Buffer;
|
258 | isBuffer(obj: any): boolean;
|
259 | byteLength(string: string, encoding?: string): number;
|
260 | concat(list: Buffer[], totalLength?: number): Buffer;
|
261 | };
|
262 |
|
263 |
|
264 | type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
|
265 | interface Buffer extends Uint8Array {
|
266 | write(string: string, offset?: number, length?: number, encoding?: string): number;
|
267 | toString(encoding?: string, start?: number, end?: number): string;
|
268 | toJSON(): { type: 'Buffer', data: any[] };
|
269 | equals(otherBuffer: Uint8Array): boolean;
|
270 | compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
|
271 | copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
272 | slice(start?: number, end?: number): Buffer;
|
273 | writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
274 | writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
275 | writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
276 | writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
277 | readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
278 | readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
279 | readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
280 | readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
281 | readUInt8(offset: number, noAssert?: boolean): number;
|
282 | readUInt16LE(offset: number, noAssert?: boolean): number;
|
283 | readUInt16BE(offset: number, noAssert?: boolean): number;
|
284 | readUInt32LE(offset: number, noAssert?: boolean): number;
|
285 | readUInt32BE(offset: number, noAssert?: boolean): number;
|
286 | readInt8(offset: number, noAssert?: boolean): number;
|
287 | readInt16LE(offset: number, noAssert?: boolean): number;
|
288 | readInt16BE(offset: number, noAssert?: boolean): number;
|
289 | readInt32LE(offset: number, noAssert?: boolean): number;
|
290 | readInt32BE(offset: number, noAssert?: boolean): number;
|
291 | readFloatLE(offset: number, noAssert?: boolean): number;
|
292 | readFloatBE(offset: number, noAssert?: boolean): number;
|
293 | readDoubleLE(offset: number, noAssert?: boolean): number;
|
294 | readDoubleBE(offset: number, noAssert?: boolean): number;
|
295 | swap16(): Buffer;
|
296 | swap32(): Buffer;
|
297 | swap64(): Buffer;
|
298 | writeUInt8(value: number, offset: number, noAssert?: boolean): number;
|
299 | writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
|
300 | writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
|
301 | writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
|
302 | writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
|
303 | writeInt8(value: number, offset: number, noAssert?: boolean): number;
|
304 | writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
|
305 | writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
|
306 | writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
|
307 | writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
|
308 | writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
|
309 | writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
|
310 | writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
|
311 | writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
|
312 | fill(value: any, offset?: number, end?: number): this;
|
313 | indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: string): number;
|
314 | lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: string): number;
|
315 | entries(): IterableIterator<[number, number]>;
|
316 | includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
|
317 | keys(): IterableIterator<number>;
|
318 | values(): IterableIterator<number>;
|
319 | }
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 | declare var Buffer: {
|
327 | |
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 | new(str: string, encoding?: string): Buffer;
|
335 | |
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 | new(size: number): Buffer;
|
342 | |
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 | new(array: Uint8Array): Buffer;
|
349 | |
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | new(arrayBuffer: ArrayBuffer): Buffer;
|
358 | |
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 | new(array: any[]): Buffer;
|
365 | |
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 | new(buffer: Buffer): Buffer;
|
372 | prototype: Buffer;
|
373 | |
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 | from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
382 |
|
383 | |
384 |
|
385 |
|
386 |
|
387 | from(data: any[]): Buffer;
|
388 | from(data: Uint8Array): Buffer;
|
389 | |
390 |
|
391 |
|
392 |
|
393 |
|
394 | from(str: string, encoding?: string): Buffer;
|
395 | |
396 |
|
397 |
|
398 |
|
399 | of(...items: number[]): Buffer;
|
400 | |
401 |
|
402 |
|
403 |
|
404 |
|
405 | isBuffer(obj: any): obj is Buffer;
|
406 | |
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 | isEncoding(encoding: string): boolean | undefined;
|
413 | |
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 | byteLength(string: string | NodeJS.TypedArray | DataView | ArrayBuffer , encoding?: string): number;
|
421 | |
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | concat(list: Uint8Array[], totalLength?: number): Buffer;
|
433 | |
434 |
|
435 |
|
436 | compare(buf1: Uint8Array, buf2: Uint8Array): number;
|
437 | |
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
|
446 | |
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 | allocUnsafe(size: number): Buffer;
|
453 | |
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 | allocUnsafeSlow(size: number): Buffer;
|
460 | |
461 |
|
462 |
|
463 | poolSize: number;
|
464 | };
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 | declare namespace NodeJS {
|
472 | export interface InspectOptions {
|
473 | showHidden?: boolean;
|
474 | depth?: number | null;
|
475 | colors?: boolean;
|
476 | customInspect?: boolean;
|
477 | showProxy?: boolean;
|
478 | maxArrayLength?: number | null;
|
479 | breakLength?: number;
|
480 | compact?: boolean;
|
481 | }
|
482 |
|
483 | export interface ConsoleConstructor {
|
484 | prototype: Console;
|
485 | new(stdout: WritableStream, stderr?: WritableStream): Console;
|
486 | }
|
487 |
|
488 | export interface CallSite {
|
489 | |
490 |
|
491 |
|
492 | getThis(): any;
|
493 |
|
494 | |
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 | getTypeName(): string | null;
|
501 |
|
502 | |
503 |
|
504 |
|
505 | getFunction(): Function | undefined;
|
506 |
|
507 | |
508 |
|
509 |
|
510 |
|
511 |
|
512 | getFunctionName(): string | null;
|
513 |
|
514 | |
515 |
|
516 |
|
517 |
|
518 | getMethodName(): string | null;
|
519 |
|
520 | |
521 |
|
522 |
|
523 | getFileName(): string | null;
|
524 |
|
525 | |
526 |
|
527 |
|
528 | getLineNumber(): number | null;
|
529 |
|
530 | |
531 |
|
532 |
|
533 | getColumnNumber(): number | null;
|
534 |
|
535 | |
536 |
|
537 |
|
538 |
|
539 | getEvalOrigin(): string | undefined;
|
540 |
|
541 | |
542 |
|
543 |
|
544 | isToplevel(): boolean;
|
545 |
|
546 | |
547 |
|
548 |
|
549 | isEval(): boolean;
|
550 |
|
551 | |
552 |
|
553 |
|
554 | isNative(): boolean;
|
555 |
|
556 | |
557 |
|
558 |
|
559 | isConstructor(): boolean;
|
560 | }
|
561 |
|
562 | export interface ErrnoException extends Error {
|
563 | errno?: number;
|
564 | code?: string;
|
565 | path?: string;
|
566 | syscall?: string;
|
567 | stack?: string;
|
568 | }
|
569 |
|
570 | export class EventEmitter {
|
571 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
572 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
573 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
574 | removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
575 | off(event: string | symbol, listener: (...args: any[]) => void): this;
|
576 | removeAllListeners(event?: string | symbol): this;
|
577 | setMaxListeners(n: number): this;
|
578 | getMaxListeners(): number;
|
579 | listeners(event: string | symbol): Function[];
|
580 | rawListeners(event: string | symbol): Function[];
|
581 | emit(event: string | symbol, ...args: any[]): boolean;
|
582 | listenerCount(type: string | symbol): number;
|
583 |
|
584 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
585 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
586 | eventNames(): Array<string | symbol>;
|
587 | }
|
588 |
|
589 | export interface ReadableStream extends EventEmitter {
|
590 | readable: boolean;
|
591 | read(size?: number): string | Buffer;
|
592 | setEncoding(encoding: string): this;
|
593 | pause(): this;
|
594 | resume(): this;
|
595 | isPaused(): boolean;
|
596 | pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
597 | unpipe<T extends WritableStream>(destination?: T): this;
|
598 | unshift(chunk: string): void;
|
599 | unshift(chunk: Buffer): void;
|
600 | wrap(oldStream: ReadableStream): this;
|
601 | [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
|
602 | }
|
603 |
|
604 | export interface WritableStream extends EventEmitter {
|
605 | writable: boolean;
|
606 | write(buffer: Buffer | string, cb?: Function): boolean;
|
607 | write(str: string, encoding?: string, cb?: Function): boolean;
|
608 | end(cb?: Function): void;
|
609 | end(buffer: Buffer, cb?: Function): void;
|
610 | end(str: string, cb?: Function): void;
|
611 | end(str: string, encoding?: string, cb?: Function): void;
|
612 | }
|
613 |
|
614 | export interface ReadWriteStream extends ReadableStream, WritableStream { }
|
615 |
|
616 | export interface Events extends EventEmitter { }
|
617 |
|
618 | export interface Domain extends Events {
|
619 | run(fn: Function): void;
|
620 | add(emitter: Events): void;
|
621 | remove(emitter: Events): void;
|
622 | bind(cb: (err: Error, data: any) => any): any;
|
623 | intercept(cb: (data: any) => any): any;
|
624 |
|
625 | addListener(event: string, listener: (...args: any[]) => void): this;
|
626 | on(event: string, listener: (...args: any[]) => void): this;
|
627 | once(event: string, listener: (...args: any[]) => void): this;
|
628 | removeListener(event: string, listener: (...args: any[]) => void): this;
|
629 | removeAllListeners(event?: string): this;
|
630 | }
|
631 |
|
632 | export interface MemoryUsage {
|
633 | rss: number;
|
634 | heapTotal: number;
|
635 | heapUsed: number;
|
636 | external: number;
|
637 | }
|
638 |
|
639 | export interface CpuUsage {
|
640 | user: number;
|
641 | system: number;
|
642 | }
|
643 |
|
644 | export interface ProcessVersions {
|
645 | http_parser: string;
|
646 | node: string;
|
647 | v8: string;
|
648 | ares: string;
|
649 | uv: string;
|
650 | zlib: string;
|
651 | modules: string;
|
652 | openssl: string;
|
653 | }
|
654 |
|
655 | type Platform = 'aix'
|
656 | | 'android'
|
657 | | 'darwin'
|
658 | | 'freebsd'
|
659 | | 'linux'
|
660 | | 'openbsd'
|
661 | | 'sunos'
|
662 | | 'win32'
|
663 | | 'cygwin';
|
664 |
|
665 | type Signals =
|
666 | "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
|
667 | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" |
|
668 | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
|
669 | "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
|
670 |
|
671 | type BeforeExitListener = (code: number) => void;
|
672 | type DisconnectListener = () => void;
|
673 | type ExitListener = (code: number) => void;
|
674 | type RejectionHandledListener = (promise: Promise<any>) => void;
|
675 | type UncaughtExceptionListener = (error: Error) => void;
|
676 | type UnhandledRejectionListener = (reason: any, promise: Promise<any>) => void;
|
677 | type WarningListener = (warning: Error) => void;
|
678 | type MessageListener = (message: any, sendHandle: any) => void;
|
679 | type SignalsListener = (signal: Signals) => void;
|
680 | type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
|
681 | type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
|
682 |
|
683 | export interface Socket extends ReadWriteStream {
|
684 | isTTY?: true;
|
685 | }
|
686 |
|
687 | export interface ProcessEnv {
|
688 | [key: string]: string | undefined;
|
689 | }
|
690 |
|
691 | export interface WriteStream extends Socket {
|
692 | readonly writableHighWaterMark: number;
|
693 | readonly writableLength: number;
|
694 | columns?: number;
|
695 | rows?: number;
|
696 | _write(chunk: any, encoding: string, callback: Function): void;
|
697 | _destroy(err: Error, callback: Function): void;
|
698 | _final(callback: Function): void;
|
699 | setDefaultEncoding(encoding: string): this;
|
700 | cork(): void;
|
701 | uncork(): void;
|
702 | destroy(error?: Error): void;
|
703 | }
|
704 | export interface ReadStream extends Socket {
|
705 | readonly readableHighWaterMark: number;
|
706 | readonly readableLength: number;
|
707 | isRaw?: boolean;
|
708 | setRawMode?(mode: boolean): void;
|
709 | _read(size: number): void;
|
710 | _destroy(err: Error, callback: Function): void;
|
711 | push(chunk: any, encoding?: string): boolean;
|
712 | destroy(error?: Error): void;
|
713 | }
|
714 |
|
715 | export interface Process extends EventEmitter {
|
716 | stdout: WriteStream;
|
717 | stderr: WriteStream;
|
718 | stdin: ReadStream;
|
719 | openStdin(): Socket;
|
720 | argv: string[];
|
721 | argv0: string;
|
722 | execArgv: string[];
|
723 | execPath: string;
|
724 | abort(): void;
|
725 | chdir(directory: string): void;
|
726 | cwd(): string;
|
727 | debugPort: number;
|
728 | emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
|
729 | env: ProcessEnv;
|
730 | exit(code?: number): never;
|
731 | exitCode: number;
|
732 | getgid(): number;
|
733 | setgid(id: number | string): void;
|
734 | getuid(): number;
|
735 | setuid(id: number | string): void;
|
736 | geteuid(): number;
|
737 | seteuid(id: number | string): void;
|
738 | getegid(): number;
|
739 | setegid(id: number | string): void;
|
740 | getgroups(): number[];
|
741 | setgroups(groups: Array<string | number>): void;
|
742 | setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
|
743 | hasUncaughtExceptionCaptureCallback(): boolean;
|
744 | version: string;
|
745 | versions: ProcessVersions;
|
746 | config: {
|
747 | target_defaults: {
|
748 | cflags: any[];
|
749 | default_configuration: string;
|
750 | defines: string[];
|
751 | include_dirs: string[];
|
752 | libraries: string[];
|
753 | };
|
754 | variables: {
|
755 | clang: number;
|
756 | host_arch: string;
|
757 | node_install_npm: boolean;
|
758 | node_install_waf: boolean;
|
759 | node_prefix: string;
|
760 | node_shared_openssl: boolean;
|
761 | node_shared_v8: boolean;
|
762 | node_shared_zlib: boolean;
|
763 | node_use_dtrace: boolean;
|
764 | node_use_etw: boolean;
|
765 | node_use_openssl: boolean;
|
766 | target_arch: string;
|
767 | v8_no_strict_aliasing: number;
|
768 | v8_use_snapshot: boolean;
|
769 | visibility: string;
|
770 | };
|
771 | };
|
772 | kill(pid: number, signal?: string | number): void;
|
773 | pid: number;
|
774 | ppid: number;
|
775 | title: string;
|
776 | arch: string;
|
777 | platform: Platform;
|
778 | mainModule?: NodeModule;
|
779 | memoryUsage(): MemoryUsage;
|
780 | cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
781 | nextTick(callback: Function, ...args: any[]): void;
|
782 | umask(mask?: number): number;
|
783 | uptime(): number;
|
784 | hrtime(time?: [number, number]): [number, number];
|
785 | domain: Domain;
|
786 |
|
787 | // Worker
|
788 | send?(message: any, sendHandle?: any): void;
|
789 | disconnect(): void;
|
790 | connected: boolean;
|
791 |
|
792 | /**
|
793 | * EventEmitter
|
794 | * 1. beforeExit
|
795 | * 2. disconnect
|
796 | * 3. exit
|
797 | * 4. message
|
798 | * 5. rejectionHandled
|
799 | * 6. uncaughtException
|
800 | * 7. unhandledRejection
|
801 | * 8. warning
|
802 | * 9. message
|
803 | * 10. <All OS Signals>
|
804 | * 11. newListener/removeListener inherited from EventEmitter
|
805 | */
|
806 | addListener(event: "beforeExit", listener: BeforeExitListener): this;
|
807 | addListener(event: "disconnect", listener: DisconnectListener): this;
|
808 | addListener(event: "exit", listener: ExitListener): this;
|
809 | addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
810 | addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
811 | addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
812 | addListener(event: "warning", listener: WarningListener): this;
|
813 | addListener(event: "message", listener: MessageListener): this;
|
814 | addListener(event: Signals, listener: SignalsListener): this;
|
815 | addListener(event: "newListener", listener: NewListenerListener): this;
|
816 | addListener(event: "removeListener", listener: RemoveListenerListener): this;
|
817 |
|
818 | emit(event: "beforeExit", code: number): boolean;
|
819 | emit(event: "disconnect"): boolean;
|
820 | emit(event: "exit", code: number): boolean;
|
821 | emit(event: "rejectionHandled", promise: Promise<any>): boolean;
|
822 | emit(event: "uncaughtException", error: Error): boolean;
|
823 | emit(event: "unhandledRejection", reason: any, promise: Promise<any>): boolean;
|
824 | emit(event: "warning", warning: Error): boolean;
|
825 | emit(event: "message", message: any, sendHandle: any): this;
|
826 | emit(event: Signals): boolean;
|
827 | emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
|
828 | emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
|
829 |
|
830 | on(event: "beforeExit", listener: BeforeExitListener): this;
|
831 | on(event: "disconnect", listener: DisconnectListener): this;
|
832 | on(event: "exit", listener: ExitListener): this;
|
833 | on(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
834 | on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
835 | on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
836 | on(event: "warning", listener: WarningListener): this;
|
837 | on(event: "message", listener: MessageListener): this;
|
838 | on(event: Signals, listener: SignalsListener): this;
|
839 | on(event: "newListener", listener: NewListenerListener): this;
|
840 | on(event: "removeListener", listener: RemoveListenerListener): this;
|
841 |
|
842 | once(event: "beforeExit", listener: BeforeExitListener): this;
|
843 | once(event: "disconnect", listener: DisconnectListener): this;
|
844 | once(event: "exit", listener: ExitListener): this;
|
845 | once(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
846 | once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
847 | once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
848 | once(event: "warning", listener: WarningListener): this;
|
849 | once(event: "message", listener: MessageListener): this;
|
850 | once(event: Signals, listener: SignalsListener): this;
|
851 | once(event: "newListener", listener: NewListenerListener): this;
|
852 | once(event: "removeListener", listener: RemoveListenerListener): this;
|
853 |
|
854 | prependListener(event: "beforeExit", listener: BeforeExitListener): this;
|
855 | prependListener(event: "disconnect", listener: DisconnectListener): this;
|
856 | prependListener(event: "exit", listener: ExitListener): this;
|
857 | prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
858 | prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
859 | prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
860 | prependListener(event: "warning", listener: WarningListener): this;
|
861 | prependListener(event: "message", listener: MessageListener): this;
|
862 | prependListener(event: Signals, listener: SignalsListener): this;
|
863 | prependListener(event: "newListener", listener: NewListenerListener): this;
|
864 | prependListener(event: "removeListener", listener: RemoveListenerListener): this;
|
865 |
|
866 | prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
|
867 | prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
|
868 | prependOnceListener(event: "exit", listener: ExitListener): this;
|
869 | prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
|
870 | prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
|
871 | prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
872 | prependOnceListener(event: "warning", listener: WarningListener): this;
|
873 | prependOnceListener(event: "message", listener: MessageListener): this;
|
874 | prependOnceListener(event: Signals, listener: SignalsListener): this;
|
875 | prependOnceListener(event: "newListener", listener: NewListenerListener): this;
|
876 | prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
|
877 |
|
878 | listeners(event: "beforeExit"): BeforeExitListener[];
|
879 | listeners(event: "disconnect"): DisconnectListener[];
|
880 | listeners(event: "exit"): ExitListener[];
|
881 | listeners(event: "rejectionHandled"): RejectionHandledListener[];
|
882 | listeners(event: "uncaughtException"): UncaughtExceptionListener[];
|
883 | listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
|
884 | listeners(event: "warning"): WarningListener[];
|
885 | listeners(event: "message"): MessageListener[];
|
886 | listeners(event: Signals): SignalsListener[];
|
887 | listeners(event: "newListener"): NewListenerListener[];
|
888 | listeners(event: "removeListener"): RemoveListenerListener[];
|
889 | }
|
890 |
|
891 | export interface Global {
|
892 | Array: typeof Array;
|
893 | ArrayBuffer: typeof ArrayBuffer;
|
894 | Boolean: typeof Boolean;
|
895 | Buffer: typeof Buffer;
|
896 | DataView: typeof DataView;
|
897 | Date: typeof Date;
|
898 | Error: typeof Error;
|
899 | EvalError: typeof EvalError;
|
900 | Float32Array: typeof Float32Array;
|
901 | Float64Array: typeof Float64Array;
|
902 | Function: typeof Function;
|
903 | GLOBAL: Global;
|
904 | Infinity: typeof Infinity;
|
905 | Int16Array: typeof Int16Array;
|
906 | Int32Array: typeof Int32Array;
|
907 | Int8Array: typeof Int8Array;
|
908 | Intl: typeof Intl;
|
909 | JSON: typeof JSON;
|
910 | Map: MapConstructor;
|
911 | Math: typeof Math;
|
912 | NaN: typeof NaN;
|
913 | Number: typeof Number;
|
914 | Object: typeof Object;
|
915 | Promise: Function;
|
916 | RangeError: typeof RangeError;
|
917 | ReferenceError: typeof ReferenceError;
|
918 | RegExp: typeof RegExp;
|
919 | Set: SetConstructor;
|
920 | String: typeof String;
|
921 | Symbol: Function;
|
922 | SyntaxError: typeof SyntaxError;
|
923 | TypeError: typeof TypeError;
|
924 | URIError: typeof URIError;
|
925 | Uint16Array: typeof Uint16Array;
|
926 | Uint32Array: typeof Uint32Array;
|
927 | Uint8Array: typeof Uint8Array;
|
928 | Uint8ClampedArray: Function;
|
929 | WeakMap: WeakMapConstructor;
|
930 | WeakSet: WeakSetConstructor;
|
931 | clearImmediate: (immediateId: any) => void;
|
932 | clearInterval: (intervalId: NodeJS.Timer) => void;
|
933 | clearTimeout: (timeoutId: NodeJS.Timer) => void;
|
934 | console: typeof console;
|
935 | decodeURI: typeof decodeURI;
|
936 | decodeURIComponent: typeof decodeURIComponent;
|
937 | encodeURI: typeof encodeURI;
|
938 | encodeURIComponent: typeof encodeURIComponent;
|
939 | escape: (str: string) => string;
|
940 | eval: typeof eval;
|
941 | global: Global;
|
942 | isFinite: typeof isFinite;
|
943 | isNaN: typeof isNaN;
|
944 | parseFloat: typeof parseFloat;
|
945 | parseInt: typeof parseInt;
|
946 | process: Process;
|
947 | root: Global;
|
948 | setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;
|
949 | setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
|
950 | setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;
|
951 | undefined: typeof undefined;
|
952 | unescape: (str: string) => string;
|
953 | gc: () => void;
|
954 | v8debug?: any;
|
955 | }
|
956 |
|
957 | export interface Timer {
|
958 | ref(): void;
|
959 | unref(): void;
|
960 | }
|
961 |
|
962 | class Module {
|
963 | static runMain(): void;
|
964 | static wrap(code: string): string;
|
965 | static builtinModules: string[];
|
966 |
|
967 | static Module: typeof Module;
|
968 |
|
969 | exports: any;
|
970 | require: NodeRequireFunction;
|
971 | id: string;
|
972 | filename: string;
|
973 | loaded: boolean;
|
974 | parent: Module | null;
|
975 | children: Module[];
|
976 | paths: string[];
|
977 |
|
978 | constructor(id: string, parent?: Module);
|
979 | }
|
980 |
|
981 | type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
|
982 | }
|
983 |
|
984 | interface IterableIterator<T> { }
|
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 | declare module "buffer" {
|
992 | export var INSPECT_MAX_BYTES: number;
|
993 | var BuffType: typeof Buffer;
|
994 | var SlowBuffType: typeof SlowBuffer;
|
995 | export { BuffType as Buffer, SlowBuffType as SlowBuffer };
|
996 | }
|
997 |
|
998 | declare module "querystring" {
|
999 | export interface StringifyOptions {
|
1000 | encodeURIComponent?: Function;
|
1001 | }
|
1002 |
|
1003 | export interface ParseOptions {
|
1004 | maxKeys?: number;
|
1005 | decodeURIComponent?: Function;
|
1006 | }
|
1007 |
|
1008 | interface ParsedUrlQuery { [key: string]: string | string[] | undefined; }
|
1009 |
|
1010 | export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;
|
1011 | export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
|
1012 | export function parse<T extends {}>(str: string, sep?: string, eq?: string, options?: ParseOptions): T;
|
1013 | export function escape(str: string): string;
|
1014 | export function unescape(str: string): string;
|
1015 | }
|
1016 |
|
1017 | declare module "events" {
|
1018 | class internal extends NodeJS.EventEmitter { }
|
1019 |
|
1020 | namespace internal {
|
1021 | export class EventEmitter extends internal {
|
1022 |
|
1023 | static listenerCount(emitter: EventEmitter, event: string | symbol): number;
|
1024 | static defaultMaxListeners: number;
|
1025 |
|
1026 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1027 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
1028 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
1029 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1030 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1031 | removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1032 | off(event: string | symbol, listener: (...args: any[]) => void): this;
|
1033 | removeAllListeners(event?: string | symbol): this;
|
1034 | setMaxListeners(n: number): this;
|
1035 | getMaxListeners(): number;
|
1036 | listeners(event: string | symbol): Function[];
|
1037 | rawListeners(event: string | symbol): Function[];
|
1038 | emit(event: string | symbol, ...args: any[]): boolean;
|
1039 | eventNames(): Array<string | symbol>;
|
1040 | listenerCount(type: string | symbol): number;
|
1041 | }
|
1042 | }
|
1043 |
|
1044 | export = internal;
|
1045 | }
|
1046 |
|
1047 | declare module "http" {
|
1048 | import * as events from "events";
|
1049 | import * as net from "net";
|
1050 | import * as stream from "stream";
|
1051 | import { URL } from "url";
|
1052 |
|
1053 |
|
1054 | export interface IncomingHttpHeaders {
|
1055 | 'accept'?: string;
|
1056 | 'access-control-allow-origin'?: string;
|
1057 | 'access-control-allow-credentials'?: string;
|
1058 | 'access-control-expose-headers'?: string;
|
1059 | 'access-control-max-age'?: string;
|
1060 | 'access-control-allow-methods'?: string;
|
1061 | 'access-control-allow-headers'?: string;
|
1062 | 'accept-patch'?: string;
|
1063 | 'accept-ranges'?: string;
|
1064 | 'authorization'?: string;
|
1065 | 'age'?: string;
|
1066 | 'allow'?: string;
|
1067 | 'alt-svc'?: string;
|
1068 | 'cache-control'?: string;
|
1069 | 'connection'?: string;
|
1070 | 'content-disposition'?: string;
|
1071 | 'content-encoding'?: string;
|
1072 | 'content-language'?: string;
|
1073 | 'content-length'?: string;
|
1074 | 'content-location'?: string;
|
1075 | 'content-range'?: string;
|
1076 | 'content-type'?: string;
|
1077 | 'date'?: string;
|
1078 | 'expires'?: string;
|
1079 | 'host'?: string;
|
1080 | 'last-modified'?: string;
|
1081 | 'location'?: string;
|
1082 | 'pragma'?: string;
|
1083 | 'proxy-authenticate'?: string;
|
1084 | 'public-key-pins'?: string;
|
1085 | 'retry-after'?: string;
|
1086 | 'set-cookie'?: string[];
|
1087 | 'strict-transport-security'?: string;
|
1088 | 'trailer'?: string;
|
1089 | 'transfer-encoding'?: string;
|
1090 | 'tk'?: string;
|
1091 | 'upgrade'?: string;
|
1092 | 'vary'?: string;
|
1093 | 'via'?: string;
|
1094 | 'warning'?: string;
|
1095 | 'www-authenticate'?: string;
|
1096 | [header: string]: string | string[] | undefined;
|
1097 | }
|
1098 |
|
1099 |
|
1100 | export interface OutgoingHttpHeaders {
|
1101 | [header: string]: number | string | string[] | undefined;
|
1102 | }
|
1103 |
|
1104 | export interface ClientRequestArgs {
|
1105 | protocol?: string;
|
1106 | host?: string;
|
1107 | hostname?: string;
|
1108 | family?: number;
|
1109 | port?: number | string;
|
1110 | defaultPort?: number | string;
|
1111 | localAddress?: string;
|
1112 | socketPath?: string;
|
1113 | method?: string;
|
1114 | path?: string;
|
1115 | headers?: OutgoingHttpHeaders;
|
1116 | auth?: string;
|
1117 | agent?: Agent | boolean;
|
1118 | _defaultAgent?: Agent;
|
1119 | timeout?: number;
|
1120 |
|
1121 | createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket;
|
1122 | }
|
1123 |
|
1124 | export class Server extends net.Server {
|
1125 | constructor(requestListener?: (req: IncomingMessage, res: ServerResponse) => void);
|
1126 |
|
1127 | setTimeout(msecs?: number, callback?: () => void): this;
|
1128 | setTimeout(callback: () => void): this;
|
1129 | maxHeadersCount: number;
|
1130 | timeout: number;
|
1131 | keepAliveTimeout: number;
|
1132 | }
|
1133 | /**
|
1134 | * @deprecated Use IncomingMessage
|
1135 | */
|
1136 | export class ServerRequest extends IncomingMessage {
|
1137 | connection: net.Socket;
|
1138 | }
|
1139 |
|
1140 |
|
1141 | export class OutgoingMessage extends stream.Writable {
|
1142 | upgrading: boolean;
|
1143 | chunkedEncoding: boolean;
|
1144 | shouldKeepAlive: boolean;
|
1145 | useChunkedEncodingByDefault: boolean;
|
1146 | sendDate: boolean;
|
1147 | finished: boolean;
|
1148 | headersSent: boolean;
|
1149 | connection: net.Socket;
|
1150 |
|
1151 | constructor();
|
1152 |
|
1153 | setTimeout(msecs: number, callback?: () => void): this;
|
1154 | destroy(error: Error): void;
|
1155 | setHeader(name: string, value: number | string | string[]): void;
|
1156 | getHeader(name: string): number | string | string[] | undefined;
|
1157 | getHeaders(): OutgoingHttpHeaders;
|
1158 | getHeaderNames(): string[];
|
1159 | hasHeader(name: string): boolean;
|
1160 | removeHeader(name: string): void;
|
1161 | addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
|
1162 | flushHeaders(): void;
|
1163 | }
|
1164 |
|
1165 | // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256
|
1166 | export class ServerResponse extends OutgoingMessage {
|
1167 | statusCode: number;
|
1168 | statusMessage: string;
|
1169 |
|
1170 | constructor(req: IncomingMessage);
|
1171 |
|
1172 | assignSocket(socket: net.Socket): void;
|
1173 | detachSocket(socket: net.Socket): void;
|
1174 | // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
|
1175 | // no args in writeContinue callback
|
1176 | writeContinue(callback?: () => void): void;
|
1177 | writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): void;
|
1178 | writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void;
|
1179 | }
|
1180 |
|
1181 | // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
|
1182 | export class ClientRequest extends OutgoingMessage {
|
1183 | connection: net.Socket;
|
1184 | socket: net.Socket;
|
1185 | aborted: number;
|
1186 |
|
1187 | constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
1188 |
|
1189 | abort(): void;
|
1190 | onSocket(socket: net.Socket): void;
|
1191 | setTimeout(timeout: number, callback?: () => void): this;
|
1192 | setNoDelay(noDelay?: boolean): void;
|
1193 | setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
1194 | }
|
1195 |
|
1196 | export class IncomingMessage extends stream.Readable {
|
1197 | constructor(socket: net.Socket);
|
1198 |
|
1199 | httpVersion: string;
|
1200 | httpVersionMajor: number;
|
1201 | httpVersionMinor: number;
|
1202 | connection: net.Socket;
|
1203 | headers: IncomingHttpHeaders;
|
1204 | rawHeaders: string[];
|
1205 | trailers: { [key: string]: string | undefined };
|
1206 | rawTrailers: string[];
|
1207 | setTimeout(msecs: number, callback: () => void): this;
|
1208 | |
1209 |
|
1210 |
|
1211 | method?: string;
|
1212 | |
1213 |
|
1214 |
|
1215 | url?: string;
|
1216 | |
1217 |
|
1218 |
|
1219 | statusCode?: number;
|
1220 | |
1221 |
|
1222 |
|
1223 | statusMessage?: string;
|
1224 | socket: net.Socket;
|
1225 | destroy(error?: Error): void;
|
1226 | }
|
1227 |
|
1228 | |
1229 |
|
1230 |
|
1231 | export class ClientResponse extends IncomingMessage { }
|
1232 |
|
1233 | export interface AgentOptions {
|
1234 | |
1235 |
|
1236 |
|
1237 | keepAlive?: boolean;
|
1238 | |
1239 |
|
1240 |
|
1241 |
|
1242 | keepAliveMsecs?: number;
|
1243 | |
1244 |
|
1245 |
|
1246 | maxSockets?: number;
|
1247 | |
1248 |
|
1249 |
|
1250 | maxFreeSockets?: number;
|
1251 | }
|
1252 |
|
1253 | export class Agent {
|
1254 | maxFreeSockets: number;
|
1255 | maxSockets: number;
|
1256 | sockets: any;
|
1257 | requests: any;
|
1258 |
|
1259 | constructor(opts?: AgentOptions);
|
1260 |
|
1261 | /**
|
1262 | * Destroy any sockets that are currently in use by the agent.
|
1263 | * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
|
1264 | * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
|
1265 | * sockets may hang open for quite a long time before the server terminates them.
|
1266 | */
|
1267 | destroy(): void;
|
1268 | }
|
1269 |
|
1270 | export var METHODS: string[];
|
1271 |
|
1272 | export var STATUS_CODES: {
|
1273 | [errorCode: number]: string | undefined;
|
1274 | [errorCode: string]: string | undefined;
|
1275 | };
|
1276 |
|
1277 | export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
1278 | export function createClient(port?: number, host?: string): any;
|
1279 |
|
1280 |
|
1281 |
|
1282 | export interface RequestOptions extends ClientRequestArgs { }
|
1283 | export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
1284 | export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
1285 | export var globalAgent: Agent;
|
1286 | }
|
1287 |
|
1288 | declare module "cluster" {
|
1289 | import * as child from "child_process";
|
1290 | import * as events from "events";
|
1291 | import * as net from "net";
|
1292 |
|
1293 |
|
1294 | export interface ClusterSettings {
|
1295 | execArgv?: string[];
|
1296 | exec?: string;
|
1297 | args?: string[];
|
1298 | silent?: boolean;
|
1299 | stdio?: any[];
|
1300 | uid?: number;
|
1301 | gid?: number;
|
1302 | inspectPort?: number | (() => number);
|
1303 | }
|
1304 |
|
1305 | export interface Address {
|
1306 | address: string;
|
1307 | port: number;
|
1308 | addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
1309 | }
|
1310 |
|
1311 | export class Worker extends events.EventEmitter {
|
1312 | id: number;
|
1313 | process: child.ChildProcess;
|
1314 | suicide: boolean;
|
1315 | send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean;
|
1316 | kill(signal?: string): void;
|
1317 | destroy(signal?: string): void;
|
1318 | disconnect(): void;
|
1319 | isConnected(): boolean;
|
1320 | isDead(): boolean;
|
1321 | exitedAfterDisconnect: boolean;
|
1322 |
|
1323 | /**
|
1324 | * events.EventEmitter
|
1325 | * 1. disconnect
|
1326 | * 2. error
|
1327 | * 3. exit
|
1328 | * 4. listening
|
1329 | * 5. message
|
1330 | * 6. online
|
1331 | */
|
1332 | addListener(event: string, listener: (...args: any[]) => void): this;
|
1333 | addListener(event: "disconnect", listener: () => void): this;
|
1334 | addListener(event: "error", listener: (error: Error) => void): this;
|
1335 | addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
1336 | addListener(event: "listening", listener: (address: Address) => void): this;
|
1337 | addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
1338 | addListener(event: "online", listener: () => void): this;
|
1339 |
|
1340 | emit(event: string | symbol, ...args: any[]): boolean;
|
1341 | emit(event: "disconnect"): boolean;
|
1342 | emit(event: "error", error: Error): boolean;
|
1343 | emit(event: "exit", code: number, signal: string): boolean;
|
1344 | emit(event: "listening", address: Address): boolean;
|
1345 | emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
|
1346 | emit(event: "online"): boolean;
|
1347 |
|
1348 | on(event: string, listener: (...args: any[]) => void): this;
|
1349 | on(event: "disconnect", listener: () => void): this;
|
1350 | on(event: "error", listener: (error: Error) => void): this;
|
1351 | on(event: "exit", listener: (code: number, signal: string) => void): this;
|
1352 | on(event: "listening", listener: (address: Address) => void): this;
|
1353 | on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
1354 | on(event: "online", listener: () => void): this;
|
1355 |
|
1356 | once(event: string, listener: (...args: any[]) => void): this;
|
1357 | once(event: "disconnect", listener: () => void): this;
|
1358 | once(event: "error", listener: (error: Error) => void): this;
|
1359 | once(event: "exit", listener: (code: number, signal: string) => void): this;
|
1360 | once(event: "listening", listener: (address: Address) => void): this;
|
1361 | once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
1362 | once(event: "online", listener: () => void): this;
|
1363 |
|
1364 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
1365 | prependListener(event: "disconnect", listener: () => void): this;
|
1366 | prependListener(event: "error", listener: (error: Error) => void): this;
|
1367 | prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
1368 | prependListener(event: "listening", listener: (address: Address) => void): this;
|
1369 | prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
1370 | prependListener(event: "online", listener: () => void): this;
|
1371 |
|
1372 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
1373 | prependOnceListener(event: "disconnect", listener: () => void): this;
|
1374 | prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
1375 | prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
1376 | prependOnceListener(event: "listening", listener: (address: Address) => void): this;
|
1377 | prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
1378 | prependOnceListener(event: "online", listener: () => void): this;
|
1379 | }
|
1380 |
|
1381 | export interface Cluster extends events.EventEmitter {
|
1382 | Worker: Worker;
|
1383 | disconnect(callback?: Function): void;
|
1384 | fork(env?: any): Worker;
|
1385 | isMaster: boolean;
|
1386 | isWorker: boolean;
|
1387 | // TODO: cluster.schedulingPolicy
|
1388 | settings: ClusterSettings;
|
1389 | setupMaster(settings?: ClusterSettings): void;
|
1390 | worker?: Worker;
|
1391 | workers?: {
|
1392 | [index: string]: Worker | undefined
|
1393 | };
|
1394 |
|
1395 | /**
|
1396 | * events.EventEmitter
|
1397 | * 1. disconnect
|
1398 | * 2. exit
|
1399 | * 3. fork
|
1400 | * 4. listening
|
1401 | * 5. message
|
1402 | * 6. online
|
1403 | * 7. setup
|
1404 | */
|
1405 | addListener(event: string, listener: (...args: any[]) => void): this;
|
1406 | addListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
1407 | addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
1408 | addListener(event: "fork", listener: (worker: Worker) => void): this;
|
1409 | addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
1410 | addListener(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.
|
1411 | addListener(event: "online", listener: (worker: Worker) => void): this;
|
1412 | addListener(event: "setup", listener: (settings: any) => void): this;
|
1413 |
|
1414 | emit(event: string | symbol, ...args: any[]): boolean;
|
1415 | emit(event: "disconnect", worker: Worker): boolean;
|
1416 | emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
1417 | emit(event: "fork", worker: Worker): boolean;
|
1418 | emit(event: "listening", worker: Worker, address: Address): boolean;
|
1419 | emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
1420 | emit(event: "online", worker: Worker): boolean;
|
1421 | emit(event: "setup", settings: any): boolean;
|
1422 |
|
1423 | on(event: string, listener: (...args: any[]) => void): this;
|
1424 | on(event: "disconnect", listener: (worker: Worker) => void): this;
|
1425 | on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
1426 | on(event: "fork", listener: (worker: Worker) => void): this;
|
1427 | on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
1428 | on(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.
|
1429 | on(event: "online", listener: (worker: Worker) => void): this;
|
1430 | on(event: "setup", listener: (settings: any) => void): this;
|
1431 |
|
1432 | once(event: string, listener: (...args: any[]) => void): this;
|
1433 | once(event: "disconnect", listener: (worker: Worker) => void): this;
|
1434 | once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
1435 | once(event: "fork", listener: (worker: Worker) => void): this;
|
1436 | once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
1437 | 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.
|
1438 | once(event: "online", listener: (worker: Worker) => void): this;
|
1439 | once(event: "setup", listener: (settings: any) => void): this;
|
1440 |
|
1441 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
1442 | prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
1443 | prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
1444 | prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
1445 | prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
1446 | prependListener(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.
|
1447 | prependListener(event: "online", listener: (worker: Worker) => void): this;
|
1448 | prependListener(event: "setup", listener: (settings: any) => void): this;
|
1449 |
|
1450 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
1451 | prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
1452 | prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
1453 | prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
|
1454 | prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
1455 | prependOnceListener(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.
|
1456 | prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
|
1457 | prependOnceListener(event: "setup", listener: (settings: any) => void): this;
|
1458 | }
|
1459 |
|
1460 | export function disconnect(callback?: Function): void;
|
1461 | export function fork(env?: any): Worker;
|
1462 | export var isMaster: boolean;
|
1463 | export var isWorker: boolean;
|
1464 | // TODO: cluster.schedulingPolicy
|
1465 | export var settings: ClusterSettings;
|
1466 | export function setupMaster(settings?: ClusterSettings): void;
|
1467 | export var worker: Worker;
|
1468 | export var workers: {
|
1469 | [index: string]: Worker | undefined
|
1470 | };
|
1471 |
|
1472 | /**
|
1473 | * events.EventEmitter
|
1474 | * 1. disconnect
|
1475 | * 2. exit
|
1476 | * 3. fork
|
1477 | * 4. listening
|
1478 | * 5. message
|
1479 | * 6. online
|
1480 | * 7. setup
|
1481 | */
|
1482 | export function addListener(event: string, listener: (...args: any[]) => void): Cluster;
|
1483 | export function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
1484 | export function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
1485 | export function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
1486 | export function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
1487 | export function addListener(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.
|
1488 | export function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
1489 | export function addListener(event: "setup", listener: (settings: any) => void): Cluster;
|
1490 |
|
1491 | export function emit(event: string | symbol, ...args: any[]): boolean;
|
1492 | export function emit(event: "disconnect", worker: Worker): boolean;
|
1493 | export function emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
1494 | export function emit(event: "fork", worker: Worker): boolean;
|
1495 | export function emit(event: "listening", worker: Worker, address: Address): boolean;
|
1496 | export function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
1497 | export function emit(event: "online", worker: Worker): boolean;
|
1498 | export function emit(event: "setup", settings: any): boolean;
|
1499 |
|
1500 | export function on(event: string, listener: (...args: any[]) => void): Cluster;
|
1501 | export function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
1502 | export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
1503 | export function on(event: "fork", listener: (worker: Worker) => void): Cluster;
|
1504 | export function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
1505 | export 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.
|
1506 | export function on(event: "online", listener: (worker: Worker) => void): Cluster;
|
1507 | export function on(event: "setup", listener: (settings: any) => void): Cluster;
|
1508 |
|
1509 | export function once(event: string, listener: (...args: any[]) => void): Cluster;
|
1510 | export function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
1511 | export function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
1512 | export function once(event: "fork", listener: (worker: Worker) => void): Cluster;
|
1513 | export function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
1514 | export 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.
|
1515 | export function once(event: "online", listener: (worker: Worker) => void): Cluster;
|
1516 | export function once(event: "setup", listener: (settings: any) => void): Cluster;
|
1517 |
|
1518 | export function removeListener(event: string, listener: (...args: any[]) => void): Cluster;
|
1519 | export function removeAllListeners(event?: string): Cluster;
|
1520 | export function setMaxListeners(n: number): Cluster;
|
1521 | export function getMaxListeners(): number;
|
1522 | export function listeners(event: string): Function[];
|
1523 | export function listenerCount(type: string): number;
|
1524 |
|
1525 | export function prependListener(event: string, listener: (...args: any[]) => void): Cluster;
|
1526 | export function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
1527 | export function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
1528 | export function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
1529 | export function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
1530 | export function prependListener(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.
|
1531 | export function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
1532 | export function prependListener(event: "setup", listener: (settings: any) => void): Cluster;
|
1533 |
|
1534 | export function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
|
1535 | export function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
1536 | export function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
1537 | export function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
1538 | export function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
1539 | export function prependOnceListener(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.
|
1540 | export function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
1541 | export function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster;
|
1542 |
|
1543 | export function eventNames(): string[];
|
1544 | }
|
1545 |
|
1546 | declare module "zlib" {
|
1547 | import * as stream from "stream";
|
1548 |
|
1549 | export interface ZlibOptions {
|
1550 | flush?: number; // default: zlib.constants.Z_NO_FLUSH
|
1551 | finishFlush?: number; // default: zlib.constants.Z_FINISH
|
1552 | chunkSize?: number; // default: 16*1024
|
1553 | windowBits?: number;
|
1554 | level?: number; // compression only
|
1555 | memLevel?: number; // compression only
|
1556 | strategy?: number; // compression only
|
1557 | dictionary?: Buffer | NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
|
1558 | }
|
1559 |
|
1560 | export interface Zlib {
|
1561 | readonly bytesRead: number;
|
1562 | close(callback?: () => void): void;
|
1563 | flush(kind?: number | (() => void), callback?: () => void): void;
|
1564 | }
|
1565 |
|
1566 | export interface ZlibParams {
|
1567 | params(level: number, strategy: number, callback: () => void): void;
|
1568 | }
|
1569 |
|
1570 | export interface ZlibReset {
|
1571 | reset(): void;
|
1572 | }
|
1573 |
|
1574 | export interface Gzip extends stream.Transform, Zlib { }
|
1575 | export interface Gunzip extends stream.Transform, Zlib { }
|
1576 | export interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { }
|
1577 | export interface Inflate extends stream.Transform, Zlib, ZlibReset { }
|
1578 | export interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { }
|
1579 | export interface InflateRaw extends stream.Transform, Zlib, ZlibReset { }
|
1580 | export interface Unzip extends stream.Transform, Zlib { }
|
1581 |
|
1582 | export function createGzip(options?: ZlibOptions): Gzip;
|
1583 | export function createGunzip(options?: ZlibOptions): Gunzip;
|
1584 | export function createDeflate(options?: ZlibOptions): Deflate;
|
1585 | export function createInflate(options?: ZlibOptions): Inflate;
|
1586 | export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
|
1587 | export function createInflateRaw(options?: ZlibOptions): InflateRaw;
|
1588 | export function createUnzip(options?: ZlibOptions): Unzip;
|
1589 |
|
1590 | type InputType = string | Buffer | DataView | ArrayBuffer | NodeJS.TypedArray;
|
1591 | export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1592 | export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1593 | export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1594 | export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1595 | export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1596 | export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1597 | export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1598 | export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1599 | export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1600 | export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1601 | export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1602 | export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1603 | export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1604 | export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1605 | export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1606 | export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1607 | export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1608 | export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1609 | export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void;
|
1610 | export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void;
|
1611 | export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
1612 |
|
1613 | export namespace constants {
|
1614 | // Allowed flush values.
|
1615 |
|
1616 | export const Z_NO_FLUSH: number;
|
1617 | export const Z_PARTIAL_FLUSH: number;
|
1618 | export const Z_SYNC_FLUSH: number;
|
1619 | export const Z_FULL_FLUSH: number;
|
1620 | export const Z_FINISH: number;
|
1621 | export const Z_BLOCK: number;
|
1622 | export const Z_TREES: number;
|
1623 |
|
1624 | // Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events.
|
1625 |
|
1626 | export const Z_OK: number;
|
1627 | export const Z_STREAM_END: number;
|
1628 | export const Z_NEED_DICT: number;
|
1629 | export const Z_ERRNO: number;
|
1630 | export const Z_STREAM_ERROR: number;
|
1631 | export const Z_DATA_ERROR: number;
|
1632 | export const Z_MEM_ERROR: number;
|
1633 | export const Z_BUF_ERROR: number;
|
1634 | export const Z_VERSION_ERROR: number;
|
1635 |
|
1636 | // Compression levels.
|
1637 |
|
1638 | export const Z_NO_COMPRESSION: number;
|
1639 | export const Z_BEST_SPEED: number;
|
1640 | export const Z_BEST_COMPRESSION: number;
|
1641 | export const Z_DEFAULT_COMPRESSION: number;
|
1642 |
|
1643 | // Compression strategy.
|
1644 |
|
1645 | export const Z_FILTERED: number;
|
1646 | export const Z_HUFFMAN_ONLY: number;
|
1647 | export const Z_RLE: number;
|
1648 | export const Z_FIXED: number;
|
1649 | export const Z_DEFAULT_STRATEGY: number;
|
1650 | }
|
1651 |
|
1652 | // Constants
|
1653 | export var Z_NO_FLUSH: number;
|
1654 | export var Z_PARTIAL_FLUSH: number;
|
1655 | export var Z_SYNC_FLUSH: number;
|
1656 | export var Z_FULL_FLUSH: number;
|
1657 | export var Z_FINISH: number;
|
1658 | export var Z_BLOCK: number;
|
1659 | export var Z_TREES: number;
|
1660 | export var Z_OK: number;
|
1661 | export var Z_STREAM_END: number;
|
1662 | export var Z_NEED_DICT: number;
|
1663 | export var Z_ERRNO: number;
|
1664 | export var Z_STREAM_ERROR: number;
|
1665 | export var Z_DATA_ERROR: number;
|
1666 | export var Z_MEM_ERROR: number;
|
1667 | export var Z_BUF_ERROR: number;
|
1668 | export var Z_VERSION_ERROR: number;
|
1669 | export var Z_NO_COMPRESSION: number;
|
1670 | export var Z_BEST_SPEED: number;
|
1671 | export var Z_BEST_COMPRESSION: number;
|
1672 | export var Z_DEFAULT_COMPRESSION: number;
|
1673 | export var Z_FILTERED: number;
|
1674 | export var Z_HUFFMAN_ONLY: number;
|
1675 | export var Z_RLE: number;
|
1676 | export var Z_FIXED: number;
|
1677 | export var Z_DEFAULT_STRATEGY: number;
|
1678 | export var Z_BINARY: number;
|
1679 | export var Z_TEXT: number;
|
1680 | export var Z_ASCII: number;
|
1681 | export var Z_UNKNOWN: number;
|
1682 | export var Z_DEFLATED: number;
|
1683 | }
|
1684 |
|
1685 | declare module "os" {
|
1686 | export interface CpuInfo {
|
1687 | model: string;
|
1688 | speed: number;
|
1689 | times: {
|
1690 | user: number;
|
1691 | nice: number;
|
1692 | sys: number;
|
1693 | idle: number;
|
1694 | irq: number;
|
1695 | };
|
1696 | }
|
1697 |
|
1698 | export interface NetworkInterfaceBase {
|
1699 | address: string;
|
1700 | netmask: string;
|
1701 | mac: string;
|
1702 | internal: boolean;
|
1703 | }
|
1704 |
|
1705 | export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
1706 | family: "IPv4";
|
1707 | }
|
1708 |
|
1709 | export interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
1710 | family: "IPv6";
|
1711 | scopeid: number;
|
1712 | }
|
1713 |
|
1714 | export type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
|
1715 |
|
1716 | export function hostname(): string;
|
1717 | export function loadavg(): number[];
|
1718 | export function uptime(): number;
|
1719 | export function freemem(): number;
|
1720 | export function totalmem(): number;
|
1721 | export function cpus(): CpuInfo[];
|
1722 | export function type(): string;
|
1723 | export function release(): string;
|
1724 | export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };
|
1725 | export function homedir(): string;
|
1726 | export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string };
|
1727 | export var constants: {
|
1728 | UV_UDP_REUSEADDR: number,
|
1729 | signals: {
|
1730 | SIGHUP: number;
|
1731 | SIGINT: number;
|
1732 | SIGQUIT: number;
|
1733 | SIGILL: number;
|
1734 | SIGTRAP: number;
|
1735 | SIGABRT: number;
|
1736 | SIGIOT: number;
|
1737 | SIGBUS: number;
|
1738 | SIGFPE: number;
|
1739 | SIGKILL: number;
|
1740 | SIGUSR1: number;
|
1741 | SIGSEGV: number;
|
1742 | SIGUSR2: number;
|
1743 | SIGPIPE: number;
|
1744 | SIGALRM: number;
|
1745 | SIGTERM: number;
|
1746 | SIGCHLD: number;
|
1747 | SIGSTKFLT: number;
|
1748 | SIGCONT: number;
|
1749 | SIGSTOP: number;
|
1750 | SIGTSTP: number;
|
1751 | SIGTTIN: number;
|
1752 | SIGTTOU: number;
|
1753 | SIGURG: number;
|
1754 | SIGXCPU: number;
|
1755 | SIGXFSZ: number;
|
1756 | SIGVTALRM: number;
|
1757 | SIGPROF: number;
|
1758 | SIGWINCH: number;
|
1759 | SIGIO: number;
|
1760 | SIGPOLL: number;
|
1761 | SIGPWR: number;
|
1762 | SIGSYS: number;
|
1763 | SIGUNUSED: number;
|
1764 | },
|
1765 | errno: {
|
1766 | E2BIG: number;
|
1767 | EACCES: number;
|
1768 | EADDRINUSE: number;
|
1769 | EADDRNOTAVAIL: number;
|
1770 | EAFNOSUPPORT: number;
|
1771 | EAGAIN: number;
|
1772 | EALREADY: number;
|
1773 | EBADF: number;
|
1774 | EBADMSG: number;
|
1775 | EBUSY: number;
|
1776 | ECANCELED: number;
|
1777 | ECHILD: number;
|
1778 | ECONNABORTED: number;
|
1779 | ECONNREFUSED: number;
|
1780 | ECONNRESET: number;
|
1781 | EDEADLK: number;
|
1782 | EDESTADDRREQ: number;
|
1783 | EDOM: number;
|
1784 | EDQUOT: number;
|
1785 | EEXIST: number;
|
1786 | EFAULT: number;
|
1787 | EFBIG: number;
|
1788 | EHOSTUNREACH: number;
|
1789 | EIDRM: number;
|
1790 | EILSEQ: number;
|
1791 | EINPROGRESS: number;
|
1792 | EINTR: number;
|
1793 | EINVAL: number;
|
1794 | EIO: number;
|
1795 | EISCONN: number;
|
1796 | EISDIR: number;
|
1797 | ELOOP: number;
|
1798 | EMFILE: number;
|
1799 | EMLINK: number;
|
1800 | EMSGSIZE: number;
|
1801 | EMULTIHOP: number;
|
1802 | ENAMETOOLONG: number;
|
1803 | ENETDOWN: number;
|
1804 | ENETRESET: number;
|
1805 | ENETUNREACH: number;
|
1806 | ENFILE: number;
|
1807 | ENOBUFS: number;
|
1808 | ENODATA: number;
|
1809 | ENODEV: number;
|
1810 | ENOENT: number;
|
1811 | ENOEXEC: number;
|
1812 | ENOLCK: number;
|
1813 | ENOLINK: number;
|
1814 | ENOMEM: number;
|
1815 | ENOMSG: number;
|
1816 | ENOPROTOOPT: number;
|
1817 | ENOSPC: number;
|
1818 | ENOSR: number;
|
1819 | ENOSTR: number;
|
1820 | ENOSYS: number;
|
1821 | ENOTCONN: number;
|
1822 | ENOTDIR: number;
|
1823 | ENOTEMPTY: number;
|
1824 | ENOTSOCK: number;
|
1825 | ENOTSUP: number;
|
1826 | ENOTTY: number;
|
1827 | ENXIO: number;
|
1828 | EOPNOTSUPP: number;
|
1829 | EOVERFLOW: number;
|
1830 | EPERM: number;
|
1831 | EPIPE: number;
|
1832 | EPROTO: number;
|
1833 | EPROTONOSUPPORT: number;
|
1834 | EPROTOTYPE: number;
|
1835 | ERANGE: number;
|
1836 | EROFS: number;
|
1837 | ESPIPE: number;
|
1838 | ESRCH: number;
|
1839 | ESTALE: number;
|
1840 | ETIME: number;
|
1841 | ETIMEDOUT: number;
|
1842 | ETXTBSY: number;
|
1843 | EWOULDBLOCK: number;
|
1844 | EXDEV: number;
|
1845 | },
|
1846 | };
|
1847 | export function arch(): string;
|
1848 | export function platform(): NodeJS.Platform;
|
1849 | export function tmpdir(): string;
|
1850 | export const EOL: string;
|
1851 | export function endianness(): "BE" | "LE";
|
1852 | }
|
1853 |
|
1854 | declare module "https" {
|
1855 | import * as tls from "tls";
|
1856 | import * as events from "events";
|
1857 | import * as http from "http";
|
1858 | import { URL } from "url";
|
1859 |
|
1860 | export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions;
|
1861 |
|
1862 | export type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
|
1863 | rejectUnauthorized?: boolean; // Defaults to true
|
1864 | servername?: string; // SNI TLS Extension
|
1865 | };
|
1866 |
|
1867 | export interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
1868 | rejectUnauthorized?: boolean;
|
1869 | maxCachedSessions?: number;
|
1870 | }
|
1871 |
|
1872 | export class Agent extends http.Agent {
|
1873 | constructor(options?: AgentOptions);
|
1874 | options: AgentOptions;
|
1875 | }
|
1876 |
|
1877 | export class Server extends tls.Server {
|
1878 | setTimeout(callback: () => void): this;
|
1879 | setTimeout(msecs?: number, callback?: () => void): this;
|
1880 | timeout: number;
|
1881 | keepAliveTimeout: number;
|
1882 | }
|
1883 |
|
1884 | export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server;
|
1885 | export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
1886 | export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
1887 | export var globalAgent: Agent;
|
1888 | }
|
1889 |
|
1890 | declare module "punycode" {
|
1891 | export function decode(string: string): string;
|
1892 | export function encode(string: string): string;
|
1893 | export function toUnicode(domain: string): string;
|
1894 | export function toASCII(domain: string): string;
|
1895 | export var ucs2: ucs2;
|
1896 | interface ucs2 {
|
1897 | decode(string: string): number[];
|
1898 | encode(codePoints: number[]): string;
|
1899 | }
|
1900 | export var version: any;
|
1901 | }
|
1902 |
|
1903 | declare module "repl" {
|
1904 | import * as stream from "stream";
|
1905 | import * as readline from "readline";
|
1906 |
|
1907 | export interface ReplOptions {
|
1908 | prompt?: string;
|
1909 | input?: NodeJS.ReadableStream;
|
1910 | output?: NodeJS.WritableStream;
|
1911 | terminal?: boolean;
|
1912 | eval?: Function;
|
1913 | useColors?: boolean;
|
1914 | useGlobal?: boolean;
|
1915 | ignoreUndefined?: boolean;
|
1916 | writer?: Function;
|
1917 | completer?: Function;
|
1918 | replMode?: any;
|
1919 | breakEvalOnSigint?: any;
|
1920 | }
|
1921 |
|
1922 | export interface REPLServer extends readline.ReadLine {
|
1923 | context: any;
|
1924 | inputStream: NodeJS.ReadableStream;
|
1925 | outputStream: NodeJS.WritableStream;
|
1926 |
|
1927 | defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void;
|
1928 | displayPrompt(preserveCursor?: boolean): void;
|
1929 |
|
1930 | /**
|
1931 | * events.EventEmitter
|
1932 | * 1. exit
|
1933 | * 2. reset
|
1934 | */
|
1935 |
|
1936 | addListener(event: string, listener: (...args: any[]) => void): this;
|
1937 | addListener(event: "exit", listener: () => void): this;
|
1938 | addListener(event: "reset", listener: (...args: any[]) => void): this;
|
1939 |
|
1940 | emit(event: string | symbol, ...args: any[]): boolean;
|
1941 | emit(event: "exit"): boolean;
|
1942 | emit(event: "reset", context: any): boolean;
|
1943 |
|
1944 | on(event: string, listener: (...args: any[]) => void): this;
|
1945 | on(event: "exit", listener: () => void): this;
|
1946 | on(event: "reset", listener: (...args: any[]) => void): this;
|
1947 |
|
1948 | once(event: string, listener: (...args: any[]) => void): this;
|
1949 | once(event: "exit", listener: () => void): this;
|
1950 | once(event: "reset", listener: (...args: any[]) => void): this;
|
1951 |
|
1952 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
1953 | prependListener(event: "exit", listener: () => void): this;
|
1954 | prependListener(event: "reset", listener: (...args: any[]) => void): this;
|
1955 |
|
1956 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
1957 | prependOnceListener(event: "exit", listener: () => void): this;
|
1958 | prependOnceListener(event: "reset", listener: (...args: any[]) => void): this;
|
1959 | }
|
1960 |
|
1961 | export function start(options?: string | ReplOptions): REPLServer;
|
1962 |
|
1963 | export class Recoverable extends SyntaxError {
|
1964 | err: Error;
|
1965 |
|
1966 | constructor(err: Error);
|
1967 | }
|
1968 | }
|
1969 |
|
1970 | declare module "readline" {
|
1971 | import * as events from "events";
|
1972 | import * as stream from "stream";
|
1973 |
|
1974 | export interface Key {
|
1975 | sequence?: string;
|
1976 | name?: string;
|
1977 | ctrl?: boolean;
|
1978 | meta?: boolean;
|
1979 | shift?: boolean;
|
1980 | }
|
1981 |
|
1982 | export interface ReadLine extends events.EventEmitter {
|
1983 | setPrompt(prompt: string): void;
|
1984 | prompt(preserveCursor?: boolean): void;
|
1985 | question(query: string, callback: (answer: string) => void): void;
|
1986 | pause(): ReadLine;
|
1987 | resume(): ReadLine;
|
1988 | close(): void;
|
1989 | write(data: string | Buffer, key?: Key): void;
|
1990 |
|
1991 | /**
|
1992 | * events.EventEmitter
|
1993 | * 1. close
|
1994 | * 2. line
|
1995 | * 3. pause
|
1996 | * 4. resume
|
1997 | * 5. SIGCONT
|
1998 | * 6. SIGINT
|
1999 | * 7. SIGTSTP
|
2000 | */
|
2001 |
|
2002 | addListener(event: string, listener: (...args: any[]) => void): this;
|
2003 | addListener(event: "close", listener: () => void): this;
|
2004 | addListener(event: "line", listener: (input: any) => void): this;
|
2005 | addListener(event: "pause", listener: () => void): this;
|
2006 | addListener(event: "resume", listener: () => void): this;
|
2007 | addListener(event: "SIGCONT", listener: () => void): this;
|
2008 | addListener(event: "SIGINT", listener: () => void): this;
|
2009 | addListener(event: "SIGTSTP", listener: () => void): this;
|
2010 |
|
2011 | emit(event: string | symbol, ...args: any[]): boolean;
|
2012 | emit(event: "close"): boolean;
|
2013 | emit(event: "line", input: any): boolean;
|
2014 | emit(event: "pause"): boolean;
|
2015 | emit(event: "resume"): boolean;
|
2016 | emit(event: "SIGCONT"): boolean;
|
2017 | emit(event: "SIGINT"): boolean;
|
2018 | emit(event: "SIGTSTP"): boolean;
|
2019 |
|
2020 | on(event: string, listener: (...args: any[]) => void): this;
|
2021 | on(event: "close", listener: () => void): this;
|
2022 | on(event: "line", listener: (input: any) => void): this;
|
2023 | on(event: "pause", listener: () => void): this;
|
2024 | on(event: "resume", listener: () => void): this;
|
2025 | on(event: "SIGCONT", listener: () => void): this;
|
2026 | on(event: "SIGINT", listener: () => void): this;
|
2027 | on(event: "SIGTSTP", listener: () => void): this;
|
2028 |
|
2029 | once(event: string, listener: (...args: any[]) => void): this;
|
2030 | once(event: "close", listener: () => void): this;
|
2031 | once(event: "line", listener: (input: any) => void): this;
|
2032 | once(event: "pause", listener: () => void): this;
|
2033 | once(event: "resume", listener: () => void): this;
|
2034 | once(event: "SIGCONT", listener: () => void): this;
|
2035 | once(event: "SIGINT", listener: () => void): this;
|
2036 | once(event: "SIGTSTP", listener: () => void): this;
|
2037 |
|
2038 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
2039 | prependListener(event: "close", listener: () => void): this;
|
2040 | prependListener(event: "line", listener: (input: any) => void): this;
|
2041 | prependListener(event: "pause", listener: () => void): this;
|
2042 | prependListener(event: "resume", listener: () => void): this;
|
2043 | prependListener(event: "SIGCONT", listener: () => void): this;
|
2044 | prependListener(event: "SIGINT", listener: () => void): this;
|
2045 | prependListener(event: "SIGTSTP", listener: () => void): this;
|
2046 |
|
2047 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
2048 | prependOnceListener(event: "close", listener: () => void): this;
|
2049 | prependOnceListener(event: "line", listener: (input: any) => void): this;
|
2050 | prependOnceListener(event: "pause", listener: () => void): this;
|
2051 | prependOnceListener(event: "resume", listener: () => void): this;
|
2052 | prependOnceListener(event: "SIGCONT", listener: () => void): this;
|
2053 | prependOnceListener(event: "SIGINT", listener: () => void): this;
|
2054 | prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
2055 | }
|
2056 |
|
2057 | type Completer = (line: string) => CompleterResult;
|
2058 | type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any;
|
2059 |
|
2060 | export type CompleterResult = [string[], string];
|
2061 |
|
2062 | export interface ReadLineOptions {
|
2063 | input: NodeJS.ReadableStream;
|
2064 | output?: NodeJS.WritableStream;
|
2065 | completer?: Completer | AsyncCompleter;
|
2066 | terminal?: boolean;
|
2067 | historySize?: number;
|
2068 | prompt?: string;
|
2069 | crlfDelay?: number;
|
2070 | removeHistoryDuplicates?: boolean;
|
2071 | }
|
2072 |
|
2073 | export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine;
|
2074 | export function createInterface(options: ReadLineOptions): ReadLine;
|
2075 |
|
2076 | export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void;
|
2077 | export function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: ReadLine): void;
|
2078 | export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
|
2079 | export function clearLine(stream: NodeJS.WritableStream, dir: number): void;
|
2080 | export function clearScreenDown(stream: NodeJS.WritableStream): void;
|
2081 | }
|
2082 |
|
2083 | declare module "vm" {
|
2084 | export interface Context { }
|
2085 | export interface ScriptOptions {
|
2086 | filename?: string;
|
2087 | lineOffset?: number;
|
2088 | columnOffset?: number;
|
2089 | displayErrors?: boolean;
|
2090 | timeout?: number;
|
2091 | cachedData?: Buffer;
|
2092 | produceCachedData?: boolean;
|
2093 | }
|
2094 | export interface RunningScriptOptions {
|
2095 | filename?: string;
|
2096 | lineOffset?: number;
|
2097 | columnOffset?: number;
|
2098 | displayErrors?: boolean;
|
2099 | timeout?: number;
|
2100 | }
|
2101 | export class Script {
|
2102 | constructor(code: string, options?: ScriptOptions);
|
2103 | runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
|
2104 | runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
|
2105 | runInThisContext(options?: RunningScriptOptions): any;
|
2106 | }
|
2107 | export function createContext(sandbox?: Context): Context;
|
2108 | export function isContext(sandbox: Context): boolean;
|
2109 | export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
|
2110 | /** @deprecated */
|
2111 | export function runInDebugContext(code: string): any;
|
2112 | export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
|
2113 | export function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
|
2114 | }
|
2115 |
|
2116 | declare module "child_process" {
|
2117 | import * as events from "events";
|
2118 | import * as stream from "stream";
|
2119 | import * as net from "net";
|
2120 |
|
2121 | export interface ChildProcess extends events.EventEmitter {
|
2122 | stdin: stream.Writable;
|
2123 | stdout: stream.Readable;
|
2124 | stderr: stream.Readable;
|
2125 | stdio: [stream.Writable, stream.Readable, stream.Readable];
|
2126 | killed: boolean;
|
2127 | pid: number;
|
2128 | kill(signal?: string): void;
|
2129 | send(message: any, callback?: (error: Error) => void): boolean;
|
2130 | send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean;
|
2131 | send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error) => void): boolean;
|
2132 | connected: boolean;
|
2133 | disconnect(): void;
|
2134 | unref(): void;
|
2135 | ref(): void;
|
2136 |
|
2137 | |
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 | addListener(event: string, listener: (...args: any[]) => void): this;
|
2147 | addListener(event: "close", listener: (code: number, signal: string) => void): this;
|
2148 | addListener(event: "disconnect", listener: () => void): this;
|
2149 | addListener(event: "error", listener: (err: Error) => void): this;
|
2150 | addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
2151 | addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
2152 |
|
2153 | emit(event: string | symbol, ...args: any[]): boolean;
|
2154 | emit(event: "close", code: number, signal: string): boolean;
|
2155 | emit(event: "disconnect"): boolean;
|
2156 | emit(event: "error", err: Error): boolean;
|
2157 | emit(event: "exit", code: number, signal: string): boolean;
|
2158 | emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean;
|
2159 |
|
2160 | on(event: string, listener: (...args: any[]) => void): this;
|
2161 | on(event: "close", listener: (code: number, signal: string) => void): this;
|
2162 | on(event: "disconnect", listener: () => void): this;
|
2163 | on(event: "error", listener: (err: Error) => void): this;
|
2164 | on(event: "exit", listener: (code: number, signal: string) => void): this;
|
2165 | on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
2166 |
|
2167 | once(event: string, listener: (...args: any[]) => void): this;
|
2168 | once(event: "close", listener: (code: number, signal: string) => void): this;
|
2169 | once(event: "disconnect", listener: () => void): this;
|
2170 | once(event: "error", listener: (err: Error) => void): this;
|
2171 | once(event: "exit", listener: (code: number, signal: string) => void): this;
|
2172 | once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
2173 |
|
2174 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
2175 | prependListener(event: "close", listener: (code: number, signal: string) => void): this;
|
2176 | prependListener(event: "disconnect", listener: () => void): this;
|
2177 | prependListener(event: "error", listener: (err: Error) => void): this;
|
2178 | prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
2179 | prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
2180 |
|
2181 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
2182 | prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this;
|
2183 | prependOnceListener(event: "disconnect", listener: () => void): this;
|
2184 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
2185 | prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
2186 | prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
2187 | }
|
2188 |
|
2189 | export interface MessageOptions {
|
2190 | keepOpen?: boolean;
|
2191 | }
|
2192 |
|
2193 | export interface SpawnOptions {
|
2194 | argv0?: string;
|
2195 | cwd?: string;
|
2196 | env?: any;
|
2197 | stdio?: any;
|
2198 | detached?: boolean;
|
2199 | uid?: number;
|
2200 | gid?: number;
|
2201 | shell?: boolean | string;
|
2202 | windowsVerbatimArguments?: boolean;
|
2203 | windowsHide?: boolean;
|
2204 | }
|
2205 |
|
2206 | export function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptions): ChildProcess;
|
2207 |
|
2208 | export interface ExecOptions {
|
2209 | cwd?: string;
|
2210 | env?: any;
|
2211 | shell?: string;
|
2212 | timeout?: number;
|
2213 | maxBuffer?: number;
|
2214 | killSignal?: string;
|
2215 | uid?: number;
|
2216 | gid?: number;
|
2217 | windowsHide?: boolean;
|
2218 | }
|
2219 |
|
2220 | export interface ExecOptionsWithStringEncoding extends ExecOptions {
|
2221 | encoding: BufferEncoding;
|
2222 | }
|
2223 |
|
2224 | export interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
2225 | encoding: string | null;
|
2226 | }
|
2227 |
|
2228 |
|
2229 | export function exec(command: string, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2230 |
|
2231 |
|
2232 | export function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
|
2233 |
|
2234 |
|
2235 | export function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2236 |
|
2237 |
|
2238 |
|
2239 | export function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
|
2240 |
|
2241 |
|
2242 | export function exec(command: string, options: ExecOptions, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2243 |
|
2244 |
|
2245 | export function exec(command: string, options: ({ encoding?: string | null } & ExecOptions) | undefined | null, callback?: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
|
2246 |
|
2247 |
|
2248 | export namespace exec {
|
2249 | export function __promisify__(command: string): Promise<{ stdout: string, stderr: string }>;
|
2250 | export function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<{ stdout: Buffer, stderr: Buffer }>;
|
2251 | export function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<{ stdout: string, stderr: string }>;
|
2252 | export function __promisify__(command: string, options: ExecOptions): Promise<{ stdout: string, stderr: string }>;
|
2253 | export function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
2254 | }
|
2255 |
|
2256 | export interface ExecFileOptions {
|
2257 | cwd?: string;
|
2258 | env?: any;
|
2259 | timeout?: number;
|
2260 | maxBuffer?: number;
|
2261 | killSignal?: string;
|
2262 | uid?: number;
|
2263 | gid?: number;
|
2264 | windowsHide?: boolean;
|
2265 | windowsVerbatimArguments?: boolean;
|
2266 | }
|
2267 | export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
2268 | encoding: BufferEncoding;
|
2269 | }
|
2270 | export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
2271 | encoding: 'buffer' | null;
|
2272 | }
|
2273 | export interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
|
2274 | encoding: string;
|
2275 | }
|
2276 |
|
2277 | export function execFile(file: string): ChildProcess;
|
2278 | export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
|
2279 | export function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
|
2280 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
|
2281 |
|
2282 |
|
2283 | export function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2284 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2285 |
|
2286 |
|
2287 | export function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
|
2288 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
|
2289 |
|
2290 |
|
2291 | export function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2292 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2293 |
|
2294 |
|
2295 |
|
2296 | export function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
|
2297 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
|
2298 |
|
2299 |
|
2300 | export function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2301 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
|
2302 |
|
2303 |
|
2304 | export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess;
|
2305 | export function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess;
|
2306 |
|
2307 |
|
2308 | export namespace execFile {
|
2309 | export function __promisify__(file: string): Promise<{ stdout: string, stderr: string }>;
|
2310 | export function __promisify__(file: string, args: string[] | undefined | null): Promise<{ stdout: string, stderr: string }>;
|
2311 | export function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
|
2312 | export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
|
2313 | export function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
|
2314 | export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
|
2315 | export function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
2316 | export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
2317 | export function __promisify__(file: string, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
|
2318 | export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
|
2319 | export function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
2320 | export function __promisify__(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
2321 | }
|
2322 |
|
2323 | export interface ForkOptions {
|
2324 | cwd?: string;
|
2325 | env?: any;
|
2326 | execPath?: string;
|
2327 | execArgv?: string[];
|
2328 | silent?: boolean;
|
2329 | stdio?: any[];
|
2330 | uid?: number;
|
2331 | gid?: number;
|
2332 | windowsVerbatimArguments?: boolean;
|
2333 | }
|
2334 | export function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
|
2335 |
|
2336 | export interface SpawnSyncOptions {
|
2337 | argv0?: string;
|
2338 | cwd?: string;
|
2339 | input?: string | Buffer;
|
2340 | stdio?: any;
|
2341 | env?: any;
|
2342 | uid?: number;
|
2343 | gid?: number;
|
2344 | timeout?: number;
|
2345 | killSignal?: string;
|
2346 | maxBuffer?: number;
|
2347 | encoding?: string;
|
2348 | shell?: boolean | string;
|
2349 | windowsHide?: boolean;
|
2350 | windowsVerbatimArguments?: boolean;
|
2351 | }
|
2352 | export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
2353 | encoding: BufferEncoding;
|
2354 | }
|
2355 | export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
2356 | encoding: string;
|
2357 | }
|
2358 | export interface SpawnSyncReturns<T> {
|
2359 | pid: number;
|
2360 | output: string[];
|
2361 | stdout: T;
|
2362 | stderr: T;
|
2363 | status: number;
|
2364 | signal: string;
|
2365 | error: Error;
|
2366 | }
|
2367 | export function spawnSync(command: string): SpawnSyncReturns<Buffer>;
|
2368 | export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
2369 | export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
2370 | export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
2371 | export function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
2372 | export function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
2373 | export function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
2374 |
|
2375 | export interface ExecSyncOptions {
|
2376 | cwd?: string;
|
2377 | input?: string | Buffer;
|
2378 | stdio?: any;
|
2379 | env?: any;
|
2380 | shell?: string;
|
2381 | uid?: number;
|
2382 | gid?: number;
|
2383 | timeout?: number;
|
2384 | killSignal?: string;
|
2385 | maxBuffer?: number;
|
2386 | encoding?: string;
|
2387 | windowsHide?: boolean;
|
2388 | }
|
2389 | export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
|
2390 | encoding: BufferEncoding;
|
2391 | }
|
2392 | export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
2393 | encoding: string;
|
2394 | }
|
2395 | export function execSync(command: string): Buffer;
|
2396 | export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
|
2397 | export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
|
2398 | export function execSync(command: string, options?: ExecSyncOptions): Buffer;
|
2399 |
|
2400 | export interface ExecFileSyncOptions {
|
2401 | cwd?: string;
|
2402 | input?: string | Buffer;
|
2403 | stdio?: any;
|
2404 | env?: any;
|
2405 | uid?: number;
|
2406 | gid?: number;
|
2407 | timeout?: number;
|
2408 | killSignal?: string;
|
2409 | maxBuffer?: number;
|
2410 | encoding?: string;
|
2411 | windowsHide?: boolean;
|
2412 | }
|
2413 | export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
|
2414 | encoding: BufferEncoding;
|
2415 | }
|
2416 | export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
2417 | encoding: string;
|
2418 | }
|
2419 | export function execFileSync(command: string): Buffer;
|
2420 | export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
2421 | export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
2422 | export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
|
2423 | export function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
2424 | export function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
2425 | export function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
|
2426 | }
|
2427 |
|
2428 | declare module "url" {
|
2429 | import { ParsedUrlQuery } from 'querystring';
|
2430 |
|
2431 | export interface UrlObjectCommon {
|
2432 | auth?: string;
|
2433 | hash?: string;
|
2434 | host?: string;
|
2435 | hostname?: string;
|
2436 | href?: string;
|
2437 | path?: string;
|
2438 | pathname?: string;
|
2439 | protocol?: string;
|
2440 | search?: string;
|
2441 | slashes?: boolean;
|
2442 | }
|
2443 |
|
2444 |
|
2445 | export interface UrlObject extends UrlObjectCommon {
|
2446 | port?: string | number;
|
2447 | query?: string | null | { [key: string]: any };
|
2448 | }
|
2449 |
|
2450 |
|
2451 | export interface Url extends UrlObjectCommon {
|
2452 | port?: string;
|
2453 | query?: string | null | ParsedUrlQuery;
|
2454 | }
|
2455 |
|
2456 | export interface UrlWithParsedQuery extends Url {
|
2457 | query: ParsedUrlQuery;
|
2458 | }
|
2459 |
|
2460 | export interface UrlWithStringQuery extends Url {
|
2461 | query: string | null;
|
2462 | }
|
2463 |
|
2464 | export function parse(urlStr: string): UrlWithStringQuery;
|
2465 | export function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
|
2466 | export function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
|
2467 | export function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
|
2468 |
|
2469 | export function format(URL: URL, options?: URLFormatOptions): string;
|
2470 | export function format(urlObject: UrlObject | string): string;
|
2471 | export function resolve(from: string, to: string): string;
|
2472 |
|
2473 | export function domainToASCII(domain: string): string;
|
2474 | export function domainToUnicode(domain: string): string;
|
2475 |
|
2476 | export interface URLFormatOptions {
|
2477 | auth?: boolean;
|
2478 | fragment?: boolean;
|
2479 | search?: boolean;
|
2480 | unicode?: boolean;
|
2481 | }
|
2482 |
|
2483 | export class URL {
|
2484 | constructor(input: string, base?: string | URL);
|
2485 | hash: string;
|
2486 | host: string;
|
2487 | hostname: string;
|
2488 | href: string;
|
2489 | readonly origin: string;
|
2490 | password: string;
|
2491 | pathname: string;
|
2492 | port: string;
|
2493 | protocol: string;
|
2494 | search: string;
|
2495 | readonly searchParams: URLSearchParams;
|
2496 | username: string;
|
2497 | toString(): string;
|
2498 | toJSON(): string;
|
2499 | }
|
2500 |
|
2501 | export class URLSearchParams implements Iterable<[string, string]> {
|
2502 | constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>);
|
2503 | append(name: string, value: string): void;
|
2504 | delete(name: string): void;
|
2505 | entries(): IterableIterator<[string, string]>;
|
2506 | forEach(callback: (value: string, name: string) => void): void;
|
2507 | get(name: string): string | null;
|
2508 | getAll(name: string): string[];
|
2509 | has(name: string): boolean;
|
2510 | keys(): IterableIterator<string>;
|
2511 | set(name: string, value: string): void;
|
2512 | sort(): void;
|
2513 | toString(): string;
|
2514 | values(): IterableIterator<string>;
|
2515 | [Symbol.iterator](): IterableIterator<[string, string]>;
|
2516 | }
|
2517 | }
|
2518 |
|
2519 | declare module "dns" {
|
2520 |
|
2521 | export const ADDRCONFIG: number;
|
2522 | export const V4MAPPED: number;
|
2523 |
|
2524 | export interface LookupOptions {
|
2525 | family?: number;
|
2526 | hints?: number;
|
2527 | all?: boolean;
|
2528 | }
|
2529 |
|
2530 | export interface LookupOneOptions extends LookupOptions {
|
2531 | all?: false;
|
2532 | }
|
2533 |
|
2534 | export interface LookupAllOptions extends LookupOptions {
|
2535 | all: true;
|
2536 | }
|
2537 |
|
2538 | export interface LookupAddress {
|
2539 | address: string;
|
2540 | family: number;
|
2541 | }
|
2542 |
|
2543 | export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
2544 | export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
2545 | export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void;
|
2546 | export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void;
|
2547 | export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void;
|
2548 |
|
2549 |
|
2550 | export namespace lookup {
|
2551 | export function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>;
|
2552 | export function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>;
|
2553 | export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
2554 | }
|
2555 |
|
2556 | export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException, hostname: string, service: string) => void): void;
|
2557 |
|
2558 | export namespace lookupService {
|
2559 | export function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
2560 | }
|
2561 |
|
2562 | export interface ResolveOptions {
|
2563 | ttl: boolean;
|
2564 | }
|
2565 |
|
2566 | export interface ResolveWithTtlOptions extends ResolveOptions {
|
2567 | ttl: true;
|
2568 | }
|
2569 |
|
2570 | export interface RecordWithTtl {
|
2571 | address: string;
|
2572 | ttl: number;
|
2573 | }
|
2574 |
|
2575 | export interface AnyRecordWithTtl extends RecordWithTtl {
|
2576 | type: "A" | "AAAA";
|
2577 | }
|
2578 |
|
2579 | export interface MxRecord {
|
2580 | priority: number;
|
2581 | exchange: string;
|
2582 | }
|
2583 |
|
2584 | export interface AnyMxRecord extends MxRecord {
|
2585 | type: "MX";
|
2586 | }
|
2587 |
|
2588 | export interface NaptrRecord {
|
2589 | flags: string;
|
2590 | service: string;
|
2591 | regexp: string;
|
2592 | replacement: string;
|
2593 | order: number;
|
2594 | preference: number;
|
2595 | }
|
2596 |
|
2597 | export interface AnyNaptrRecord extends NaptrRecord {
|
2598 | type: "NAPTR";
|
2599 | }
|
2600 |
|
2601 | export interface SoaRecord {
|
2602 | nsname: string;
|
2603 | hostmaster: string;
|
2604 | serial: number;
|
2605 | refresh: number;
|
2606 | retry: number;
|
2607 | expire: number;
|
2608 | minttl: number;
|
2609 | }
|
2610 |
|
2611 | export interface AnySoaRecord extends SoaRecord {
|
2612 | type: "SOA";
|
2613 | }
|
2614 |
|
2615 | export interface SrvRecord {
|
2616 | priority: number;
|
2617 | weight: number;
|
2618 | port: number;
|
2619 | name: string;
|
2620 | }
|
2621 |
|
2622 | export interface AnySrvRecord extends SrvRecord {
|
2623 | type: "SRV";
|
2624 | }
|
2625 |
|
2626 | export interface AnyTxtRecord {
|
2627 | type: "TXT";
|
2628 | entries: string[];
|
2629 | }
|
2630 |
|
2631 | export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2632 | export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2633 | export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2634 | export function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>) => void): void;
|
2635 | export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2636 | export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
|
2637 | export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
|
2638 | export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2639 | export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2640 | export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void;
|
2641 | export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void;
|
2642 | export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void;
|
2643 | export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void;
|
2644 |
|
2645 |
|
2646 | export namespace resolve {
|
2647 | export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
2648 | export function __promisify__(hostname: string, rrtype: "ANY"): Promise<ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>>;
|
2649 | export function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
2650 | export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
2651 | export function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
2652 | export function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
2653 | export function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
2654 | export function __promisify__(hostname: string, rrtype?: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]>;
|
2655 | }
|
2656 |
|
2657 | export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2658 | export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void;
|
2659 | export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void;
|
2660 |
|
2661 |
|
2662 | export namespace resolve4 {
|
2663 | export function __promisify__(hostname: string): Promise<string[]>;
|
2664 | export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
2665 | export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
2666 | }
|
2667 |
|
2668 | export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2669 | export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void;
|
2670 | export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void;
|
2671 |
|
2672 |
|
2673 | export namespace resolve6 {
|
2674 | export function __promisify__(hostname: string): Promise<string[]>;
|
2675 | export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
2676 | export function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
2677 | }
|
2678 |
|
2679 | export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: ReadonlyArray<AnySrvRecord | AnySoaRecord | AnyNaptrRecord | AnyRecordWithTtl | AnyMxRecord | AnyTxtRecord>) => void): void;
|
2680 | export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2681 | export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void;
|
2682 | export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void;
|
2683 | export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2684 | export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void;
|
2685 | export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void;
|
2686 | export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void;
|
2687 | export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void;
|
2688 |
|
2689 | export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void;
|
2690 | export function setServers(servers: string[]): void;
|
2691 |
|
2692 |
|
2693 | export var NODATA: string;
|
2694 | export var FORMERR: string;
|
2695 | export var SERVFAIL: string;
|
2696 | export var NOTFOUND: string;
|
2697 | export var NOTIMP: string;
|
2698 | export var REFUSED: string;
|
2699 | export var BADQUERY: string;
|
2700 | export var BADNAME: string;
|
2701 | export var BADFAMILY: string;
|
2702 | export var BADRESP: string;
|
2703 | export var CONNREFUSED: string;
|
2704 | export var TIMEOUT: string;
|
2705 | export var EOF: string;
|
2706 | export var FILE: string;
|
2707 | export var NOMEM: string;
|
2708 | export var DESTRUCTION: string;
|
2709 | export var BADSTR: string;
|
2710 | export var BADFLAGS: string;
|
2711 | export var NONAME: string;
|
2712 | export var BADHINTS: string;
|
2713 | export var NOTINITIALIZED: string;
|
2714 | export var LOADIPHLPAPI: string;
|
2715 | export var ADDRGETNETWORKPARAMS: string;
|
2716 | export var CANCELLED: string;
|
2717 | }
|
2718 |
|
2719 | declare module "net" {
|
2720 | import * as stream from "stream";
|
2721 | import * as events from "events";
|
2722 | import * as dns from "dns";
|
2723 |
|
2724 | type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
|
2725 |
|
2726 | export interface AddressInfo {
|
2727 | address: string;
|
2728 | family: string;
|
2729 | port: number;
|
2730 | }
|
2731 |
|
2732 | export interface SocketConstructorOpts {
|
2733 | fd?: number;
|
2734 | allowHalfOpen?: boolean;
|
2735 | readable?: boolean;
|
2736 | writable?: boolean;
|
2737 | }
|
2738 |
|
2739 | export interface TcpSocketConnectOpts {
|
2740 | port: number;
|
2741 | host?: string;
|
2742 | localAddress?: string;
|
2743 | localPort?: number;
|
2744 | hints?: number;
|
2745 | family?: number;
|
2746 | lookup?: LookupFunction;
|
2747 | }
|
2748 |
|
2749 | export interface IpcSocketConnectOpts {
|
2750 | path: string;
|
2751 | }
|
2752 |
|
2753 | export type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
|
2754 |
|
2755 | export class Socket extends stream.Duplex {
|
2756 | constructor(options?: SocketConstructorOpts);
|
2757 |
|
2758 | // Extended base methods
|
2759 | write(buffer: Buffer): boolean;
|
2760 | write(buffer: Buffer, cb?: Function): boolean;
|
2761 | write(str: string, cb?: Function): boolean;
|
2762 | write(str: string, encoding?: string, cb?: Function): boolean;
|
2763 | write(str: string, encoding?: string, fd?: string): boolean;
|
2764 | write(data: any, encoding?: string, callback?: Function): void;
|
2765 |
|
2766 | connect(options: SocketConnectOpts, connectionListener?: Function): this;
|
2767 | connect(port: number, host: string, connectionListener?: Function): this;
|
2768 | connect(port: number, connectionListener?: Function): this;
|
2769 | connect(path: string, connectionListener?: Function): this;
|
2770 |
|
2771 | bufferSize: number;
|
2772 | setEncoding(encoding?: string): this;
|
2773 | destroy(err?: any): void;
|
2774 | pause(): this;
|
2775 | resume(): this;
|
2776 | setTimeout(timeout: number, callback?: Function): this;
|
2777 | setNoDelay(noDelay?: boolean): this;
|
2778 | setKeepAlive(enable?: boolean, initialDelay?: number): this;
|
2779 | address(): AddressInfo | string;
|
2780 | unref(): void;
|
2781 | ref(): void;
|
2782 |
|
2783 | remoteAddress?: string;
|
2784 | remoteFamily?: string;
|
2785 | remotePort?: number;
|
2786 | localAddress: string;
|
2787 | localPort: number;
|
2788 | bytesRead: number;
|
2789 | bytesWritten: number;
|
2790 | connecting: boolean;
|
2791 | destroyed: boolean;
|
2792 |
|
2793 | // Extended base methods
|
2794 | end(): void;
|
2795 | end(buffer: Buffer, cb?: Function): void;
|
2796 | end(str: string, cb?: Function): void;
|
2797 | end(str: string, encoding?: string, cb?: Function): void;
|
2798 | end(data?: any, encoding?: string): void;
|
2799 |
|
2800 | /**
|
2801 | * events.EventEmitter
|
2802 | * 1. close
|
2803 | * 2. connect
|
2804 | * 3. data
|
2805 | * 4. drain
|
2806 | * 5. end
|
2807 | * 6. error
|
2808 | * 7. lookup
|
2809 | * 8. timeout
|
2810 | */
|
2811 | addListener(event: string, listener: (...args: any[]) => void): this;
|
2812 | addListener(event: "close", listener: (had_error: boolean) => void): this;
|
2813 | addListener(event: "connect", listener: () => void): this;
|
2814 | addListener(event: "data", listener: (data: Buffer) => void): this;
|
2815 | addListener(event: "drain", listener: () => void): this;
|
2816 | addListener(event: "end", listener: () => void): this;
|
2817 | addListener(event: "error", listener: (err: Error) => void): this;
|
2818 | addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
2819 | addListener(event: "timeout", listener: () => void): this;
|
2820 |
|
2821 | emit(event: string | symbol, ...args: any[]): boolean;
|
2822 | emit(event: "close", had_error: boolean): boolean;
|
2823 | emit(event: "connect"): boolean;
|
2824 | emit(event: "data", data: Buffer): boolean;
|
2825 | emit(event: "drain"): boolean;
|
2826 | emit(event: "end"): boolean;
|
2827 | emit(event: "error", err: Error): boolean;
|
2828 | emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
|
2829 | emit(event: "timeout"): boolean;
|
2830 |
|
2831 | on(event: string, listener: (...args: any[]) => void): this;
|
2832 | on(event: "close", listener: (had_error: boolean) => void): this;
|
2833 | on(event: "connect", listener: () => void): this;
|
2834 | on(event: "data", listener: (data: Buffer) => void): this;
|
2835 | on(event: "drain", listener: () => void): this;
|
2836 | on(event: "end", listener: () => void): this;
|
2837 | on(event: "error", listener: (err: Error) => void): this;
|
2838 | on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
2839 | on(event: "timeout", listener: () => void): this;
|
2840 |
|
2841 | once(event: string, listener: (...args: any[]) => void): this;
|
2842 | once(event: "close", listener: (had_error: boolean) => void): this;
|
2843 | once(event: "connect", listener: () => void): this;
|
2844 | once(event: "data", listener: (data: Buffer) => void): this;
|
2845 | once(event: "drain", listener: () => void): this;
|
2846 | once(event: "end", listener: () => void): this;
|
2847 | once(event: "error", listener: (err: Error) => void): this;
|
2848 | once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
2849 | once(event: "timeout", listener: () => void): this;
|
2850 |
|
2851 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
2852 | prependListener(event: "close", listener: (had_error: boolean) => void): this;
|
2853 | prependListener(event: "connect", listener: () => void): this;
|
2854 | prependListener(event: "data", listener: (data: Buffer) => void): this;
|
2855 | prependListener(event: "drain", listener: () => void): this;
|
2856 | prependListener(event: "end", listener: () => void): this;
|
2857 | prependListener(event: "error", listener: (err: Error) => void): this;
|
2858 | prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
2859 | prependListener(event: "timeout", listener: () => void): this;
|
2860 |
|
2861 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
2862 | prependOnceListener(event: "close", listener: (had_error: boolean) => void): this;
|
2863 | prependOnceListener(event: "connect", listener: () => void): this;
|
2864 | prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
|
2865 | prependOnceListener(event: "drain", listener: () => void): this;
|
2866 | prependOnceListener(event: "end", listener: () => void): this;
|
2867 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
2868 | prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
|
2869 | prependOnceListener(event: "timeout", listener: () => void): this;
|
2870 | }
|
2871 |
|
2872 | export interface ListenOptions {
|
2873 | port?: number;
|
2874 | host?: string;
|
2875 | backlog?: number;
|
2876 | path?: string;
|
2877 | exclusive?: boolean;
|
2878 | readableAll?: boolean;
|
2879 | writableAll?: boolean;
|
2880 | }
|
2881 |
|
2882 |
|
2883 | export class Server extends events.EventEmitter {
|
2884 | constructor(connectionListener?: (socket: Socket) => void);
|
2885 | constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
|
2886 |
|
2887 | listen(port?: number, hostname?: string, backlog?: number, listeningListener?: Function): this;
|
2888 | listen(port?: number, hostname?: string, listeningListener?: Function): this;
|
2889 | listen(port?: number, backlog?: number, listeningListener?: Function): this;
|
2890 | listen(port?: number, listeningListener?: Function): this;
|
2891 | listen(path: string, backlog?: number, listeningListener?: Function): this;
|
2892 | listen(path: string, listeningListener?: Function): this;
|
2893 | listen(options: ListenOptions, listeningListener?: Function): this;
|
2894 | listen(handle: any, backlog?: number, listeningListener?: Function): this;
|
2895 | listen(handle: any, listeningListener?: Function): this;
|
2896 | close(callback?: Function): this;
|
2897 | address(): AddressInfo | string;
|
2898 | getConnections(cb: (error: Error | null, count: number) => void): void;
|
2899 | ref(): this;
|
2900 | unref(): this;
|
2901 | maxConnections: number;
|
2902 | connections: number;
|
2903 | listening: boolean;
|
2904 |
|
2905 | /**
|
2906 | * events.EventEmitter
|
2907 | * 1. close
|
2908 | * 2. connection
|
2909 | * 3. error
|
2910 | * 4. listening
|
2911 | */
|
2912 | addListener(event: string, listener: (...args: any[]) => void): this;
|
2913 | addListener(event: "close", listener: () => void): this;
|
2914 | addListener(event: "connection", listener: (socket: Socket) => void): this;
|
2915 | addListener(event: "error", listener: (err: Error) => void): this;
|
2916 | addListener(event: "listening", listener: () => void): this;
|
2917 |
|
2918 | emit(event: string | symbol, ...args: any[]): boolean;
|
2919 | emit(event: "close"): boolean;
|
2920 | emit(event: "connection", socket: Socket): boolean;
|
2921 | emit(event: "error", err: Error): boolean;
|
2922 | emit(event: "listening"): boolean;
|
2923 |
|
2924 | on(event: string, listener: (...args: any[]) => void): this;
|
2925 | on(event: "close", listener: () => void): this;
|
2926 | on(event: "connection", listener: (socket: Socket) => void): this;
|
2927 | on(event: "error", listener: (err: Error) => void): this;
|
2928 | on(event: "listening", listener: () => void): this;
|
2929 |
|
2930 | once(event: string, listener: (...args: any[]) => void): this;
|
2931 | once(event: "close", listener: () => void): this;
|
2932 | once(event: "connection", listener: (socket: Socket) => void): this;
|
2933 | once(event: "error", listener: (err: Error) => void): this;
|
2934 | once(event: "listening", listener: () => void): this;
|
2935 |
|
2936 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
2937 | prependListener(event: "close", listener: () => void): this;
|
2938 | prependListener(event: "connection", listener: (socket: Socket) => void): this;
|
2939 | prependListener(event: "error", listener: (err: Error) => void): this;
|
2940 | prependListener(event: "listening", listener: () => void): this;
|
2941 |
|
2942 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
2943 | prependOnceListener(event: "close", listener: () => void): this;
|
2944 | prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
|
2945 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
2946 | prependOnceListener(event: "listening", listener: () => void): this;
|
2947 | }
|
2948 |
|
2949 | export interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
|
2950 | timeout?: number;
|
2951 | }
|
2952 |
|
2953 | export interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
|
2954 | timeout?: number;
|
2955 | }
|
2956 |
|
2957 | export type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
|
2958 |
|
2959 | export function createServer(connectionListener?: (socket: Socket) => void): Server;
|
2960 | export function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
|
2961 | export function connect(options: NetConnectOpts, connectionListener?: Function): Socket;
|
2962 | export function connect(port: number, host?: string, connectionListener?: Function): Socket;
|
2963 | export function connect(path: string, connectionListener?: Function): Socket;
|
2964 | export function createConnection(options: NetConnectOpts, connectionListener?: Function): Socket;
|
2965 | export function createConnection(port: number, host?: string, connectionListener?: Function): Socket;
|
2966 | export function createConnection(path: string, connectionListener?: Function): Socket;
|
2967 | export function isIP(input: string): number;
|
2968 | export function isIPv4(input: string): boolean;
|
2969 | export function isIPv6(input: string): boolean;
|
2970 | }
|
2971 |
|
2972 | declare module "dgram" {
|
2973 | import { AddressInfo } from "net";
|
2974 | import * as dns from "dns";
|
2975 | import * as events from "events";
|
2976 |
|
2977 | export interface RemoteInfo {
|
2978 | address: string;
|
2979 | family: string;
|
2980 | port: number;
|
2981 | }
|
2982 |
|
2983 | export interface BindOptions {
|
2984 | port: number;
|
2985 | address?: string;
|
2986 | exclusive?: boolean;
|
2987 | }
|
2988 |
|
2989 | type SocketType = "udp4" | "udp6";
|
2990 |
|
2991 | export interface SocketOptions {
|
2992 | type: SocketType;
|
2993 | reuseAddr?: boolean;
|
2994 | recvBufferSize?: number;
|
2995 | sendBufferSize?: number;
|
2996 | lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void;
|
2997 | }
|
2998 |
|
2999 | export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
3000 | export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
3001 |
|
3002 | export class Socket extends events.EventEmitter {
|
3003 | send(msg: Buffer | string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
3004 | send(msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
3005 | bind(port?: number, address?: string, callback?: () => void): void;
|
3006 | bind(port?: number, callback?: () => void): void;
|
3007 | bind(callback?: () => void): void;
|
3008 | bind(options: BindOptions, callback?: Function): void;
|
3009 | close(callback?: () => void): void;
|
3010 | address(): AddressInfo | string;
|
3011 | setBroadcast(flag: boolean): void;
|
3012 | setTTL(ttl: number): void;
|
3013 | setMulticastTTL(ttl: number): void;
|
3014 | setMulticastInterface(multicastInterface: string): void;
|
3015 | setMulticastLoopback(flag: boolean): void;
|
3016 | addMembership(multicastAddress: string, multicastInterface?: string): void;
|
3017 | dropMembership(multicastAddress: string, multicastInterface?: string): void;
|
3018 | ref(): this;
|
3019 | unref(): this;
|
3020 | setRecvBufferSize(size: number): void;
|
3021 | setSendBufferSize(size: number): void;
|
3022 | getRecvBufferSize(): number;
|
3023 | getSendBufferSize(): number;
|
3024 |
|
3025 | |
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 | addListener(event: string, listener: (...args: any[]) => void): this;
|
3033 | addListener(event: "close", listener: () => void): this;
|
3034 | addListener(event: "error", listener: (err: Error) => void): this;
|
3035 | addListener(event: "listening", listener: () => void): this;
|
3036 | addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
3037 |
|
3038 | emit(event: string | symbol, ...args: any[]): boolean;
|
3039 | emit(event: "close"): boolean;
|
3040 | emit(event: "error", err: Error): boolean;
|
3041 | emit(event: "listening"): boolean;
|
3042 | emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean;
|
3043 |
|
3044 | on(event: string, listener: (...args: any[]) => void): this;
|
3045 | on(event: "close", listener: () => void): this;
|
3046 | on(event: "error", listener: (err: Error) => void): this;
|
3047 | on(event: "listening", listener: () => void): this;
|
3048 | on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
3049 |
|
3050 | once(event: string, listener: (...args: any[]) => void): this;
|
3051 | once(event: "close", listener: () => void): this;
|
3052 | once(event: "error", listener: (err: Error) => void): this;
|
3053 | once(event: "listening", listener: () => void): this;
|
3054 | once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
3055 |
|
3056 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
3057 | prependListener(event: "close", listener: () => void): this;
|
3058 | prependListener(event: "error", listener: (err: Error) => void): this;
|
3059 | prependListener(event: "listening", listener: () => void): this;
|
3060 | prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
3061 |
|
3062 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
3063 | prependOnceListener(event: "close", listener: () => void): this;
|
3064 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
3065 | prependOnceListener(event: "listening", listener: () => void): this;
|
3066 | prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
3067 | }
|
3068 | }
|
3069 |
|
3070 | declare module "fs" {
|
3071 | import * as stream from "stream";
|
3072 | import * as events from "events";
|
3073 | import { URL } from "url";
|
3074 |
|
3075 | |
3076 |
|
3077 |
|
3078 | export type PathLike = string | Buffer | URL;
|
3079 |
|
3080 | export class Stats {
|
3081 | isFile(): boolean;
|
3082 | isDirectory(): boolean;
|
3083 | isBlockDevice(): boolean;
|
3084 | isCharacterDevice(): boolean;
|
3085 | isSymbolicLink(): boolean;
|
3086 | isFIFO(): boolean;
|
3087 | isSocket(): boolean;
|
3088 | dev: number;
|
3089 | ino: number;
|
3090 | mode: number;
|
3091 | nlink: number;
|
3092 | uid: number;
|
3093 | gid: number;
|
3094 | rdev: number;
|
3095 | size: number;
|
3096 | blksize: number;
|
3097 | blocks: number;
|
3098 | atimeMs: number;
|
3099 | mtimeMs: number;
|
3100 | ctimeMs: number;
|
3101 | birthtimeMs: number;
|
3102 | atime: Date;
|
3103 | mtime: Date;
|
3104 | ctime: Date;
|
3105 | birthtime: Date;
|
3106 | }
|
3107 |
|
3108 | export interface FSWatcher extends events.EventEmitter {
|
3109 | close(): void;
|
3110 |
|
3111 | |
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 | addListener(event: string, listener: (...args: any[]) => void): this;
|
3117 | addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
|
3118 | addListener(event: "error", listener: (error: Error) => void): this;
|
3119 |
|
3120 | on(event: string, listener: (...args: any[]) => void): this;
|
3121 | on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
|
3122 | on(event: "error", listener: (error: Error) => void): this;
|
3123 |
|
3124 | once(event: string, listener: (...args: any[]) => void): this;
|
3125 | once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
|
3126 | once(event: "error", listener: (error: Error) => void): this;
|
3127 |
|
3128 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
3129 | prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
|
3130 | prependListener(event: "error", listener: (error: Error) => void): this;
|
3131 |
|
3132 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
3133 | prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
|
3134 | prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
3135 | }
|
3136 |
|
3137 | export class ReadStream extends stream.Readable {
|
3138 | close(): void;
|
3139 | destroy(): void;
|
3140 | bytesRead: number;
|
3141 | path: string | Buffer;
|
3142 |
|
3143 | |
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 | addListener(event: string, listener: (...args: any[]) => void): this;
|
3149 | addListener(event: "open", listener: (fd: number) => void): this;
|
3150 | addListener(event: "close", listener: () => void): this;
|
3151 |
|
3152 | on(event: string, listener: (...args: any[]) => void): this;
|
3153 | on(event: "open", listener: (fd: number) => void): this;
|
3154 | on(event: "close", listener: () => void): this;
|
3155 |
|
3156 | once(event: string, listener: (...args: any[]) => void): this;
|
3157 | once(event: "open", listener: (fd: number) => void): this;
|
3158 | once(event: "close", listener: () => void): this;
|
3159 |
|
3160 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
3161 | prependListener(event: "open", listener: (fd: number) => void): this;
|
3162 | prependListener(event: "close", listener: () => void): this;
|
3163 |
|
3164 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
3165 | prependOnceListener(event: "open", listener: (fd: number) => void): this;
|
3166 | prependOnceListener(event: "close", listener: () => void): this;
|
3167 | }
|
3168 |
|
3169 | export class WriteStream extends stream.Writable {
|
3170 | close(): void;
|
3171 | bytesWritten: number;
|
3172 | path: string | Buffer;
|
3173 |
|
3174 | |
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 | addListener(event: string, listener: (...args: any[]) => void): this;
|
3180 | addListener(event: "open", listener: (fd: number) => void): this;
|
3181 | addListener(event: "close", listener: () => void): this;
|
3182 |
|
3183 | on(event: string, listener: (...args: any[]) => void): this;
|
3184 | on(event: "open", listener: (fd: number) => void): this;
|
3185 | on(event: "close", listener: () => void): this;
|
3186 |
|
3187 | once(event: string, listener: (...args: any[]) => void): this;
|
3188 | once(event: "open", listener: (fd: number) => void): this;
|
3189 | once(event: "close", listener: () => void): this;
|
3190 |
|
3191 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
3192 | prependListener(event: "open", listener: (fd: number) => void): this;
|
3193 | prependListener(event: "close", listener: () => void): this;
|
3194 |
|
3195 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
3196 | prependOnceListener(event: "open", listener: (fd: number) => void): this;
|
3197 | prependOnceListener(event: "close", listener: () => void): this;
|
3198 | }
|
3199 |
|
3200 | |
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 | export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3208 |
|
3209 |
|
3210 | export namespace rename {
|
3211 | |
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 | export function __promisify__(oldPath: PathLike, newPath: PathLike): Promise<void>;
|
3219 | }
|
3220 |
|
3221 | |
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 | export function renameSync(oldPath: PathLike, newPath: PathLike): void;
|
3229 |
|
3230 | |
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 | export function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
3236 |
|
3237 | |
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 | export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3243 |
|
3244 |
|
3245 | export namespace truncate {
|
3246 | |
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 | export function __promisify__(path: PathLike, len?: number | null): Promise<void>;
|
3252 | }
|
3253 |
|
3254 | |
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 | export function truncateSync(path: PathLike, len?: number | null): void;
|
3260 |
|
3261 | |
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 | export function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
3267 |
|
3268 | |
3269 |
|
3270 |
|
3271 |
|
3272 | export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3273 |
|
3274 |
|
3275 | export namespace ftruncate {
|
3276 | |
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 | export function __promisify__(fd: number, len?: number | null): Promise<void>;
|
3282 | }
|
3283 |
|
3284 | |
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 | export function ftruncateSync(fd: number, len?: number | null): void;
|
3290 |
|
3291 | |
3292 |
|
3293 |
|
3294 |
|
3295 | export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3296 |
|
3297 |
|
3298 | export namespace chown {
|
3299 | |
3300 |
|
3301 |
|
3302 |
|
3303 | export function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
|
3304 | }
|
3305 |
|
3306 | |
3307 |
|
3308 |
|
3309 |
|
3310 | export function chownSync(path: PathLike, uid: number, gid: number): void;
|
3311 |
|
3312 | |
3313 |
|
3314 |
|
3315 |
|
3316 | export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3317 |
|
3318 |
|
3319 | export namespace fchown {
|
3320 | |
3321 |
|
3322 |
|
3323 |
|
3324 | export function __promisify__(fd: number, uid: number, gid: number): Promise<void>;
|
3325 | }
|
3326 |
|
3327 | |
3328 |
|
3329 |
|
3330 |
|
3331 | export function fchownSync(fd: number, uid: number, gid: number): void;
|
3332 |
|
3333 | |
3334 |
|
3335 |
|
3336 |
|
3337 | export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3338 |
|
3339 |
|
3340 | export namespace lchown {
|
3341 | |
3342 |
|
3343 |
|
3344 |
|
3345 | export function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
|
3346 | }
|
3347 |
|
3348 | |
3349 |
|
3350 |
|
3351 |
|
3352 | export function lchownSync(path: PathLike, uid: number, gid: number): void;
|
3353 |
|
3354 | |
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 | export function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3360 |
|
3361 |
|
3362 | export namespace chmod {
|
3363 | |
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 | export function __promisify__(path: PathLike, mode: string | number): Promise<void>;
|
3369 | }
|
3370 |
|
3371 | |
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 | export function chmodSync(path: PathLike, mode: string | number): void;
|
3377 |
|
3378 | |
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 | export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3384 |
|
3385 |
|
3386 | export namespace fchmod {
|
3387 | |
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 | export function __promisify__(fd: number, mode: string | number): Promise<void>;
|
3393 | }
|
3394 |
|
3395 | |
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 | export function fchmodSync(fd: number, mode: string | number): void;
|
3401 |
|
3402 | |
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 | export function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3408 |
|
3409 |
|
3410 | export namespace lchmod {
|
3411 | |
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 | export function __promisify__(path: PathLike, mode: string | number): Promise<void>;
|
3417 | }
|
3418 |
|
3419 | |
3420 |
|
3421 |
|
3422 |
|
3423 |
|
3424 | export function lchmodSync(path: PathLike, mode: string | number): void;
|
3425 |
|
3426 | |
3427 |
|
3428 |
|
3429 |
|
3430 | export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void;
|
3431 |
|
3432 |
|
3433 | export namespace stat {
|
3434 | |
3435 |
|
3436 |
|
3437 |
|
3438 | export function __promisify__(path: PathLike): Promise<Stats>;
|
3439 | }
|
3440 |
|
3441 | |
3442 |
|
3443 |
|
3444 |
|
3445 | export function statSync(path: PathLike): Stats;
|
3446 |
|
3447 | |
3448 |
|
3449 |
|
3450 |
|
3451 | export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void;
|
3452 |
|
3453 |
|
3454 | export namespace fstat {
|
3455 | |
3456 |
|
3457 |
|
3458 |
|
3459 | export function __promisify__(fd: number): Promise<Stats>;
|
3460 | }
|
3461 |
|
3462 | |
3463 |
|
3464 |
|
3465 |
|
3466 | export function fstatSync(fd: number): Stats;
|
3467 |
|
3468 | |
3469 |
|
3470 |
|
3471 |
|
3472 | export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void;
|
3473 |
|
3474 |
|
3475 | export namespace lstat {
|
3476 | |
3477 |
|
3478 |
|
3479 |
|
3480 | export function __promisify__(path: PathLike): Promise<Stats>;
|
3481 | }
|
3482 |
|
3483 | |
3484 |
|
3485 |
|
3486 |
|
3487 | export function lstatSync(path: PathLike): Stats;
|
3488 |
|
3489 | |
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 | export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3495 |
|
3496 |
|
3497 | export namespace link {
|
3498 | |
3499 |
|
3500 |
|
3501 |
|
3502 |
|
3503 | export function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
3504 | }
|
3505 |
|
3506 | |
3507 |
|
3508 |
|
3509 |
|
3510 |
|
3511 | export function linkSync(existingPath: PathLike, newPath: PathLike): void;
|
3512 |
|
3513 | |
3514 |
|
3515 |
|
3516 |
|
3517 |
|
3518 |
|
3519 |
|
3520 | export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
3521 |
|
3522 | |
3523 |
|
3524 |
|
3525 |
|
3526 |
|
3527 | export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3528 |
|
3529 |
|
3530 | export namespace symlink {
|
3531 | |
3532 |
|
3533 |
|
3534 |
|
3535 |
|
3536 |
|
3537 |
|
3538 | export function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
3539 |
|
3540 | export type Type = "dir" | "file" | "junction";
|
3541 | }
|
3542 |
|
3543 | |
3544 |
|
3545 |
|
3546 |
|
3547 |
|
3548 |
|
3549 |
|
3550 | export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
|
3551 |
|
3552 | |
3553 |
|
3554 |
|
3555 |
|
3556 |
|
3557 | export function readlink(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void;
|
3558 |
|
3559 | |
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 | export function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, linkString: Buffer) => void): void;
|
3565 |
|
3566 | |
3567 |
|
3568 |
|
3569 |
|
3570 |
|
3571 | export function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string | Buffer) => void): void;
|
3572 |
|
3573 | |
3574 |
|
3575 |
|
3576 |
|
3577 | export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void;
|
3578 |
|
3579 |
|
3580 | export namespace readlink {
|
3581 | |
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 | export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
|
3587 |
|
3588 | |
3589 |
|
3590 |
|
3591 |
|
3592 |
|
3593 | export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
|
3594 |
|
3595 | |
3596 |
|
3597 |
|
3598 |
|
3599 |
|
3600 | export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
|
3601 | }
|
3602 |
|
3603 | |
3604 |
|
3605 |
|
3606 |
|
3607 |
|
3608 | export function readlinkSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
|
3609 |
|
3610 | |
3611 |
|
3612 |
|
3613 |
|
3614 |
|
3615 | export function readlinkSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
|
3616 |
|
3617 | |
3618 |
|
3619 |
|
3620 |
|
3621 |
|
3622 | export function readlinkSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
|
3623 |
|
3624 | |
3625 |
|
3626 |
|
3627 |
|
3628 |
|
3629 | export function realpath(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
|
3630 |
|
3631 | |
3632 |
|
3633 |
|
3634 |
|
3635 |
|
3636 | export function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void;
|
3637 |
|
3638 | |
3639 |
|
3640 |
|
3641 |
|
3642 |
|
3643 | export function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void;
|
3644 |
|
3645 | |
3646 |
|
3647 |
|
3648 |
|
3649 | export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
|
3650 |
|
3651 |
|
3652 | export namespace realpath {
|
3653 | |
3654 |
|
3655 |
|
3656 |
|
3657 |
|
3658 | export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
|
3659 |
|
3660 | |
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 | export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
|
3666 |
|
3667 | |
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 | export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
|
3673 |
|
3674 | export function native(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
|
3675 | export function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void;
|
3676 | export function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void;
|
3677 | export function native(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void;
|
3678 | }
|
3679 |
|
3680 | |
3681 |
|
3682 |
|
3683 |
|
3684 |
|
3685 | export function realpathSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
|
3686 |
|
3687 | |
3688 |
|
3689 |
|
3690 |
|
3691 |
|
3692 | export function realpathSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
|
3693 |
|
3694 | |
3695 |
|
3696 |
|
3697 |
|
3698 |
|
3699 | export function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
|
3700 |
|
3701 | export namespace realpathSync {
|
3702 | export function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
|
3703 | export function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
|
3704 | export function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
|
3705 | }
|
3706 |
|
3707 | |
3708 |
|
3709 |
|
3710 |
|
3711 | export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3712 |
|
3713 |
|
3714 | export namespace unlink {
|
3715 | |
3716 |
|
3717 |
|
3718 |
|
3719 | export function __promisify__(path: PathLike): Promise<void>;
|
3720 | }
|
3721 |
|
3722 | |
3723 |
|
3724 |
|
3725 |
|
3726 | export function unlinkSync(path: PathLike): void;
|
3727 |
|
3728 | |
3729 |
|
3730 |
|
3731 |
|
3732 | export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3733 |
|
3734 |
|
3735 | export namespace rmdir {
|
3736 | |
3737 |
|
3738 |
|
3739 |
|
3740 | export function __promisify__(path: PathLike): Promise<void>;
|
3741 | }
|
3742 |
|
3743 | |
3744 |
|
3745 |
|
3746 |
|
3747 | export function rmdirSync(path: PathLike): void;
|
3748 |
|
3749 | |
3750 |
|
3751 |
|
3752 |
|
3753 |
|
3754 | export function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
3755 |
|
3756 | |
3757 |
|
3758 |
|
3759 |
|
3760 | export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
3761 |
|
3762 |
|
3763 | export namespace mkdir {
|
3764 | |
3765 |
|
3766 |
|
3767 |
|
3768 |
|
3769 | export function __promisify__(path: PathLike, mode?: number | string | null): Promise<void>;
|
3770 | }
|
3771 |
|
3772 | |
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 | export function mkdirSync(path: PathLike, mode?: number | string | null): void;
|
3778 |
|
3779 | |
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 | export function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
|
3785 |
|
3786 | |
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 | export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException, folder: Buffer) => void): void;
|
3792 |
|
3793 | |
3794 |
|
3795 |
|
3796 |
|
3797 |
|
3798 | export function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string | Buffer) => void): void;
|
3799 |
|
3800 | |
3801 |
|
3802 |
|
3803 |
|
3804 | export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
|
3805 |
|
3806 |
|
3807 | export namespace mkdtemp {
|
3808 | |
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 | export function __promisify__(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
|
3814 |
|
3815 | |
3816 |
|
3817 |
|
3818 |
|
3819 |
|
3820 | export function __promisify__(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
|
3821 |
|
3822 | |
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 | export function __promisify__(prefix: string, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
|
3828 | }
|
3829 |
|
3830 | |
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 | export function mkdtempSync(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
|
3836 |
|
3837 | |
3838 |
|
3839 |
|
3840 |
|
3841 |
|
3842 | export function mkdtempSync(prefix: string, options: { encoding: "buffer" } | "buffer"): Buffer;
|
3843 |
|
3844 | |
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 | export function mkdtempSync(prefix: string, options?: { encoding?: string | null } | string | null): string | Buffer;
|
3850 |
|
3851 | |
3852 |
|
3853 |
|
3854 |
|
3855 |
|
3856 | export function readdir(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
|
3857 |
|
3858 | |
3859 |
|
3860 |
|
3861 |
|
3862 |
|
3863 | export function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void;
|
3864 |
|
3865 | |
3866 |
|
3867 |
|
3868 |
|
3869 |
|
3870 | export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void;
|
3871 |
|
3872 | |
3873 |
|
3874 |
|
3875 |
|
3876 | export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
|
3877 |
|
3878 |
|
3879 | export namespace readdir {
|
3880 | |
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 | export function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): Promise<string[]>;
|
3886 |
|
3887 | |
3888 |
|
3889 |
|
3890 |
|
3891 |
|
3892 | export function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer" }): Promise<Buffer[]>;
|
3893 |
|
3894 | |
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 | export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string[] | Buffer[]>;
|
3900 | }
|
3901 |
|
3902 | |
3903 |
|
3904 |
|
3905 |
|
3906 |
|
3907 | export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): string[];
|
3908 |
|
3909 | |
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 | export function readdirSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer[];
|
3915 |
|
3916 | |
3917 |
|
3918 |
|
3919 |
|
3920 |
|
3921 | export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[];
|
3922 |
|
3923 | |
3924 |
|
3925 |
|
3926 |
|
3927 | export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
3928 |
|
3929 |
|
3930 | export namespace close {
|
3931 | |
3932 |
|
3933 |
|
3934 |
|
3935 | export function __promisify__(fd: number): Promise<void>;
|
3936 | }
|
3937 |
|
3938 | |
3939 |
|
3940 |
|
3941 |
|
3942 | export function closeSync(fd: number): void;
|
3943 |
|
3944 | |
3945 |
|
3946 |
|
3947 |
|
3948 |
|
3949 | export function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
|
3950 |
|
3951 | |
3952 |
|
3953 |
|
3954 |
|
3955 | export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
|
3956 |
|
3957 |
|
3958 | export namespace open {
|
3959 | |
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 | export function __promisify__(path: PathLike, flags: string | number, mode?: string | number | null): Promise<number>;
|
3965 | }
|
3966 |
|
3967 | |
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 | export function openSync(path: PathLike, flags: string | number, mode?: string | number | null): number;
|
3973 |
|
3974 | |
3975 |
|
3976 |
|
3977 |
|
3978 |
|
3979 |
|
3980 | export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void;
|
3981 |
|
3982 |
|
3983 | export namespace utimes {
|
3984 | |
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 | export function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
3991 | }
|
3992 |
|
3993 | |
3994 |
|
3995 |
|
3996 |
|
3997 |
|
3998 |
|
3999 | export function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void;
|
4000 |
|
4001 | |
4002 |
|
4003 |
|
4004 |
|
4005 |
|
4006 |
|
4007 | export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void;
|
4008 |
|
4009 |
|
4010 | export namespace futimes {
|
4011 | |
4012 |
|
4013 |
|
4014 |
|
4015 |
|
4016 |
|
4017 | export function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
4018 | }
|
4019 |
|
4020 | |
4021 |
|
4022 |
|
4023 |
|
4024 |
|
4025 |
|
4026 | export function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void;
|
4027 |
|
4028 | |
4029 |
|
4030 |
|
4031 |
|
4032 | export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
4033 |
|
4034 |
|
4035 | export namespace fsync {
|
4036 | |
4037 |
|
4038 |
|
4039 |
|
4040 | export function __promisify__(fd: number): Promise<void>;
|
4041 | }
|
4042 |
|
4043 | |
4044 |
|
4045 |
|
4046 |
|
4047 | export function fsyncSync(fd: number): void;
|
4048 |
|
4049 | |
4050 |
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 | export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
|
4057 |
|
4058 | |
4059 |
|
4060 |
|
4061 |
|
4062 |
|
4063 |
|
4064 | export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
|
4065 |
|
4066 | |
4067 |
|
4068 |
|
4069 |
|
4070 |
|
4071 | export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
|
4072 |
|
4073 | |
4074 |
|
4075 |
|
4076 |
|
4077 | export function write<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void;
|
4078 |
|
4079 | |
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 |
|
4085 |
|
4086 | export function write(fd: number, string: any, position: number | undefined | null, encoding: string | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
4087 |
|
4088 | |
4089 |
|
4090 |
|
4091 |
|
4092 |
|
4093 |
|
4094 | export function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
4095 |
|
4096 | |
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 | export function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
4102 |
|
4103 |
|
4104 | export namespace write {
|
4105 | |
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 | export function __promisify__<TBuffer extends Buffer | Uint8Array>(fd: number, buffer?: TBuffer, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
|
4113 |
|
4114 | |
4115 |
|
4116 |
|
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 | export function __promisify__(fd: number, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>;
|
4122 | }
|
4123 |
|
4124 | |
4125 |
|
4126 |
|
4127 |
|
4128 |
|
4129 |
|
4130 |
|
4131 | export function writeSync(fd: number, buffer: Buffer | Uint8Array, offset?: number | null, length?: number | null, position?: number | null): number;
|
4132 |
|
4133 | |
4134 |
|
4135 |
|
4136 |
|
4137 |
|
4138 |
|
4139 |
|
4140 | export function writeSync(fd: number, string: any, position?: number | null, encoding?: string | null): number;
|
4141 |
|
4142 | |
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 | export function read<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void;
|
4151 |
|
4152 |
|
4153 | export namespace read {
|
4154 | |
4155 |
|
4156 |
|
4157 |
|
4158 |
|
4159 |
|
4160 |
|
4161 | export function __promisify__<TBuffer extends Buffer | Uint8Array>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
|
4162 | }
|
4163 |
|
4164 | |
4165 |
|
4166 |
|
4167 |
|
4168 |
|
4169 |
|
4170 |
|
4171 |
|
4172 | export function readSync(fd: number, buffer: Buffer | Uint8Array, offset: number, length: number, position: number | null): number;
|
4173 |
|
4174 | |
4175 |
|
4176 |
|
4177 |
|
4178 |
|
4179 |
|
4180 |
|
4181 | export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
|
4182 |
|
4183 | |
4184 |
|
4185 |
|
4186 |
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 | export function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
|
4192 |
|
4193 | |
4194 |
|
4195 |
|
4196 |
|
4197 |
|
4198 |
|
4199 |
|
4200 |
|
4201 | export function readFile(path: PathLike | number, options: { encoding?: string | null; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void;
|
4202 |
|
4203 | |
4204 |
|
4205 |
|
4206 |
|
4207 |
|
4208 | export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
|
4209 |
|
4210 |
|
4211 | export namespace readFile {
|
4212 | |
4213 |
|
4214 |
|
4215 |
|
4216 |
|
4217 |
|
4218 |
|
4219 | export function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise<Buffer>;
|
4220 |
|
4221 | |
4222 |
|
4223 |
|
4224 |
|
4225 |
|
4226 |
|
4227 |
|
4228 |
|
4229 | export function __promisify__(path: PathLike | number, options: { encoding: string; flag?: string; } | string): Promise<string>;
|
4230 |
|
4231 | |
4232 |
|
4233 |
|
4234 |
|
4235 |
|
4236 |
|
4237 |
|
4238 |
|
4239 | export function __promisify__(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): Promise<string | Buffer>;
|
4240 | }
|
4241 |
|
4242 | |
4243 |
|
4244 |
|
4245 |
|
4246 |
|
4247 |
|
4248 |
|
4249 | export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer;
|
4250 |
|
4251 | |
4252 |
|
4253 |
|
4254 |
|
4255 |
|
4256 |
|
4257 |
|
4258 |
|
4259 | export function readFileSync(path: PathLike | number, options: { encoding: string; flag?: string; } | string): string;
|
4260 |
|
4261 | |
4262 |
|
4263 |
|
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 | export function readFileSync(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): string | Buffer;
|
4270 |
|
4271 | |
4272 |
|
4273 |
|
4274 |
|
4275 |
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 |
|
4282 |
|
4283 | export function writeFile(path: PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
4284 |
|
4285 | |
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 | export function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
|
4293 |
|
4294 |
|
4295 | export namespace writeFile {
|
4296 | |
4297 |
|
4298 |
|
4299 |
|
4300 |
|
4301 |
|
4302 |
|
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 |
|
4308 | export function __promisify__(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): Promise<void>;
|
4309 | }
|
4310 |
|
4311 | |
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 |
|
4319 |
|
4320 |
|
4321 |
|
4322 |
|
4323 | export function writeFileSync(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void;
|
4324 |
|
4325 | |
4326 |
|
4327 |
|
4328 |
|
4329 |
|
4330 |
|
4331 |
|
4332 |
|
4333 |
|
4334 |
|
4335 |
|
4336 |
|
4337 | export function appendFile(file: PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void;
|
4338 |
|
4339 | |
4340 |
|
4341 |
|
4342 |
|
4343 |
|
4344 |
|
4345 |
|
4346 | export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
|
4347 |
|
4348 |
|
4349 | export namespace appendFile {
|
4350 | |
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 |
|
4360 |
|
4361 |
|
4362 | export function __promisify__(file: PathLike | number, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string } | string | null): Promise<void>;
|
4363 | }
|
4364 |
|
4365 | |
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 |
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 | export function appendFileSync(file: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void;
|
4378 |
|
4379 | |
4380 |
|
4381 |
|
4382 | export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void;
|
4383 |
|
4384 | |
4385 |
|
4386 |
|
4387 |
|
4388 |
|
4389 | export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void;
|
4390 |
|
4391 | |
4392 |
|
4393 |
|
4394 |
|
4395 |
|
4396 | export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void;
|
4397 |
|
4398 | |
4399 |
|
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 |
|
4405 |
|
4406 |
|
4407 | export function watch(filename: PathLike, options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, listener?: (event: string, filename: string) => void): FSWatcher;
|
4408 |
|
4409 | |
4410 |
|
4411 |
|
4412 |
|
4413 |
|
4414 |
|
4415 |
|
4416 |
|
4417 |
|
4418 | export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher;
|
4419 |
|
4420 | |
4421 |
|
4422 |
|
4423 |
|
4424 |
|
4425 |
|
4426 |
|
4427 |
|
4428 |
|
4429 | export function watch(filename: PathLike, options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | null, listener?: (event: string, filename: string | Buffer) => void): FSWatcher;
|
4430 |
|
4431 | |
4432 |
|
4433 |
|
4434 |
|
4435 |
|
4436 | export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher;
|
4437 |
|
4438 | |
4439 |
|
4440 |
|
4441 |
|
4442 |
|
4443 |
|
4444 | export function exists(path: PathLike, callback: (exists: boolean) => void): void;
|
4445 |
|
4446 |
|
4447 | export namespace exists {
|
4448 | |
4449 |
|
4450 |
|
4451 |
|
4452 | function __promisify__(path: PathLike): Promise<boolean>;
|
4453 | }
|
4454 |
|
4455 | |
4456 |
|
4457 |
|
4458 |
|
4459 |
|
4460 | export function existsSync(path: PathLike): boolean;
|
4461 |
|
4462 | export namespace constants {
|
4463 |
|
4464 |
|
4465 |
|
4466 | export const F_OK: number;
|
4467 |
|
4468 |
|
4469 | export const R_OK: number;
|
4470 |
|
4471 |
|
4472 | export const W_OK: number;
|
4473 |
|
4474 |
|
4475 | export const X_OK: number;
|
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 | export const COPYFILE_EXCL: number;
|
4481 |
|
4482 |
|
4483 | export const COPYFILE_FICLONE: number;
|
4484 |
|
4485 |
|
4486 | export const COPYFILE_FICLONE_FORCE: number;
|
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 | export const O_RDONLY: number;
|
4492 |
|
4493 |
|
4494 | export const O_WRONLY: number;
|
4495 |
|
4496 |
|
4497 | export const O_RDWR: number;
|
4498 |
|
4499 |
|
4500 | export const O_CREAT: number;
|
4501 |
|
4502 |
|
4503 | export const O_EXCL: number;
|
4504 |
|
4505 |
|
4506 | export const O_NOCTTY: number;
|
4507 |
|
4508 |
|
4509 | export const O_TRUNC: number;
|
4510 |
|
4511 |
|
4512 | export const O_APPEND: number;
|
4513 |
|
4514 |
|
4515 | export const O_DIRECTORY: number;
|
4516 |
|
4517 |
|
4518 | export const O_NOATIME: number;
|
4519 |
|
4520 |
|
4521 | export const O_NOFOLLOW: number;
|
4522 |
|
4523 |
|
4524 | export const O_SYNC: number;
|
4525 |
|
4526 |
|
4527 | export const O_DSYNC: number;
|
4528 |
|
4529 |
|
4530 | export const O_SYMLINK: number;
|
4531 |
|
4532 |
|
4533 | export const O_DIRECT: number;
|
4534 |
|
4535 |
|
4536 | export const O_NONBLOCK: number;
|
4537 |
|
4538 |
|
4539 |
|
4540 |
|
4541 | export const S_IFMT: number;
|
4542 |
|
4543 |
|
4544 | export const S_IFREG: number;
|
4545 |
|
4546 |
|
4547 | export const S_IFDIR: number;
|
4548 |
|
4549 |
|
4550 | export const S_IFCHR: number;
|
4551 |
|
4552 |
|
4553 | export const S_IFBLK: number;
|
4554 |
|
4555 |
|
4556 | export const S_IFIFO: number;
|
4557 |
|
4558 |
|
4559 | export const S_IFLNK: number;
|
4560 |
|
4561 |
|
4562 | export const S_IFSOCK: number;
|
4563 |
|
4564 |
|
4565 |
|
4566 |
|
4567 | export const S_IRWXU: number;
|
4568 |
|
4569 |
|
4570 | export const S_IRUSR: number;
|
4571 |
|
4572 |
|
4573 | export const S_IWUSR: number;
|
4574 |
|
4575 |
|
4576 | export const S_IXUSR: number;
|
4577 |
|
4578 |
|
4579 | export const S_IRWXG: number;
|
4580 |
|
4581 |
|
4582 | export const S_IRGRP: number;
|
4583 |
|
4584 |
|
4585 | export const S_IWGRP: number;
|
4586 |
|
4587 |
|
4588 | export const S_IXGRP: number;
|
4589 |
|
4590 |
|
4591 | export const S_IRWXO: number;
|
4592 |
|
4593 |
|
4594 | export const S_IROTH: number;
|
4595 |
|
4596 |
|
4597 | export const S_IWOTH: number;
|
4598 |
|
4599 |
|
4600 | export const S_IXOTH: number;
|
4601 | }
|
4602 |
|
4603 | |
4604 |
|
4605 |
|
4606 |
|
4607 |
|
4608 | export function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException) => void): void;
|
4609 |
|
4610 | |
4611 |
|
4612 |
|
4613 |
|
4614 |
|
4615 | export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
4616 |
|
4617 |
|
4618 | export namespace access {
|
4619 | |
4620 |
|
4621 |
|
4622 |
|
4623 |
|
4624 | export function __promisify__(path: PathLike, mode?: number): Promise<void>;
|
4625 | }
|
4626 |
|
4627 | |
4628 |
|
4629 |
|
4630 |
|
4631 |
|
4632 | export function accessSync(path: PathLike, mode?: number): void;
|
4633 |
|
4634 | |
4635 |
|
4636 |
|
4637 |
|
4638 |
|
4639 | export function createReadStream(path: PathLike, options?: string | {
|
4640 | flags?: string;
|
4641 | encoding?: string;
|
4642 | fd?: number;
|
4643 | mode?: number;
|
4644 | autoClose?: boolean;
|
4645 | start?: number;
|
4646 | end?: number;
|
4647 | highWaterMark?: number;
|
4648 | }): ReadStream;
|
4649 |
|
4650 | |
4651 |
|
4652 |
|
4653 |
|
4654 |
|
4655 | export function createWriteStream(path: PathLike, options?: string | {
|
4656 | flags?: string;
|
4657 | encoding?: string;
|
4658 | fd?: number;
|
4659 | mode?: number;
|
4660 | autoClose?: boolean;
|
4661 | start?: number;
|
4662 | }): WriteStream;
|
4663 |
|
4664 | |
4665 |
|
4666 |
|
4667 |
|
4668 | export function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
4669 |
|
4670 |
|
4671 | export namespace fdatasync {
|
4672 | |
4673 |
|
4674 |
|
4675 |
|
4676 | export function __promisify__(fd: number): Promise<void>;
|
4677 | }
|
4678 |
|
4679 | |
4680 |
|
4681 |
|
4682 |
|
4683 | export function fdatasyncSync(fd: number): void;
|
4684 |
|
4685 | |
4686 |
|
4687 |
|
4688 |
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 | export function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException) => void): void;
|
4695 | |
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 |
|
4704 |
|
4705 | export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
4706 |
|
4707 |
|
4708 | export namespace copyFile {
|
4709 | |
4710 |
|
4711 |
|
4712 |
|
4713 |
|
4714 |
|
4715 |
|
4716 |
|
4717 |
|
4718 |
|
4719 | export function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise<void>;
|
4720 | }
|
4721 |
|
4722 | |
4723 |
|
4724 |
|
4725 |
|
4726 |
|
4727 |
|
4728 |
|
4729 |
|
4730 |
|
4731 | export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void;
|
4732 |
|
4733 | export namespace promises {
|
4734 | interface FileHandle {
|
4735 | |
4736 |
|
4737 |
|
4738 | readonly fd: number;
|
4739 |
|
4740 | |
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 |
|
4747 |
|
4748 |
|
4749 |
|
4750 | appendFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
|
4751 |
|
4752 | |
4753 |
|
4754 |
|
4755 | chown(uid: number, gid: number): Promise<void>;
|
4756 |
|
4757 | |
4758 |
|
4759 |
|
4760 |
|
4761 | chmod(mode: string | number): Promise<void>;
|
4762 |
|
4763 | |
4764 |
|
4765 |
|
4766 | datasync(): Promise<void>;
|
4767 |
|
4768 | |
4769 |
|
4770 |
|
4771 | sync(): Promise<void>;
|
4772 |
|
4773 | |
4774 |
|
4775 |
|
4776 |
|
4777 |
|
4778 |
|
4779 |
|
4780 |
|
4781 | read<TBuffer extends Buffer | Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
|
4782 |
|
4783 | |
4784 |
|
4785 |
|
4786 |
|
4787 |
|
4788 |
|
4789 | readFile(options?: { encoding?: null, flag?: string | number } | null): Promise<Buffer>;
|
4790 |
|
4791 | |
4792 |
|
4793 |
|
4794 |
|
4795 |
|
4796 |
|
4797 | readFile(options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise<string>;
|
4798 |
|
4799 | |
4800 |
|
4801 |
|
4802 |
|
4803 |
|
4804 |
|
4805 | readFile(options?: { encoding?: string | null, flag?: string | number } | string | null): Promise<string | Buffer>;
|
4806 |
|
4807 | |
4808 |
|
4809 |
|
4810 | stat(): Promise<Stats>;
|
4811 |
|
4812 | |
4813 |
|
4814 |
|
4815 |
|
4816 | truncate(len?: number): Promise<void>;
|
4817 |
|
4818 | |
4819 |
|
4820 |
|
4821 |
|
4822 |
|
4823 | utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
4824 |
|
4825 | |
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 | write<TBuffer extends Buffer | Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
|
4834 |
|
4835 | |
4836 |
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 |
|
4842 |
|
4843 | write(data: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>;
|
4844 |
|
4845 | |
4846 |
|
4847 |
|
4848 |
|
4849 |
|
4850 |
|
4851 |
|
4852 |
|
4853 |
|
4854 |
|
4855 |
|
4856 | writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
|
4857 |
|
4858 | |
4859 |
|
4860 |
|
4861 | close(): Promise<void>;
|
4862 | }
|
4863 |
|
4864 | |
4865 |
|
4866 |
|
4867 |
|
4868 |
|
4869 | function access(path: PathLike, mode?: number): Promise<void>;
|
4870 |
|
4871 | |
4872 |
|
4873 |
|
4874 |
|
4875 |
|
4876 |
|
4877 |
|
4878 |
|
4879 |
|
4880 |
|
4881 |
|
4882 | function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise<void>;
|
4883 |
|
4884 | |
4885 |
|
4886 |
|
4887 |
|
4888 |
|
4889 |
|
4890 | function open(path: PathLike, flags: string | number, mode?: string | number): Promise<FileHandle>;
|
4891 |
|
4892 | |
4893 |
|
4894 |
|
4895 |
|
4896 |
|
4897 |
|
4898 |
|
4899 |
|
4900 |
|
4901 | function read<TBuffer extends Buffer | Uint8Array>(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
|
4902 |
|
4903 | |
4904 |
|
4905 |
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 | function write<TBuffer extends Buffer | Uint8Array>(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
|
4913 |
|
4914 | |
4915 |
|
4916 |
|
4917 |
|
4918 |
|
4919 |
|
4920 |
|
4921 |
|
4922 | function write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>;
|
4923 |
|
4924 | |
4925 |
|
4926 |
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 | function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
|
4932 |
|
4933 | |
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 | function truncate(path: PathLike, len?: number): Promise<void>;
|
4939 |
|
4940 | |
4941 |
|
4942 |
|
4943 |
|
4944 |
|
4945 | function ftruncate(handle: FileHandle, len?: number): Promise<void>;
|
4946 |
|
4947 | |
4948 |
|
4949 |
|
4950 |
|
4951 | function rmdir(path: PathLike): Promise<void>;
|
4952 |
|
4953 | |
4954 |
|
4955 |
|
4956 |
|
4957 | function fdatasync(handle: FileHandle): Promise<void>;
|
4958 |
|
4959 | |
4960 |
|
4961 |
|
4962 |
|
4963 | function fsync(handle: FileHandle): Promise<void>;
|
4964 |
|
4965 | |
4966 |
|
4967 |
|
4968 |
|
4969 |
|
4970 | function mkdir(path: PathLike, mode?: string | number): Promise<void>;
|
4971 |
|
4972 | |
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 | function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string[]>;
|
4978 |
|
4979 | |
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 | function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer[]>;
|
4985 |
|
4986 | |
4987 |
|
4988 |
|
4989 |
|
4990 |
|
4991 | function readdir(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string[] | Buffer[]>;
|
4992 |
|
4993 | |
4994 |
|
4995 |
|
4996 |
|
4997 |
|
4998 | function readlink(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
|
4999 |
|
5000 | |
5001 |
|
5002 |
|
5003 |
|
5004 |
|
5005 | function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
|
5006 |
|
5007 | |
5008 |
|
5009 |
|
5010 |
|
5011 |
|
5012 | function readlink(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
|
5013 |
|
5014 | |
5015 |
|
5016 |
|
5017 |
|
5018 |
|
5019 |
|
5020 |
|
5021 | function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
5022 |
|
5023 | |
5024 |
|
5025 |
|
5026 |
|
5027 | function fstat(handle: FileHandle): Promise<Stats>;
|
5028 |
|
5029 | |
5030 |
|
5031 |
|
5032 |
|
5033 | function lstat(path: PathLike): Promise<Stats>;
|
5034 |
|
5035 | |
5036 |
|
5037 |
|
5038 |
|
5039 | function stat(path: PathLike): Promise<Stats>;
|
5040 |
|
5041 | |
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 | function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
|
5047 |
|
5048 | |
5049 |
|
5050 |
|
5051 |
|
5052 | function unlink(path: PathLike): Promise<void>;
|
5053 |
|
5054 | |
5055 |
|
5056 |
|
5057 |
|
5058 |
|
5059 | function fchmod(handle: FileHandle, mode: string | number): Promise<void>;
|
5060 |
|
5061 | |
5062 |
|
5063 |
|
5064 |
|
5065 |
|
5066 | function chmod(path: PathLike, mode: string | number): Promise<void>;
|
5067 |
|
5068 | |
5069 |
|
5070 |
|
5071 |
|
5072 |
|
5073 | function lchmod(path: PathLike, mode: string | number): Promise<void>;
|
5074 |
|
5075 | |
5076 |
|
5077 |
|
5078 |
|
5079 | function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
|
5080 |
|
5081 | |
5082 |
|
5083 |
|
5084 |
|
5085 | function fchown(handle: FileHandle, uid: number, gid: number): Promise<void>;
|
5086 |
|
5087 | |
5088 |
|
5089 |
|
5090 |
|
5091 | function chown(path: PathLike, uid: number, gid: number): Promise<void>;
|
5092 |
|
5093 | |
5094 |
|
5095 |
|
5096 |
|
5097 |
|
5098 |
|
5099 | function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
5100 |
|
5101 | |
5102 |
|
5103 |
|
5104 |
|
5105 |
|
5106 |
|
5107 | function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
5108 |
|
5109 | |
5110 |
|
5111 |
|
5112 |
|
5113 |
|
5114 | function realpath(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
|
5115 |
|
5116 | |
5117 |
|
5118 |
|
5119 |
|
5120 |
|
5121 | function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
|
5122 |
|
5123 | |
5124 |
|
5125 |
|
5126 |
|
5127 |
|
5128 | function realpath(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
|
5129 |
|
5130 | |
5131 |
|
5132 |
|
5133 |
|
5134 |
|
5135 | function mkdtemp(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
|
5136 |
|
5137 | |
5138 |
|
5139 |
|
5140 |
|
5141 |
|
5142 | function mkdtemp(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
|
5143 |
|
5144 | |
5145 |
|
5146 |
|
5147 |
|
5148 |
|
5149 | function mkdtemp(prefix: string, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
|
5150 |
|
5151 | |
5152 |
|
5153 |
|
5154 |
|
5155 |
|
5156 |
|
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 |
|
5162 |
|
5163 |
|
5164 | function writeFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
|
5165 |
|
5166 | |
5167 |
|
5168 |
|
5169 |
|
5170 |
|
5171 |
|
5172 |
|
5173 |
|
5174 |
|
5175 |
|
5176 |
|
5177 |
|
5178 | function appendFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
|
5179 |
|
5180 | |
5181 |
|
5182 |
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 | function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: string | number } | null): Promise<Buffer>;
|
5188 |
|
5189 | |
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 |
|
5195 |
|
5196 | function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise<string>;
|
5197 |
|
5198 | |
5199 |
|
5200 |
|
5201 |
|
5202 |
|
5203 |
|
5204 |
|
5205 | function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise<string | Buffer>;
|
5206 | }
|
5207 | }
|
5208 |
|
5209 | declare module "path" {
|
5210 | |
5211 |
|
5212 |
|
5213 | export interface ParsedPath {
|
5214 | |
5215 |
|
5216 |
|
5217 | root: string;
|
5218 | |
5219 |
|
5220 |
|
5221 | dir: string;
|
5222 | |
5223 |
|
5224 |
|
5225 | base: string;
|
5226 | |
5227 |
|
5228 |
|
5229 | ext: string;
|
5230 | |
5231 |
|
5232 |
|
5233 | name: string;
|
5234 | }
|
5235 | export interface FormatInputPathObject {
|
5236 | |
5237 |
|
5238 |
|
5239 | root?: string;
|
5240 | |
5241 |
|
5242 |
|
5243 | dir?: string;
|
5244 | |
5245 |
|
5246 |
|
5247 | base?: string;
|
5248 | |
5249 |
|
5250 |
|
5251 | ext?: string;
|
5252 | |
5253 |
|
5254 |
|
5255 | name?: string;
|
5256 | }
|
5257 |
|
5258 | |
5259 |
|
5260 |
|
5261 |
|
5262 |
|
5263 |
|
5264 | export function normalize(p: string): string;
|
5265 | |
5266 |
|
5267 |
|
5268 |
|
5269 |
|
5270 |
|
5271 | export function join(...paths: string[]): string;
|
5272 | |
5273 |
|
5274 |
|
5275 |
|
5276 |
|
5277 |
|
5278 |
|
5279 |
|
5280 |
|
5281 | export function resolve(...pathSegments: string[]): string;
|
5282 | |
5283 |
|
5284 |
|
5285 |
|
5286 |
|
5287 | export function isAbsolute(path: string): boolean;
|
5288 | |
5289 |
|
5290 |
|
5291 |
|
5292 | export function relative(from: string, to: string): string;
|
5293 | |
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 | export function dirname(p: string): string;
|
5299 | |
5300 |
|
5301 |
|
5302 |
|
5303 |
|
5304 |
|
5305 |
|
5306 | export function basename(p: string, ext?: string): string;
|
5307 | |
5308 |
|
5309 |
|
5310 |
|
5311 |
|
5312 |
|
5313 | export function extname(p: string): string;
|
5314 | |
5315 |
|
5316 |
|
5317 | export var sep: '\\' | '/';
|
5318 | |
5319 |
|
5320 |
|
5321 | export var delimiter: ';' | ':';
|
5322 | |
5323 |
|
5324 |
|
5325 |
|
5326 |
|
5327 | export function parse(pathString: string): ParsedPath;
|
5328 | |
5329 |
|
5330 |
|
5331 |
|
5332 |
|
5333 | export function format(pathObject: FormatInputPathObject): string;
|
5334 |
|
5335 | export module posix {
|
5336 | export function normalize(p: string): string;
|
5337 | export function join(...paths: any[]): string;
|
5338 | export function resolve(...pathSegments: any[]): string;
|
5339 | export function isAbsolute(p: string): boolean;
|
5340 | export function relative(from: string, to: string): string;
|
5341 | export function dirname(p: string): string;
|
5342 | export function basename(p: string, ext?: string): string;
|
5343 | export function extname(p: string): string;
|
5344 | export var sep: string;
|
5345 | export var delimiter: string;
|
5346 | export function parse(p: string): ParsedPath;
|
5347 | export function format(pP: FormatInputPathObject): string;
|
5348 | }
|
5349 |
|
5350 | export module win32 {
|
5351 | export function normalize(p: string): string;
|
5352 | export function join(...paths: any[]): string;
|
5353 | export function resolve(...pathSegments: any[]): string;
|
5354 | export function isAbsolute(p: string): boolean;
|
5355 | export function relative(from: string, to: string): string;
|
5356 | export function dirname(p: string): string;
|
5357 | export function basename(p: string, ext?: string): string;
|
5358 | export function extname(p: string): string;
|
5359 | export var sep: string;
|
5360 | export var delimiter: string;
|
5361 | export function parse(p: string): ParsedPath;
|
5362 | export function format(pP: FormatInputPathObject): string;
|
5363 | }
|
5364 | }
|
5365 |
|
5366 | declare module "string_decoder" {
|
5367 | export interface NodeStringDecoder {
|
5368 | write(buffer: Buffer): string;
|
5369 | end(buffer?: Buffer): string;
|
5370 | }
|
5371 | export var StringDecoder: {
|
5372 | new(encoding?: string): NodeStringDecoder;
|
5373 | };
|
5374 | }
|
5375 |
|
5376 | declare module "tls" {
|
5377 | import * as crypto from "crypto";
|
5378 | import * as dns from "dns";
|
5379 | import * as net from "net";
|
5380 | import * as stream from "stream";
|
5381 |
|
5382 | var CLIENT_RENEG_LIMIT: number;
|
5383 | var CLIENT_RENEG_WINDOW: number;
|
5384 |
|
5385 | export interface Certificate {
|
5386 | |
5387 |
|
5388 |
|
5389 | C: string;
|
5390 | |
5391 |
|
5392 |
|
5393 | ST: string;
|
5394 | |
5395 |
|
5396 |
|
5397 | L: string;
|
5398 | |
5399 |
|
5400 |
|
5401 | O: string;
|
5402 | |
5403 |
|
5404 |
|
5405 | OU: string;
|
5406 | |
5407 |
|
5408 |
|
5409 | CN: string;
|
5410 | }
|
5411 |
|
5412 | export interface PeerCertificate {
|
5413 | subject: Certificate;
|
5414 | issuer: Certificate;
|
5415 | subjectaltname: string;
|
5416 | infoAccess: { [index: string]: string[] | undefined };
|
5417 | modulus: string;
|
5418 | exponent: string;
|
5419 | valid_from: string;
|
5420 | valid_to: string;
|
5421 | fingerprint: string;
|
5422 | ext_key_usage: string[];
|
5423 | serialNumber: string;
|
5424 | raw: Buffer;
|
5425 | }
|
5426 |
|
5427 | export interface DetailedPeerCertificate extends PeerCertificate {
|
5428 | issuerCertificate: DetailedPeerCertificate;
|
5429 | }
|
5430 |
|
5431 | export interface CipherNameAndProtocol {
|
5432 | |
5433 |
|
5434 |
|
5435 | name: string;
|
5436 | |
5437 |
|
5438 |
|
5439 | version: string;
|
5440 | }
|
5441 |
|
5442 | export class TLSSocket extends net.Socket {
|
5443 | |
5444 |
|
5445 |
|
5446 | constructor(socket: net.Socket, options?: {
|
5447 | |
5448 |
|
5449 |
|
5450 | secureContext?: SecureContext,
|
5451 | |
5452 |
|
5453 |
|
5454 |
|
5455 | isServer?: boolean,
|
5456 | |
5457 |
|
5458 |
|
5459 | server?: net.Server,
|
5460 | |
5461 |
|
5462 |
|
5463 |
|
5464 |
|
5465 | requestCert?: boolean,
|
5466 | |
5467 |
|
5468 |
|
5469 |
|
5470 |
|
5471 | rejectUnauthorized?: boolean,
|
5472 | |
5473 |
|
5474 |
|
5475 |
|
5476 | NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array,
|
5477 | |
5478 |
|
5479 |
|
5480 |
|
5481 |
|
5482 |
|
5483 |
|
5484 | ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array,
|
5485 | |
5486 |
|
5487 |
|
5488 |
|
5489 |
|
5490 |
|
5491 |
|
5492 |
|
5493 |
|
5494 | SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void,
|
5495 | |
5496 |
|
5497 |
|
5498 | session?: Buffer,
|
5499 | |
5500 |
|
5501 |
|
5502 |
|
5503 |
|
5504 | requestOCSP?: boolean
|
5505 | });
|
5506 |
|
5507 | /**
|
5508 | * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
|
5509 | */
|
5510 | authorized: boolean;
|
5511 | /**
|
5512 | * The reason why the peer's certificate has not been verified.
|
5513 | * This property becomes available only when tlsSocket.authorized === false.
|
5514 | */
|
5515 | authorizationError: Error;
|
5516 | /**
|
5517 | * Static boolean value, always true.
|
5518 | * May be used to distinguish TLS sockets from regular ones.
|
5519 | */
|
5520 | encrypted: boolean;
|
5521 | /**
|
5522 | * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
|
5523 | * @returns Returns an object representing the cipher name
|
5524 | * and the SSL/TLS protocol version of the current connection.
|
5525 | */
|
5526 | getCipher(): CipherNameAndProtocol;
|
5527 | /**
|
5528 | * Returns an object representing the peer's certificate.
|
5529 | * The returned object has some properties corresponding to the field of the certificate.
|
5530 | * If detailed argument is true the full chain with issuer property will be returned,
|
5531 | * if false only the top certificate without issuer property.
|
5532 | * If the peer does not provide a certificate, it returns null or an empty object.
|
5533 | * @param detailed - If true; the full chain with issuer property will be returned.
|
5534 | * @returns An object representing the peer's certificate.
|
5535 | */
|
5536 | getPeerCertificate(detailed: true): DetailedPeerCertificate;
|
5537 | getPeerCertificate(detailed?: false): PeerCertificate;
|
5538 | getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
|
5539 | /**
|
5540 | * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.
|
5541 | * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process.
|
5542 | * The value `null` will be returned for server sockets or disconnected client sockets.
|
5543 | * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information.
|
5544 | * @returns negotiated SSL/TLS protocol version of the current connection
|
5545 | */
|
5546 | getProtocol(): string | null;
|
5547 | /**
|
5548 | * Could be used to speed up handshake establishment when reconnecting to the server.
|
5549 | * @returns ASN.1 encoded TLS session or undefined if none was negotiated.
|
5550 | */
|
5551 | getSession(): any;
|
5552 | /**
|
5553 | * NOTE: Works only with client TLS sockets.
|
5554 | * Useful only for debugging, for session reuse provide session option to tls.connect().
|
5555 | * @returns TLS session ticket or undefined if none was negotiated.
|
5556 | */
|
5557 | getTLSTicket(): any;
|
5558 | /**
|
5559 | * Initiate TLS renegotiation process.
|
5560 | *
|
5561 | * NOTE: Can be used to request peer's certificate after the secure connection has been established.
|
5562 | * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.
|
5563 | * @param options - The options may contain the following fields: rejectUnauthorized,
|
5564 | * requestCert (See tls.createServer() for details).
|
5565 | * @param callback - callback(err) will be executed with null as err, once the renegotiation
|
5566 | * is successfully completed.
|
5567 | */
|
5568 | renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): any;
|
5569 | /**
|
5570 | * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
|
5571 | * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
|
5572 | * the TLS layer until the entire fragment is received and its integrity is verified;
|
5573 | * large fragments can span multiple roundtrips, and their processing can be delayed due to packet
|
5574 | * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead,
|
5575 | * which may decrease overall server throughput.
|
5576 | * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512).
|
5577 | * @returns Returns true on success, false otherwise.
|
5578 | */
|
5579 | setMaxSendFragment(size: number): boolean;
|
5580 |
|
5581 | /**
|
5582 | * events.EventEmitter
|
5583 | * 1. OCSPResponse
|
5584 | * 2. secureConnect
|
5585 | */
|
5586 | addListener(event: string, listener: (...args: any[]) => void): this;
|
5587 | addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
5588 | addListener(event: "secureConnect", listener: () => void): this;
|
5589 |
|
5590 | emit(event: string | symbol, ...args: any[]): boolean;
|
5591 | emit(event: "OCSPResponse", response: Buffer): boolean;
|
5592 | emit(event: "secureConnect"): boolean;
|
5593 |
|
5594 | on(event: string, listener: (...args: any[]) => void): this;
|
5595 | on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
5596 | on(event: "secureConnect", listener: () => void): this;
|
5597 |
|
5598 | once(event: string, listener: (...args: any[]) => void): this;
|
5599 | once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
5600 | once(event: "secureConnect", listener: () => void): this;
|
5601 |
|
5602 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
5603 | prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
5604 | prependListener(event: "secureConnect", listener: () => void): this;
|
5605 |
|
5606 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
5607 | prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
|
5608 | prependOnceListener(event: "secureConnect", listener: () => void): this;
|
5609 | }
|
5610 |
|
5611 | export interface TlsOptions extends SecureContextOptions {
|
5612 | handshakeTimeout?: number;
|
5613 | requestCert?: boolean;
|
5614 | rejectUnauthorized?: boolean;
|
5615 | NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
|
5616 | ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
|
5617 | SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
|
5618 | sessionTimeout?: number;
|
5619 | ticketKeys?: Buffer;
|
5620 | }
|
5621 |
|
5622 | export interface ConnectionOptions extends SecureContextOptions {
|
5623 | host?: string;
|
5624 | port?: number;
|
5625 | path?: string;
|
5626 | socket?: net.Socket;
|
5627 | rejectUnauthorized?: boolean;
|
5628 | NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
|
5629 | ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
|
5630 | checkServerIdentity?: typeof checkServerIdentity;
|
5631 | servername?: string;
|
5632 | session?: Buffer;
|
5633 | minDHSize?: number;
|
5634 | secureContext?: SecureContext;
|
5635 | lookup?: net.LookupFunction;
|
5636 | }
|
5637 |
|
5638 | export class Server extends net.Server {
|
5639 | addContext(hostName: string, credentials: {
|
5640 | key: string;
|
5641 | cert: string;
|
5642 | ca: string;
|
5643 | }): void;
|
5644 |
|
5645 | |
5646 |
|
5647 |
|
5648 |
|
5649 |
|
5650 |
|
5651 |
|
5652 |
|
5653 | addListener(event: string, listener: (...args: any[]) => void): this;
|
5654 | addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
5655 | addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
|
5656 | addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
|
5657 | addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
5658 | addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
5659 |
|
5660 | emit(event: string | symbol, ...args: any[]): boolean;
|
5661 | emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
5662 | emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean;
|
5663 | emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean;
|
5664 | emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean;
|
5665 | emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
5666 |
|
5667 | on(event: string, listener: (...args: any[]) => void): this;
|
5668 | on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
5669 | on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
|
5670 | on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
|
5671 | on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
5672 | on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
5673 |
|
5674 | once(event: string, listener: (...args: any[]) => void): this;
|
5675 | once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
5676 | once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
|
5677 | once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
|
5678 | once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
5679 | once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
5680 |
|
5681 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
5682 | prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
5683 | prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
|
5684 | prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
|
5685 | prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
5686 | prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
5687 |
|
5688 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
5689 | prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
5690 | prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;
|
5691 | prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;
|
5692 | prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;
|
5693 | prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
5694 | }
|
5695 |
|
5696 | export interface SecurePair {
|
5697 | encrypted: any;
|
5698 | cleartext: any;
|
5699 | }
|
5700 |
|
5701 | export interface SecureContextOptions {
|
5702 | pfx?: string | Buffer | Array<string | Buffer | Object>;
|
5703 | key?: string | Buffer | Array<Buffer | Object>;
|
5704 | passphrase?: string;
|
5705 | cert?: string | Buffer | Array<string | Buffer>;
|
5706 | ca?: string | Buffer | Array<string | Buffer>;
|
5707 | ciphers?: string;
|
5708 | honorCipherOrder?: boolean;
|
5709 | ecdhCurve?: string;
|
5710 | clientCertEngine?: string;
|
5711 | crl?: string | Buffer | Array<string | Buffer>;
|
5712 | dhparam?: string | Buffer;
|
5713 | secureOptions?: number;
|
5714 | secureProtocol?: string;
|
5715 | sessionIdContext?: string;
|
5716 | }
|
5717 |
|
5718 | export interface SecureContext {
|
5719 | context: any;
|
5720 | }
|
5721 |
|
5722 | |
5723 |
|
5724 |
|
5725 |
|
5726 |
|
5727 |
|
5728 |
|
5729 | export function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
|
5730 | export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
|
5731 | export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket;
|
5732 | export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
5733 | export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
5734 | export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
|
5735 | export function createSecureContext(details: SecureContextOptions): SecureContext;
|
5736 | export function getCiphers(): string[];
|
5737 |
|
5738 | export var DEFAULT_ECDH_CURVE: string;
|
5739 | }
|
5740 |
|
5741 | declare module "crypto" {
|
5742 | import * as stream from "stream";
|
5743 |
|
5744 | export interface Certificate {
|
5745 | exportChallenge(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5746 | exportPublicKey(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5747 | verifySpkac(spkac: Buffer | NodeJS.TypedArray | DataView): boolean;
|
5748 | }
|
5749 | export var Certificate: {
|
5750 | new(): Certificate;
|
5751 | (): Certificate;
|
5752 | };
|
5753 |
|
5754 |
|
5755 | export var fips: boolean;
|
5756 |
|
5757 | export interface CredentialDetails {
|
5758 | pfx: string;
|
5759 | key: string;
|
5760 | passphrase: string;
|
5761 | cert: string;
|
5762 | ca: string | string[];
|
5763 | crl: string | string[];
|
5764 | ciphers: string;
|
5765 | }
|
5766 | export interface Credentials { context?: any; }
|
5767 | export function createCredentials(details: CredentialDetails): Credentials;
|
5768 | export function createHash(algorithm: string, options?: stream.TransformOptions): Hash;
|
5769 | export function createHmac(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Hmac;
|
5770 |
|
5771 | type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
|
5772 | type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
|
5773 | type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";
|
5774 | type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
|
5775 | type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
5776 |
|
5777 | export interface Hash extends NodeJS.ReadWriteStream {
|
5778 | update(data: string | Buffer | NodeJS.TypedArray | DataView): Hash;
|
5779 | update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
|
5780 | digest(): Buffer;
|
5781 | digest(encoding: HexBase64Latin1Encoding): string;
|
5782 | }
|
5783 | export interface Hmac extends NodeJS.ReadWriteStream {
|
5784 | update(data: string | Buffer | NodeJS.TypedArray | DataView): Hmac;
|
5785 | update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
|
5786 | digest(): Buffer;
|
5787 | digest(encoding: HexBase64Latin1Encoding): string;
|
5788 | }
|
5789 | export type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm';
|
5790 | export type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
|
5791 | export interface CipherCCMOptions extends stream.TransformOptions {
|
5792 | authTagLength: number;
|
5793 | }
|
5794 | export interface CipherGCMOptions extends stream.TransformOptions {
|
5795 | authTagLength?: number;
|
5796 | }
|
5797 |
|
5798 | export function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
|
5799 | export function createCipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
|
5800 | export function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM;
|
5801 |
|
5802 | export function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
|
5803 | export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
|
5804 | export function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): CipherGCM;
|
5805 |
|
5806 | export interface Cipher extends NodeJS.ReadWriteStream {
|
5807 | update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5808 | update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
|
5809 | update(data: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64BinaryEncoding): string;
|
5810 | update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
|
5811 |
|
5812 | update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
|
5813 | final(): Buffer;
|
5814 | final(output_encoding: string): string;
|
5815 | setAutoPadding(auto_padding?: boolean): this;
|
5816 |
|
5817 |
|
5818 | }
|
5819 | export interface CipherCCM extends Cipher {
|
5820 | setAAD(buffer: Buffer, options: { plainTextLength: number }): this;
|
5821 | getAuthTag(): Buffer;
|
5822 | }
|
5823 | export interface CipherGCM extends Cipher {
|
5824 | setAAD(buffer: Buffer, options?: { plainTextLength: number }): this;
|
5825 | getAuthTag(): Buffer;
|
5826 | }
|
5827 |
|
5828 | export function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher;
|
5829 | export function createDecipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM;
|
5830 | export function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM;
|
5831 |
|
5832 | export function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher;
|
5833 | export function createDecipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM;
|
5834 | export function createDecipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherGCMOptions): DecipherGCM;
|
5835 |
|
5836 | export interface Decipher extends NodeJS.ReadWriteStream {
|
5837 | update(data: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5838 | update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
|
5839 | update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;
|
5840 |
|
5841 | update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
|
5842 | final(): Buffer;
|
5843 | final(output_encoding: string): string;
|
5844 | setAutoPadding(auto_padding?: boolean): this;
|
5845 |
|
5846 |
|
5847 | }
|
5848 | export interface DecipherCCM extends Decipher {
|
5849 | setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plainTextLength: number }): this;
|
5850 | setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this;
|
5851 | }
|
5852 | export interface DecipherGCM extends Decipher {
|
5853 | setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plainTextLength: number }): this;
|
5854 | setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this;
|
5855 | }
|
5856 |
|
5857 | export function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
|
5858 | export interface Signer extends NodeJS.WritableStream {
|
5859 | update(data: string | Buffer | NodeJS.TypedArray | DataView): Signer;
|
5860 | update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
5861 | sign(private_key: string | { key: string; passphrase: string }): Buffer;
|
5862 | sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
|
5863 | }
|
5864 | export function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
|
5865 | export interface Verify extends NodeJS.WritableStream {
|
5866 | update(data: string | Buffer | NodeJS.TypedArray | DataView): Verify;
|
5867 | update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
|
5868 | verify(object: string | Object, signature: Buffer | NodeJS.TypedArray | DataView): boolean;
|
5869 | verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
|
5870 |
|
5871 |
|
5872 | }
|
5873 | export function createDiffieHellman(prime_length: number, generator?: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
|
5874 | export function createDiffieHellman(prime: Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
|
5875 | export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
5876 | export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
|
5877 | export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
5878 | export interface DiffieHellman {
|
5879 | generateKeys(): Buffer;
|
5880 | generateKeys(encoding: HexBase64Latin1Encoding): string;
|
5881 | computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5882 | computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
5883 | computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string;
|
5884 | computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
5885 | getPrime(): Buffer;
|
5886 | getPrime(encoding: HexBase64Latin1Encoding): string;
|
5887 | getGenerator(): Buffer;
|
5888 | getGenerator(encoding: HexBase64Latin1Encoding): string;
|
5889 | getPublicKey(): Buffer;
|
5890 | getPublicKey(encoding: HexBase64Latin1Encoding): string;
|
5891 | getPrivateKey(): Buffer;
|
5892 | getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
5893 | setPublicKey(public_key: Buffer | NodeJS.TypedArray | DataView): void;
|
5894 | setPublicKey(public_key: string, encoding: string): void;
|
5895 | setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void;
|
5896 | setPrivateKey(private_key: string, encoding: string): void;
|
5897 | verifyError: number;
|
5898 | }
|
5899 | export function getDiffieHellman(group_name: string): DiffieHellman;
|
5900 | export function pbkdf2(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => any): void;
|
5901 | export function pbkdf2Sync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string): Buffer;
|
5902 |
|
5903 | export function randomBytes(size: number): Buffer;
|
5904 | export function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
5905 | export function pseudoRandomBytes(size: number): Buffer;
|
5906 | export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
5907 |
|
5908 | export function randomFillSync<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset?: number, size?: number): T;
|
5909 | export function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
|
5910 | export function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
|
5911 | export function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
|
5912 |
|
5913 | export interface ScryptOptions {
|
5914 | N?: number;
|
5915 | r?: number;
|
5916 | p?: number;
|
5917 | maxmem?: number;
|
5918 | }
|
5919 | export function scrypt(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void;
|
5920 | export function scrypt(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void;
|
5921 | export function scryptSync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options?: ScryptOptions): Buffer;
|
5922 |
|
5923 | export interface RsaPublicKey {
|
5924 | key: string;
|
5925 | padding?: number;
|
5926 | }
|
5927 | export interface RsaPrivateKey {
|
5928 | key: string;
|
5929 | passphrase?: string;
|
5930 | padding?: number;
|
5931 | }
|
5932 | export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5933 | export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5934 | export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5935 | export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5936 | export function getCiphers(): string[];
|
5937 | export function getCurves(): string[];
|
5938 | export function getHashes(): string[];
|
5939 | export class ECDH {
|
5940 | static convertKey(key: string | Buffer | NodeJS.TypedArray | DataView, curve: string, inputEncoding?: HexBase64Latin1Encoding, outputEncoding?: "latin1" | "hex" | "base64", format?: "uncompressed" | "compressed" | "hybrid"): Buffer | string;
|
5941 | generateKeys(): Buffer;
|
5942 | generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
5943 | computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
5944 | computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
5945 | computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string;
|
5946 | computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
5947 | getPrivateKey(): Buffer;
|
5948 | getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
5949 | getPublicKey(): Buffer;
|
5950 | getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
5951 | setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void;
|
5952 | setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
|
5953 | }
|
5954 | export function createECDH(curve_name: string): ECDH;
|
5955 | export function timingSafeEqual(a: Buffer | NodeJS.TypedArray | DataView, b: Buffer | NodeJS.TypedArray | DataView): boolean;
|
5956 |
|
5957 | export var DEFAULT_ENCODING: string;
|
5958 | }
|
5959 |
|
5960 | declare module "stream" {
|
5961 | import * as events from "events";
|
5962 |
|
5963 | class internal extends events.EventEmitter {
|
5964 | pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
5965 | }
|
5966 |
|
5967 | namespace internal {
|
5968 | export class Stream extends internal { }
|
5969 |
|
5970 | export interface ReadableOptions {
|
5971 | highWaterMark?: number;
|
5972 | encoding?: string;
|
5973 | objectMode?: boolean;
|
5974 | read?: (this: Readable, size?: number) => any;
|
5975 | destroy?: (error?: Error) => any;
|
5976 | }
|
5977 |
|
5978 | export class Readable extends Stream implements NodeJS.ReadableStream {
|
5979 | readable: boolean;
|
5980 | readonly readableHighWaterMark: number;
|
5981 | readonly readableLength: number;
|
5982 | constructor(opts?: ReadableOptions);
|
5983 | _read(size: number): void;
|
5984 | read(size?: number): any;
|
5985 | setEncoding(encoding: string): this;
|
5986 | pause(): this;
|
5987 | resume(): this;
|
5988 | isPaused(): boolean;
|
5989 | unpipe<T extends NodeJS.WritableStream>(destination?: T): this;
|
5990 | unshift(chunk: any): void;
|
5991 | wrap(oldStream: NodeJS.ReadableStream): this;
|
5992 | push(chunk: any, encoding?: string): boolean;
|
5993 | _destroy(err: Error, callback: Function): void;
|
5994 | destroy(error?: Error): void;
|
5995 |
|
5996 | /**
|
5997 | * Event emitter
|
5998 | * The defined events on documents including:
|
5999 | * 1. close
|
6000 | * 2. data
|
6001 | * 3. end
|
6002 | * 4. readable
|
6003 | * 5. error
|
6004 | */
|
6005 | addListener(event: string, listener: (...args: any[]) => void): this;
|
6006 | addListener(event: "close", listener: () => void): this;
|
6007 | addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
6008 | addListener(event: "end", listener: () => void): this;
|
6009 | addListener(event: "readable", listener: () => void): this;
|
6010 | addListener(event: "error", listener: (err: Error) => void): this;
|
6011 |
|
6012 | emit(event: string | symbol, ...args: any[]): boolean;
|
6013 | emit(event: "close"): boolean;
|
6014 | emit(event: "data", chunk: Buffer | string): boolean;
|
6015 | emit(event: "end"): boolean;
|
6016 | emit(event: "readable"): boolean;
|
6017 | emit(event: "error", err: Error): boolean;
|
6018 |
|
6019 | on(event: string, listener: (...args: any[]) => void): this;
|
6020 | on(event: "close", listener: () => void): this;
|
6021 | on(event: "data", listener: (chunk: Buffer | string) => void): this;
|
6022 | on(event: "end", listener: () => void): this;
|
6023 | on(event: "readable", listener: () => void): this;
|
6024 | on(event: "error", listener: (err: Error) => void): this;
|
6025 |
|
6026 | once(event: string, listener: (...args: any[]) => void): this;
|
6027 | once(event: "close", listener: () => void): this;
|
6028 | once(event: "data", listener: (chunk: Buffer | string) => void): this;
|
6029 | once(event: "end", listener: () => void): this;
|
6030 | once(event: "readable", listener: () => void): this;
|
6031 | once(event: "error", listener: (err: Error) => void): this;
|
6032 |
|
6033 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
6034 | prependListener(event: "close", listener: () => void): this;
|
6035 | prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
6036 | prependListener(event: "end", listener: () => void): this;
|
6037 | prependListener(event: "readable", listener: () => void): this;
|
6038 | prependListener(event: "error", listener: (err: Error) => void): this;
|
6039 |
|
6040 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
6041 | prependOnceListener(event: "close", listener: () => void): this;
|
6042 | prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
6043 | prependOnceListener(event: "end", listener: () => void): this;
|
6044 | prependOnceListener(event: "readable", listener: () => void): this;
|
6045 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
6046 |
|
6047 | removeListener(event: string, listener: (...args: any[]) => void): this;
|
6048 | removeListener(event: "close", listener: () => void): this;
|
6049 | removeListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
6050 | removeListener(event: "end", listener: () => void): this;
|
6051 | removeListener(event: "readable", listener: () => void): this;
|
6052 | removeListener(event: "error", listener: (err: Error) => void): this;
|
6053 |
|
6054 | [Symbol.asyncIterator](): AsyncIterableIterator<Buffer | string>;
|
6055 | }
|
6056 |
|
6057 | export interface WritableOptions {
|
6058 | highWaterMark?: number;
|
6059 | decodeStrings?: boolean;
|
6060 | objectMode?: boolean;
|
6061 | write?: (chunk: any, encoding: string, callback: Function) => any;
|
6062 | writev?: (chunks: Array<{ chunk: any, encoding: string }>, callback: Function) => any;
|
6063 | destroy?: (error?: Error) => any;
|
6064 | final?: (callback: (error?: Error) => void) => void;
|
6065 | }
|
6066 |
|
6067 | export class Writable extends Stream implements NodeJS.WritableStream {
|
6068 | writable: boolean;
|
6069 | readonly writableHighWaterMark: number;
|
6070 | readonly writableLength: number;
|
6071 | constructor(opts?: WritableOptions);
|
6072 | _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
|
6073 | _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void;
|
6074 | _destroy(err: Error, callback: Function): void;
|
6075 | _final(callback: Function): void;
|
6076 | write(chunk: any, cb?: Function): boolean;
|
6077 | write(chunk: any, encoding?: string, cb?: Function): boolean;
|
6078 | setDefaultEncoding(encoding: string): this;
|
6079 | end(cb?: Function): void;
|
6080 | end(chunk: any, cb?: Function): void;
|
6081 | end(chunk: any, encoding?: string, cb?: Function): void;
|
6082 | cork(): void;
|
6083 | uncork(): void;
|
6084 | destroy(error?: Error): void;
|
6085 |
|
6086 | /**
|
6087 | * Event emitter
|
6088 | * The defined events on documents including:
|
6089 | * 1. close
|
6090 | * 2. drain
|
6091 | * 3. error
|
6092 | * 4. finish
|
6093 | * 5. pipe
|
6094 | * 6. unpipe
|
6095 | */
|
6096 | addListener(event: string, listener: (...args: any[]) => void): this;
|
6097 | addListener(event: "close", listener: () => void): this;
|
6098 | addListener(event: "drain", listener: () => void): this;
|
6099 | addListener(event: "error", listener: (err: Error) => void): this;
|
6100 | addListener(event: "finish", listener: () => void): this;
|
6101 | addListener(event: "pipe", listener: (src: Readable) => void): this;
|
6102 | addListener(event: "unpipe", listener: (src: Readable) => void): this;
|
6103 |
|
6104 | emit(event: string | symbol, ...args: any[]): boolean;
|
6105 | emit(event: "close"): boolean;
|
6106 | emit(event: "drain", chunk: Buffer | string): boolean;
|
6107 | emit(event: "error", err: Error): boolean;
|
6108 | emit(event: "finish"): boolean;
|
6109 | emit(event: "pipe", src: Readable): boolean;
|
6110 | emit(event: "unpipe", src: Readable): boolean;
|
6111 |
|
6112 | on(event: string, listener: (...args: any[]) => void): this;
|
6113 | on(event: "close", listener: () => void): this;
|
6114 | on(event: "drain", listener: () => void): this;
|
6115 | on(event: "error", listener: (err: Error) => void): this;
|
6116 | on(event: "finish", listener: () => void): this;
|
6117 | on(event: "pipe", listener: (src: Readable) => void): this;
|
6118 | on(event: "unpipe", listener: (src: Readable) => void): this;
|
6119 |
|
6120 | once(event: string, listener: (...args: any[]) => void): this;
|
6121 | once(event: "close", listener: () => void): this;
|
6122 | once(event: "drain", listener: () => void): this;
|
6123 | once(event: "error", listener: (err: Error) => void): this;
|
6124 | once(event: "finish", listener: () => void): this;
|
6125 | once(event: "pipe", listener: (src: Readable) => void): this;
|
6126 | once(event: "unpipe", listener: (src: Readable) => void): this;
|
6127 |
|
6128 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
6129 | prependListener(event: "close", listener: () => void): this;
|
6130 | prependListener(event: "drain", listener: () => void): this;
|
6131 | prependListener(event: "error", listener: (err: Error) => void): this;
|
6132 | prependListener(event: "finish", listener: () => void): this;
|
6133 | prependListener(event: "pipe", listener: (src: Readable) => void): this;
|
6134 | prependListener(event: "unpipe", listener: (src: Readable) => void): this;
|
6135 |
|
6136 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
6137 | prependOnceListener(event: "close", listener: () => void): this;
|
6138 | prependOnceListener(event: "drain", listener: () => void): this;
|
6139 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
6140 | prependOnceListener(event: "finish", listener: () => void): this;
|
6141 | prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
|
6142 | prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
|
6143 |
|
6144 | removeListener(event: string, listener: (...args: any[]) => void): this;
|
6145 | removeListener(event: "close", listener: () => void): this;
|
6146 | removeListener(event: "drain", listener: () => void): this;
|
6147 | removeListener(event: "error", listener: (err: Error) => void): this;
|
6148 | removeListener(event: "finish", listener: () => void): this;
|
6149 | removeListener(event: "pipe", listener: (src: Readable) => void): this;
|
6150 | removeListener(event: "unpipe", listener: (src: Readable) => void): this;
|
6151 | }
|
6152 |
|
6153 | export interface DuplexOptions extends ReadableOptions, WritableOptions {
|
6154 | allowHalfOpen?: boolean;
|
6155 | readableObjectMode?: boolean;
|
6156 | writableObjectMode?: boolean;
|
6157 | }
|
6158 |
|
6159 |
|
6160 | export class Duplex extends Readable implements Writable {
|
6161 | writable: boolean;
|
6162 | readonly writableHighWaterMark: number;
|
6163 | readonly writableLength: number;
|
6164 | constructor(opts?: DuplexOptions);
|
6165 | _write(chunk: any, encoding: string, callback: (err?: Error) => void): void;
|
6166 | _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void;
|
6167 | _destroy(err: Error, callback: Function): void;
|
6168 | _final(callback: Function): void;
|
6169 | write(chunk: any, cb?: Function): boolean;
|
6170 | write(chunk: any, encoding?: string, cb?: Function): boolean;
|
6171 | setDefaultEncoding(encoding: string): this;
|
6172 | end(cb?: Function): void;
|
6173 | end(chunk: any, cb?: Function): void;
|
6174 | end(chunk: any, encoding?: string, cb?: Function): void;
|
6175 | cork(): void;
|
6176 | uncork(): void;
|
6177 | }
|
6178 |
|
6179 | type TransformCallback = (err?: Error, data?: any) => void;
|
6180 |
|
6181 | export interface TransformOptions extends DuplexOptions {
|
6182 | transform?: (chunk: any, encoding: string, callback: TransformCallback) => any;
|
6183 | flush?: (callback: TransformCallback) => any;
|
6184 | }
|
6185 |
|
6186 | export class Transform extends Duplex {
|
6187 | constructor(opts?: TransformOptions);
|
6188 | _transform(chunk: any, encoding: string, callback: TransformCallback): void;
|
6189 | destroy(error?: Error): void;
|
6190 | }
|
6191 |
|
6192 | export class PassThrough extends Transform { }
|
6193 |
|
6194 | export function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException) => void): T;
|
6195 | export function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException) => void): T;
|
6196 | export function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T, callback?: (err: NodeJS.ErrnoException) => void): T;
|
6197 | export function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T, callback?: (err: NodeJS.ErrnoException) => void): T;
|
6198 | export function pipeline(streams: Array<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, callback?: (err: NodeJS.ErrnoException) => void): NodeJS.WritableStream;
|
6199 | export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException) => void)>): NodeJS.WritableStream;
|
6200 | export namespace pipeline {
|
6201 | export function __promisify__<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: T): Promise<void>;
|
6202 | export function __promisify__<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T): Promise<void>;
|
6203 | export function __promisify__<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T): Promise<void>;
|
6204 | export function __promisify__<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T): Promise<void>;
|
6205 | export function __promisify__(streams: Array<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
|
6206 | export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream>): Promise<void>;
|
6207 | }
|
6208 | }
|
6209 |
|
6210 | export = internal;
|
6211 | }
|
6212 |
|
6213 | declare module "util" {
|
6214 | export interface InspectOptions extends NodeJS.InspectOptions { }
|
6215 | export function format(format: any, ...param: any[]): string;
|
6216 |
|
6217 | export function debug(string: string): void;
|
6218 |
|
6219 | export function error(...param: any[]): void;
|
6220 |
|
6221 | export function puts(...param: any[]): void;
|
6222 |
|
6223 | export function print(...param: any[]): void;
|
6224 |
|
6225 | export function log(string: string): void;
|
6226 | export var inspect: {
|
6227 | (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
6228 | (object: any, options: InspectOptions): string;
|
6229 | colors: {
|
6230 | [color: string]: [number, number] | undefined
|
6231 | }
|
6232 | styles: {
|
6233 | [style: string]: string | undefined
|
6234 | }
|
6235 | defaultOptions: InspectOptions;
|
6236 | custom: symbol;
|
6237 | };
|
6238 |
|
6239 | export function isArray(object: any): object is any[];
|
6240 |
|
6241 | export function isRegExp(object: any): object is RegExp;
|
6242 |
|
6243 | export function isDate(object: any): object is Date;
|
6244 |
|
6245 | export function isError(object: any): object is Error;
|
6246 | export function inherits(constructor: any, superConstructor: any): void;
|
6247 | export function debuglog(key: string): (msg: string, ...param: any[]) => void;
|
6248 |
|
6249 | export function isBoolean(object: any): object is boolean;
|
6250 |
|
6251 | export function isBuffer(object: any): object is Buffer;
|
6252 |
|
6253 | export function isFunction(object: any): boolean;
|
6254 |
|
6255 | export function isNull(object: any): object is null;
|
6256 |
|
6257 | export function isNullOrUndefined(object: any): object is null | undefined;
|
6258 |
|
6259 | export function isNumber(object: any): object is number;
|
6260 |
|
6261 | export function isObject(object: any): boolean;
|
6262 |
|
6263 | export function isPrimitive(object: any): boolean;
|
6264 |
|
6265 | export function isString(object: any): object is string;
|
6266 |
|
6267 | export function isSymbol(object: any): object is symbol;
|
6268 |
|
6269 | export function isUndefined(object: any): object is undefined;
|
6270 | export function deprecate<T extends Function>(fn: T, message: string): T;
|
6271 | export function isDeepStrictEqual(val1: any, val2: any): boolean;
|
6272 |
|
6273 | export interface CustomPromisify<TCustom extends Function> extends Function {
|
6274 | __promisify__: TCustom;
|
6275 | }
|
6276 |
|
6277 | export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
|
6278 | export function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6279 | export function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
|
6280 | export function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6281 | export function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
|
6282 | export function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6283 | export 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;
|
6284 | export function callbackify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6285 | export function callbackify<T1, T2, T3, T4>(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;
|
6286 | export function callbackify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6287 | export function callbackify<T1, T2, T3, T4, T5>(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;
|
6288 | export function callbackify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6289 | export function callbackify<T1, T2, T3, T4, T5, T6>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
|
6290 | export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
|
6291 |
|
6292 | export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
|
6293 | export function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
|
6294 | export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise<void>;
|
6295 | export function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
|
6296 | export function promisify<T1>(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise<void>;
|
6297 | export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
|
6298 | export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
|
6299 | export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
|
6300 | export function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
|
6301 | export function promisify<T1, T2, T3, T4, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
|
6302 | export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
|
6303 | export function promisify<T1, T2, T3, T4, T5, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
|
6304 | export function promisify<T1, T2, T3, T4, T5>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
|
6305 | export function promisify(fn: Function): Function;
|
6306 | export namespace promisify {
|
6307 | const custom: symbol;
|
6308 | }
|
6309 |
|
6310 | export namespace types {
|
6311 | export function isAnyArrayBuffer(object: any): boolean;
|
6312 | export function isArgumentsObject(object: any): object is IArguments;
|
6313 | export function isArrayBuffer(object: any): object is ArrayBuffer;
|
6314 | export function isAsyncFunction(object: any): boolean;
|
6315 | export function isBooleanObject(object: any): object is Boolean;
|
6316 | export function isDataView(object: any): object is DataView;
|
6317 | export function isDate(object: any): object is Date;
|
6318 | export function isExternal(object: any): boolean;
|
6319 | export function isFloat32Array(object: any): object is Float32Array;
|
6320 | export function isFloat64Array(object: any): object is Float64Array;
|
6321 | export function isGeneratorFunction(object: any): boolean;
|
6322 | export function isGeneratorObject(object: any): boolean;
|
6323 | export function isInt8Array(object: any): object is Int8Array;
|
6324 | export function isInt16Array(object: any): object is Int16Array;
|
6325 | export function isInt32Array(object: any): object is Int32Array;
|
6326 | export function isMap(object: any): boolean;
|
6327 | export function isMapIterator(object: any): boolean;
|
6328 | export function isNativeError(object: any): object is Error;
|
6329 | export function isNumberObject(object: any): object is Number;
|
6330 | export function isPromise(object: any): boolean;
|
6331 | export function isProxy(object: any): boolean;
|
6332 | export function isRegExp(object: any): object is RegExp;
|
6333 | export function isSet(object: any): boolean;
|
6334 | export function isSetIterator(object: any): boolean;
|
6335 | export function isSharedArrayBuffer(object: any): boolean;
|
6336 | export function isStringObject(object: any): boolean;
|
6337 | export function isSymbolObject(object: any): boolean;
|
6338 | export function isTypedArray(object: any): object is NodeJS.TypedArray;
|
6339 | export function isUint8Array(object: any): object is Uint8Array;
|
6340 | export function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
|
6341 | export function isUint16Array(object: any): object is Uint16Array;
|
6342 | export function isUint32Array(object: any): object is Uint32Array;
|
6343 | export function isWeakMap(object: any): boolean;
|
6344 | export function isWeakSet(object: any): boolean;
|
6345 | export function isWebAssemblyCompiledModule(object: any): boolean;
|
6346 | }
|
6347 |
|
6348 | export class TextDecoder {
|
6349 | readonly encoding: string;
|
6350 | readonly fatal: boolean;
|
6351 | readonly ignoreBOM: boolean;
|
6352 | constructor(
|
6353 | encoding?: string,
|
6354 | options?: { fatal?: boolean; ignoreBOM?: boolean }
|
6355 | );
|
6356 | decode(
|
6357 | input?: NodeJS.TypedArray | DataView | ArrayBuffer | null,
|
6358 | options?: { stream?: boolean }
|
6359 | ): string;
|
6360 | }
|
6361 |
|
6362 | export class TextEncoder {
|
6363 | readonly encoding: string;
|
6364 | constructor();
|
6365 | encode(input?: string): Uint8Array;
|
6366 | }
|
6367 | }
|
6368 |
|
6369 | declare module "assert" {
|
6370 | function internal(value: any, message?: string): void;
|
6371 | namespace internal {
|
6372 | export class AssertionError implements Error {
|
6373 | name: string;
|
6374 | message: string;
|
6375 | actual: any;
|
6376 | expected: any;
|
6377 | operator: string;
|
6378 | generatedMessage: boolean;
|
6379 |
|
6380 | constructor(options?: {
|
6381 | message?: string; actual?: any; expected?: any;
|
6382 | operator?: string; stackStartFunction?: Function
|
6383 | });
|
6384 | }
|
6385 |
|
6386 | export function fail(message: string): never;
|
6387 | /** @deprecated since v10.0.0 */
|
6388 | export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
6389 | export function ok(value: any, message?: string): void;
|
6390 | /** @deprecated use strictEqual() */
|
6391 | export function equal(actual: any, expected: any, message?: string): void;
|
6392 | /** @deprecated use notStrictEqual() */
|
6393 | export function notEqual(actual: any, expected: any, message?: string): void;
|
6394 | /** @deprecated use deepStrictEqual() */
|
6395 | export function deepEqual(actual: any, expected: any, message?: string): void;
|
6396 | /** @deprecated use notDeepStrictEqual() */
|
6397 | export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
6398 | export function strictEqual(actual: any, expected: any, message?: string): void;
|
6399 | export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
6400 | export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
6401 | export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
6402 |
|
6403 | export function throws(block: Function, message?: string): void;
|
6404 | export function throws(block: Function, error: Function, message?: string): void;
|
6405 | export function throws(block: Function, error: RegExp, message?: string): void;
|
6406 | export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
6407 |
|
6408 | export function doesNotThrow(block: Function, message?: string): void;
|
6409 | export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
6410 | export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
6411 | export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
6412 |
|
6413 | export function ifError(value: any): void;
|
6414 |
|
6415 | export function rejects(block: Function | Promise<any>, message?: string): Promise<void>;
|
6416 | export function rejects(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
|
6417 | export function doesNotReject(block: Function | Promise<any>, message?: string): Promise<void>;
|
6418 | export function doesNotReject(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
|
6419 |
|
6420 | export var strict: typeof internal;
|
6421 | }
|
6422 |
|
6423 | export = internal;
|
6424 | }
|
6425 |
|
6426 | declare module "tty" {
|
6427 | import * as net from "net";
|
6428 |
|
6429 | export function isatty(fd: number): boolean;
|
6430 | export class ReadStream extends net.Socket {
|
6431 | isRaw: boolean;
|
6432 | setRawMode(mode: boolean): void;
|
6433 | isTTY: boolean;
|
6434 | }
|
6435 | export class WriteStream extends net.Socket {
|
6436 | columns: number;
|
6437 | rows: number;
|
6438 | isTTY: boolean;
|
6439 | }
|
6440 | }
|
6441 |
|
6442 | declare module "domain" {
|
6443 | import * as events from "events";
|
6444 |
|
6445 | export class Domain extends events.EventEmitter implements NodeJS.Domain {
|
6446 | run(fn: Function): void;
|
6447 | add(emitter: events.EventEmitter): void;
|
6448 | remove(emitter: events.EventEmitter): void;
|
6449 | bind(cb: (err: Error, data: any) => any): any;
|
6450 | intercept(cb: (data: any) => any): any;
|
6451 | members: any[];
|
6452 | enter(): void;
|
6453 | exit(): void;
|
6454 | }
|
6455 |
|
6456 | export function create(): Domain;
|
6457 | }
|
6458 |
|
6459 | declare module "constants" {
|
6460 | export var E2BIG: number;
|
6461 | export var EACCES: number;
|
6462 | export var EADDRINUSE: number;
|
6463 | export var EADDRNOTAVAIL: number;
|
6464 | export var EAFNOSUPPORT: number;
|
6465 | export var EAGAIN: number;
|
6466 | export var EALREADY: number;
|
6467 | export var EBADF: number;
|
6468 | export var EBADMSG: number;
|
6469 | export var EBUSY: number;
|
6470 | export var ECANCELED: number;
|
6471 | export var ECHILD: number;
|
6472 | export var ECONNABORTED: number;
|
6473 | export var ECONNREFUSED: number;
|
6474 | export var ECONNRESET: number;
|
6475 | export var EDEADLK: number;
|
6476 | export var EDESTADDRREQ: number;
|
6477 | export var EDOM: number;
|
6478 | export var EEXIST: number;
|
6479 | export var EFAULT: number;
|
6480 | export var EFBIG: number;
|
6481 | export var EHOSTUNREACH: number;
|
6482 | export var EIDRM: number;
|
6483 | export var EILSEQ: number;
|
6484 | export var EINPROGRESS: number;
|
6485 | export var EINTR: number;
|
6486 | export var EINVAL: number;
|
6487 | export var EIO: number;
|
6488 | export var EISCONN: number;
|
6489 | export var EISDIR: number;
|
6490 | export var ELOOP: number;
|
6491 | export var EMFILE: number;
|
6492 | export var EMLINK: number;
|
6493 | export var EMSGSIZE: number;
|
6494 | export var ENAMETOOLONG: number;
|
6495 | export var ENETDOWN: number;
|
6496 | export var ENETRESET: number;
|
6497 | export var ENETUNREACH: number;
|
6498 | export var ENFILE: number;
|
6499 | export var ENOBUFS: number;
|
6500 | export var ENODATA: number;
|
6501 | export var ENODEV: number;
|
6502 | export var ENOENT: number;
|
6503 | export var ENOEXEC: number;
|
6504 | export var ENOLCK: number;
|
6505 | export var ENOLINK: number;
|
6506 | export var ENOMEM: number;
|
6507 | export var ENOMSG: number;
|
6508 | export var ENOPROTOOPT: number;
|
6509 | export var ENOSPC: number;
|
6510 | export var ENOSR: number;
|
6511 | export var ENOSTR: number;
|
6512 | export var ENOSYS: number;
|
6513 | export var ENOTCONN: number;
|
6514 | export var ENOTDIR: number;
|
6515 | export var ENOTEMPTY: number;
|
6516 | export var ENOTSOCK: number;
|
6517 | export var ENOTSUP: number;
|
6518 | export var ENOTTY: number;
|
6519 | export var ENXIO: number;
|
6520 | export var EOPNOTSUPP: number;
|
6521 | export var EOVERFLOW: number;
|
6522 | export var EPERM: number;
|
6523 | export var EPIPE: number;
|
6524 | export var EPROTO: number;
|
6525 | export var EPROTONOSUPPORT: number;
|
6526 | export var EPROTOTYPE: number;
|
6527 | export var ERANGE: number;
|
6528 | export var EROFS: number;
|
6529 | export var ESPIPE: number;
|
6530 | export var ESRCH: number;
|
6531 | export var ETIME: number;
|
6532 | export var ETIMEDOUT: number;
|
6533 | export var ETXTBSY: number;
|
6534 | export var EWOULDBLOCK: number;
|
6535 | export var EXDEV: number;
|
6536 | export var WSAEINTR: number;
|
6537 | export var WSAEBADF: number;
|
6538 | export var WSAEACCES: number;
|
6539 | export var WSAEFAULT: number;
|
6540 | export var WSAEINVAL: number;
|
6541 | export var WSAEMFILE: number;
|
6542 | export var WSAEWOULDBLOCK: number;
|
6543 | export var WSAEINPROGRESS: number;
|
6544 | export var WSAEALREADY: number;
|
6545 | export var WSAENOTSOCK: number;
|
6546 | export var WSAEDESTADDRREQ: number;
|
6547 | export var WSAEMSGSIZE: number;
|
6548 | export var WSAEPROTOTYPE: number;
|
6549 | export var WSAENOPROTOOPT: number;
|
6550 | export var WSAEPROTONOSUPPORT: number;
|
6551 | export var WSAESOCKTNOSUPPORT: number;
|
6552 | export var WSAEOPNOTSUPP: number;
|
6553 | export var WSAEPFNOSUPPORT: number;
|
6554 | export var WSAEAFNOSUPPORT: number;
|
6555 | export var WSAEADDRINUSE: number;
|
6556 | export var WSAEADDRNOTAVAIL: number;
|
6557 | export var WSAENETDOWN: number;
|
6558 | export var WSAENETUNREACH: number;
|
6559 | export var WSAENETRESET: number;
|
6560 | export var WSAECONNABORTED: number;
|
6561 | export var WSAECONNRESET: number;
|
6562 | export var WSAENOBUFS: number;
|
6563 | export var WSAEISCONN: number;
|
6564 | export var WSAENOTCONN: number;
|
6565 | export var WSAESHUTDOWN: number;
|
6566 | export var WSAETOOMANYREFS: number;
|
6567 | export var WSAETIMEDOUT: number;
|
6568 | export var WSAECONNREFUSED: number;
|
6569 | export var WSAELOOP: number;
|
6570 | export var WSAENAMETOOLONG: number;
|
6571 | export var WSAEHOSTDOWN: number;
|
6572 | export var WSAEHOSTUNREACH: number;
|
6573 | export var WSAENOTEMPTY: number;
|
6574 | export var WSAEPROCLIM: number;
|
6575 | export var WSAEUSERS: number;
|
6576 | export var WSAEDQUOT: number;
|
6577 | export var WSAESTALE: number;
|
6578 | export var WSAEREMOTE: number;
|
6579 | export var WSASYSNOTREADY: number;
|
6580 | export var WSAVERNOTSUPPORTED: number;
|
6581 | export var WSANOTINITIALISED: number;
|
6582 | export var WSAEDISCON: number;
|
6583 | export var WSAENOMORE: number;
|
6584 | export var WSAECANCELLED: number;
|
6585 | export var WSAEINVALIDPROCTABLE: number;
|
6586 | export var WSAEINVALIDPROVIDER: number;
|
6587 | export var WSAEPROVIDERFAILEDINIT: number;
|
6588 | export var WSASYSCALLFAILURE: number;
|
6589 | export var WSASERVICE_NOT_FOUND: number;
|
6590 | export var WSATYPE_NOT_FOUND: number;
|
6591 | export var WSA_E_NO_MORE: number;
|
6592 | export var WSA_E_CANCELLED: number;
|
6593 | export var WSAEREFUSED: number;
|
6594 | export var SIGHUP: number;
|
6595 | export var SIGINT: number;
|
6596 | export var SIGILL: number;
|
6597 | export var SIGABRT: number;
|
6598 | export var SIGFPE: number;
|
6599 | export var SIGKILL: number;
|
6600 | export var SIGSEGV: number;
|
6601 | export var SIGTERM: number;
|
6602 | export var SIGBREAK: number;
|
6603 | export var SIGWINCH: number;
|
6604 | export var SSL_OP_ALL: number;
|
6605 | export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
|
6606 | export var SSL_OP_CIPHER_SERVER_PREFERENCE: number;
|
6607 | export var SSL_OP_CISCO_ANYCONNECT: number;
|
6608 | export var SSL_OP_COOKIE_EXCHANGE: number;
|
6609 | export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
|
6610 | export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
|
6611 | export var SSL_OP_EPHEMERAL_RSA: number;
|
6612 | export var SSL_OP_LEGACY_SERVER_CONNECT: number;
|
6613 | export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
|
6614 | export var SSL_OP_MICROSOFT_SESS_ID_BUG: number;
|
6615 | export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
|
6616 | export var SSL_OP_NETSCAPE_CA_DN_BUG: number;
|
6617 | export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
|
6618 | export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
|
6619 | export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
|
6620 | export var SSL_OP_NO_COMPRESSION: number;
|
6621 | export var SSL_OP_NO_QUERY_MTU: number;
|
6622 | export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
|
6623 | export var SSL_OP_NO_SSLv2: number;
|
6624 | export var SSL_OP_NO_SSLv3: number;
|
6625 | export var SSL_OP_NO_TICKET: number;
|
6626 | export var SSL_OP_NO_TLSv1: number;
|
6627 | export var SSL_OP_NO_TLSv1_1: number;
|
6628 | export var SSL_OP_NO_TLSv1_2: number;
|
6629 | export var SSL_OP_PKCS1_CHECK_1: number;
|
6630 | export var SSL_OP_PKCS1_CHECK_2: number;
|
6631 | export var SSL_OP_SINGLE_DH_USE: number;
|
6632 | export var SSL_OP_SINGLE_ECDH_USE: number;
|
6633 | export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
|
6634 | export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
|
6635 | export var SSL_OP_TLS_BLOCK_PADDING_BUG: number;
|
6636 | export var SSL_OP_TLS_D5_BUG: number;
|
6637 | export var SSL_OP_TLS_ROLLBACK_BUG: number;
|
6638 | export var ENGINE_METHOD_DSA: number;
|
6639 | export var ENGINE_METHOD_DH: number;
|
6640 | export var ENGINE_METHOD_RAND: number;
|
6641 | export var ENGINE_METHOD_ECDH: number;
|
6642 | export var ENGINE_METHOD_ECDSA: number;
|
6643 | export var ENGINE_METHOD_CIPHERS: number;
|
6644 | export var ENGINE_METHOD_DIGESTS: number;
|
6645 | export var ENGINE_METHOD_STORE: number;
|
6646 | export var ENGINE_METHOD_PKEY_METHS: number;
|
6647 | export var ENGINE_METHOD_PKEY_ASN1_METHS: number;
|
6648 | export var ENGINE_METHOD_ALL: number;
|
6649 | export var ENGINE_METHOD_NONE: number;
|
6650 | export var DH_CHECK_P_NOT_SAFE_PRIME: number;
|
6651 | export var DH_CHECK_P_NOT_PRIME: number;
|
6652 | export var DH_UNABLE_TO_CHECK_GENERATOR: number;
|
6653 | export var DH_NOT_SUITABLE_GENERATOR: number;
|
6654 | export var NPN_ENABLED: number;
|
6655 | export var RSA_PKCS1_PADDING: number;
|
6656 | export var RSA_SSLV23_PADDING: number;
|
6657 | export var RSA_NO_PADDING: number;
|
6658 | export var RSA_PKCS1_OAEP_PADDING: number;
|
6659 | export var RSA_X931_PADDING: number;
|
6660 | export var RSA_PKCS1_PSS_PADDING: number;
|
6661 | export var POINT_CONVERSION_COMPRESSED: number;
|
6662 | export var POINT_CONVERSION_UNCOMPRESSED: number;
|
6663 | export var POINT_CONVERSION_HYBRID: number;
|
6664 | export var O_RDONLY: number;
|
6665 | export var O_WRONLY: number;
|
6666 | export var O_RDWR: number;
|
6667 | export var S_IFMT: number;
|
6668 | export var S_IFREG: number;
|
6669 | export var S_IFDIR: number;
|
6670 | export var S_IFCHR: number;
|
6671 | export var S_IFBLK: number;
|
6672 | export var S_IFIFO: number;
|
6673 | export var S_IFSOCK: number;
|
6674 | export var S_IRWXU: number;
|
6675 | export var S_IRUSR: number;
|
6676 | export var S_IWUSR: number;
|
6677 | export var S_IXUSR: number;
|
6678 | export var S_IRWXG: number;
|
6679 | export var S_IRGRP: number;
|
6680 | export var S_IWGRP: number;
|
6681 | export var S_IXGRP: number;
|
6682 | export var S_IRWXO: number;
|
6683 | export var S_IROTH: number;
|
6684 | export var S_IWOTH: number;
|
6685 | export var S_IXOTH: number;
|
6686 | export var S_IFLNK: number;
|
6687 | export var O_CREAT: number;
|
6688 | export var O_EXCL: number;
|
6689 | export var O_NOCTTY: number;
|
6690 | export var O_DIRECTORY: number;
|
6691 | export var O_NOATIME: number;
|
6692 | export var O_NOFOLLOW: number;
|
6693 | export var O_SYNC: number;
|
6694 | export var O_DSYNC: number;
|
6695 | export var O_SYMLINK: number;
|
6696 | export var O_DIRECT: number;
|
6697 | export var O_NONBLOCK: number;
|
6698 | export var O_TRUNC: number;
|
6699 | export var O_APPEND: number;
|
6700 | export var F_OK: number;
|
6701 | export var R_OK: number;
|
6702 | export var W_OK: number;
|
6703 | export var X_OK: number;
|
6704 | export var COPYFILE_EXCL: number;
|
6705 | export var COPYFILE_FICLONE: number;
|
6706 | export var COPYFILE_FICLONE_FORCE: number;
|
6707 | export var UV_UDP_REUSEADDR: number;
|
6708 | export var SIGQUIT: number;
|
6709 | export var SIGTRAP: number;
|
6710 | export var SIGIOT: number;
|
6711 | export var SIGBUS: number;
|
6712 | export var SIGUSR1: number;
|
6713 | export var SIGUSR2: number;
|
6714 | export var SIGPIPE: number;
|
6715 | export var SIGALRM: number;
|
6716 | export var SIGCHLD: number;
|
6717 | export var SIGSTKFLT: number;
|
6718 | export var SIGCONT: number;
|
6719 | export var SIGSTOP: number;
|
6720 | export var SIGTSTP: number;
|
6721 | export var SIGTTIN: number;
|
6722 | export var SIGTTOU: number;
|
6723 | export var SIGURG: number;
|
6724 | export var SIGXCPU: number;
|
6725 | export var SIGXFSZ: number;
|
6726 | export var SIGVTALRM: number;
|
6727 | export var SIGPROF: number;
|
6728 | export var SIGIO: number;
|
6729 | export var SIGPOLL: number;
|
6730 | export var SIGPWR: number;
|
6731 | export var SIGSYS: number;
|
6732 | export var SIGUNUSED: number;
|
6733 | export var defaultCoreCipherList: string;
|
6734 | export var defaultCipherList: string;
|
6735 | export var ENGINE_METHOD_RSA: number;
|
6736 | export var ALPN_ENABLED: number;
|
6737 | }
|
6738 |
|
6739 | declare module "module" {
|
6740 | export = NodeJS.Module;
|
6741 | }
|
6742 |
|
6743 | declare module "process" {
|
6744 | export = process;
|
6745 | }
|
6746 |
|
6747 | declare module "v8" {
|
6748 | interface HeapSpaceInfo {
|
6749 | space_name: string;
|
6750 | space_size: number;
|
6751 | space_used_size: number;
|
6752 | space_available_size: number;
|
6753 | physical_space_size: number;
|
6754 | }
|
6755 |
|
6756 |
|
6757 | type DoesZapCodeSpaceFlag = 0 | 1;
|
6758 |
|
6759 | interface HeapInfo {
|
6760 | total_heap_size: number;
|
6761 | total_heap_size_executable: number;
|
6762 | total_physical_size: number;
|
6763 | total_available_size: number;
|
6764 | used_heap_size: number;
|
6765 | heap_size_limit: number;
|
6766 | malloced_memory: number;
|
6767 | peak_malloced_memory: number;
|
6768 | does_zap_garbage: DoesZapCodeSpaceFlag;
|
6769 | }
|
6770 |
|
6771 | export function getHeapStatistics(): HeapInfo;
|
6772 | export function getHeapSpaceStatistics(): HeapSpaceInfo[];
|
6773 | export function setFlagsFromString(flags: string): void;
|
6774 | }
|
6775 |
|
6776 | declare module "timers" {
|
6777 | export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
|
6778 | export namespace setTimeout {
|
6779 | export function __promisify__(ms: number): Promise<void>;
|
6780 | export function __promisify__<T>(ms: number, value: T): Promise<T>;
|
6781 | }
|
6782 | export function clearTimeout(timeoutId: NodeJS.Timer): void;
|
6783 | export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;
|
6784 | export function clearInterval(intervalId: NodeJS.Timer): void;
|
6785 | export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
|
6786 | export namespace setImmediate {
|
6787 | export function __promisify__(): Promise<void>;
|
6788 | export function __promisify__<T>(value: T): Promise<T>;
|
6789 | }
|
6790 | export function clearImmediate(immediateId: any): void;
|
6791 | }
|
6792 |
|
6793 | declare module "console" {
|
6794 | export = console;
|
6795 | }
|
6796 |
|
6797 |
|
6798 |
|
6799 |
|
6800 | declare module "async_hooks" {
|
6801 | |
6802 |
|
6803 |
|
6804 | export function executionAsyncId(): number;
|
6805 |
|
6806 | |
6807 |
|
6808 |
|
6809 | export function triggerAsyncId(): number;
|
6810 |
|
6811 | export interface HookCallbacks {
|
6812 | |
6813 |
|
6814 |
|
6815 |
|
6816 |
|
6817 |
|
6818 |
|
6819 | init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void;
|
6820 |
|
6821 | |
6822 |
|
6823 |
|
6824 |
|
6825 |
|
6826 | before?(asyncId: number): void;
|
6827 |
|
6828 | |
6829 |
|
6830 |
|
6831 |
|
6832 | after?(asyncId: number): void;
|
6833 |
|
6834 | |
6835 |
|
6836 |
|
6837 |
|
6838 |
|
6839 | promiseResolve?(asyncId: number): void;
|
6840 |
|
6841 | |
6842 |
|
6843 |
|
6844 |
|
6845 | destroy?(asyncId: number): void;
|
6846 | }
|
6847 |
|
6848 | export interface AsyncHook {
|
6849 | |
6850 |
|
6851 |
|
6852 | enable(): this;
|
6853 |
|
6854 | |
6855 |
|
6856 |
|
6857 | disable(): this;
|
6858 | }
|
6859 |
|
6860 | |
6861 |
|
6862 |
|
6863 |
|
6864 |
|
6865 | export function createHook(options: HookCallbacks): AsyncHook;
|
6866 |
|
6867 | export interface AsyncResourceOptions {
|
6868 | |
6869 |
|
6870 |
|
6871 |
|
6872 | triggerAsyncId?: number;
|
6873 |
|
6874 | |
6875 |
|
6876 |
|
6877 |
|
6878 |
|
6879 |
|
6880 |
|
6881 | requireManualDestroy?: boolean;
|
6882 | }
|
6883 |
|
6884 | |
6885 |
|
6886 |
|
6887 |
|
6888 | export class AsyncResource {
|
6889 | |
6890 |
|
6891 |
|
6892 |
|
6893 |
|
6894 |
|
6895 |
|
6896 |
|
6897 |
|
6898 | constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
|
6899 |
|
6900 | /**
|
6901 | * Call AsyncHooks before callbacks.
|
6902 | * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
|
6903 | */
|
6904 | emitBefore(): void;
|
6905 |
|
6906 | /**
|
6907 | * Call AsyncHooks after callbacks.
|
6908 | * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
|
6909 | */
|
6910 | emitAfter(): void;
|
6911 |
|
6912 | /**
|
6913 | * Call the provided function with the provided arguments in the
|
6914 | * execution context of the async resource. This will establish the
|
6915 | * context, trigger the AsyncHooks before callbacks, call the function,
|
6916 | * trigger the AsyncHooks after callbacks, and then restore the original
|
6917 | * execution context.
|
6918 | * @param fn The function to call in the execution context of this
|
6919 | * async resource.
|
6920 | * @param thisArg The receiver to be used for the function call.
|
6921 | * @param args Optional arguments to pass to the function.
|
6922 | */
|
6923 | runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
6924 |
|
6925 | /**
|
6926 | * Call AsyncHooks destroy callbacks.
|
6927 | */
|
6928 | emitDestroy(): void;
|
6929 |
|
6930 | /**
|
6931 | * @return the unique ID assigned to this AsyncResource instance.
|
6932 | */
|
6933 | asyncId(): number;
|
6934 |
|
6935 | /**
|
6936 | * @return the trigger ID for this AsyncResource instance.
|
6937 | */
|
6938 | triggerAsyncId(): number;
|
6939 | }
|
6940 | }
|
6941 |
|
6942 | declare module "http2" {
|
6943 | import * as events from "events";
|
6944 | import * as fs from "fs";
|
6945 | import * as net from "net";
|
6946 | import * as stream from "stream";
|
6947 | import * as tls from "tls";
|
6948 | import * as url from "url";
|
6949 |
|
6950 | import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
|
6951 | export { OutgoingHttpHeaders } from "http";
|
6952 |
|
6953 | export interface IncomingHttpStatusHeader {
|
6954 | ":status"?: number;
|
6955 | }
|
6956 |
|
6957 | export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
|
6958 | ":path"?: string;
|
6959 | ":method"?: string;
|
6960 | ":authority"?: string;
|
6961 | ":scheme"?: string;
|
6962 | }
|
6963 |
|
6964 |
|
6965 |
|
6966 | export interface StreamPriorityOptions {
|
6967 | exclusive?: boolean;
|
6968 | parent?: number;
|
6969 | weight?: number;
|
6970 | silent?: boolean;
|
6971 | }
|
6972 |
|
6973 | export interface StreamState {
|
6974 | localWindowSize?: number;
|
6975 | state?: number;
|
6976 | streamLocalClose?: number;
|
6977 | streamRemoteClose?: number;
|
6978 | sumDependencyWeight?: number;
|
6979 | weight?: number;
|
6980 | }
|
6981 |
|
6982 | export interface ServerStreamResponseOptions {
|
6983 | endStream?: boolean;
|
6984 | getTrailers?: (trailers: OutgoingHttpHeaders) => void;
|
6985 | }
|
6986 |
|
6987 | export interface StatOptions {
|
6988 | offset: number;
|
6989 | length: number;
|
6990 | }
|
6991 |
|
6992 | export interface ServerStreamFileResponseOptions {
|
6993 | statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean;
|
6994 | getTrailers?: (trailers: OutgoingHttpHeaders) => void;
|
6995 | offset?: number;
|
6996 | length?: number;
|
6997 | }
|
6998 |
|
6999 | export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
|
7000 | onError?: (err: NodeJS.ErrnoException) => void;
|
7001 | }
|
7002 |
|
7003 | export interface Http2Stream extends stream.Duplex {
|
7004 | readonly aborted: boolean;
|
7005 | close(code?: number, callback?: () => void): void;
|
7006 | readonly closed: boolean;
|
7007 | readonly destroyed: boolean;
|
7008 | readonly pending: boolean;
|
7009 | priority(options: StreamPriorityOptions): void;
|
7010 | readonly rstCode: number;
|
7011 | readonly session: Http2Session;
|
7012 | setTimeout(msecs: number, callback?: () => void): void;
|
7013 | readonly state: StreamState;
|
7014 |
|
7015 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7016 | addListener(event: "aborted", listener: () => void): this;
|
7017 | addListener(event: "close", listener: () => void): this;
|
7018 | addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
7019 | addListener(event: "drain", listener: () => void): this;
|
7020 | addListener(event: "end", listener: () => void): this;
|
7021 | addListener(event: "error", listener: (err: Error) => void): this;
|
7022 | addListener(event: "finish", listener: () => void): this;
|
7023 | addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
7024 | addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
|
7025 | addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
7026 | addListener(event: "streamClosed", listener: (code: number) => void): this;
|
7027 | addListener(event: "timeout", listener: () => void): this;
|
7028 | addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
7029 |
|
7030 | emit(event: string | symbol, ...args: any[]): boolean;
|
7031 | emit(event: "aborted"): boolean;
|
7032 | emit(event: "close"): boolean;
|
7033 | emit(event: "data", chunk: Buffer | string): boolean;
|
7034 | emit(event: "drain"): boolean;
|
7035 | emit(event: "end"): boolean;
|
7036 | emit(event: "error", err: Error): boolean;
|
7037 | emit(event: "finish"): boolean;
|
7038 | emit(event: "frameError", frameType: number, errorCode: number): boolean;
|
7039 | emit(event: "pipe", src: stream.Readable): boolean;
|
7040 | emit(event: "unpipe", src: stream.Readable): boolean;
|
7041 | emit(event: "streamClosed", code: number): boolean;
|
7042 | emit(event: "timeout"): boolean;
|
7043 | emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean;
|
7044 |
|
7045 | on(event: string, listener: (...args: any[]) => void): this;
|
7046 | on(event: "aborted", listener: () => void): this;
|
7047 | on(event: "close", listener: () => void): this;
|
7048 | on(event: "data", listener: (chunk: Buffer | string) => void): this;
|
7049 | on(event: "drain", listener: () => void): this;
|
7050 | on(event: "end", listener: () => void): this;
|
7051 | on(event: "error", listener: (err: Error) => void): this;
|
7052 | on(event: "finish", listener: () => void): this;
|
7053 | on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
7054 | on(event: "pipe", listener: (src: stream.Readable) => void): this;
|
7055 | on(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
7056 | on(event: "streamClosed", listener: (code: number) => void): this;
|
7057 | on(event: "timeout", listener: () => void): this;
|
7058 | on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
7059 |
|
7060 | once(event: string, listener: (...args: any[]) => void): this;
|
7061 | once(event: "aborted", listener: () => void): this;
|
7062 | once(event: "close", listener: () => void): this;
|
7063 | once(event: "data", listener: (chunk: Buffer | string) => void): this;
|
7064 | once(event: "drain", listener: () => void): this;
|
7065 | once(event: "end", listener: () => void): this;
|
7066 | once(event: "error", listener: (err: Error) => void): this;
|
7067 | once(event: "finish", listener: () => void): this;
|
7068 | once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
7069 | once(event: "pipe", listener: (src: stream.Readable) => void): this;
|
7070 | once(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
7071 | once(event: "streamClosed", listener: (code: number) => void): this;
|
7072 | once(event: "timeout", listener: () => void): this;
|
7073 | once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
7074 |
|
7075 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7076 | prependListener(event: "aborted", listener: () => void): this;
|
7077 | prependListener(event: "close", listener: () => void): this;
|
7078 | prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
7079 | prependListener(event: "drain", listener: () => void): this;
|
7080 | prependListener(event: "end", listener: () => void): this;
|
7081 | prependListener(event: "error", listener: (err: Error) => void): this;
|
7082 | prependListener(event: "finish", listener: () => void): this;
|
7083 | prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
7084 | prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
|
7085 | prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
7086 | prependListener(event: "streamClosed", listener: (code: number) => void): this;
|
7087 | prependListener(event: "timeout", listener: () => void): this;
|
7088 | prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
7089 |
|
7090 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7091 | prependOnceListener(event: "aborted", listener: () => void): this;
|
7092 | prependOnceListener(event: "close", listener: () => void): this;
|
7093 | prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
7094 | prependOnceListener(event: "drain", listener: () => void): this;
|
7095 | prependOnceListener(event: "end", listener: () => void): this;
|
7096 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
7097 | prependOnceListener(event: "finish", listener: () => void): this;
|
7098 | prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
7099 | prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
|
7100 | prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
7101 | prependOnceListener(event: "streamClosed", listener: (code: number) => void): this;
|
7102 | prependOnceListener(event: "timeout", listener: () => void): this;
|
7103 | prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
7104 | }
|
7105 |
|
7106 | export interface ClientHttp2Stream extends Http2Stream {
|
7107 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7108 | addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7109 | addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
7110 | addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7111 |
|
7112 | emit(event: string | symbol, ...args: any[]): boolean;
|
7113 | emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
7114 | emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
|
7115 | emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
7116 |
|
7117 | on(event: string, listener: (...args: any[]) => void): this;
|
7118 | on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7119 | on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
7120 | on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7121 |
|
7122 | once(event: string, listener: (...args: any[]) => void): this;
|
7123 | once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7124 | once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
7125 | once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7126 |
|
7127 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7128 | prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7129 | prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
7130 | prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7131 |
|
7132 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7133 | prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7134 | prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
7135 | prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7136 | }
|
7137 |
|
7138 | export interface ServerHttp2Stream extends Http2Stream {
|
7139 | additionalHeaders(headers: OutgoingHttpHeaders): void;
|
7140 | readonly headersSent: boolean;
|
7141 | readonly pushAllowed: boolean;
|
7142 | pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
|
7143 | pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
|
7144 | respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
|
7145 | respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
|
7146 | respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
|
7147 | }
|
7148 |
|
7149 |
|
7150 |
|
7151 | export interface Settings {
|
7152 | headerTableSize?: number;
|
7153 | enablePush?: boolean;
|
7154 | initialWindowSize?: number;
|
7155 | maxFrameSize?: number;
|
7156 | maxConcurrentStreams?: number;
|
7157 | maxHeaderListSize?: number;
|
7158 | }
|
7159 |
|
7160 | export interface ClientSessionRequestOptions {
|
7161 | endStream?: boolean;
|
7162 | exclusive?: boolean;
|
7163 | parent?: number;
|
7164 | weight?: number;
|
7165 | getTrailers?: (trailers: OutgoingHttpHeaders, flags: number) => void;
|
7166 | }
|
7167 |
|
7168 | export interface SessionState {
|
7169 | effectiveLocalWindowSize?: number;
|
7170 | effectiveRecvDataLength?: number;
|
7171 | nextStreamID?: number;
|
7172 | localWindowSize?: number;
|
7173 | lastProcStreamID?: number;
|
7174 | remoteWindowSize?: number;
|
7175 | outboundQueueSize?: number;
|
7176 | deflateDynamicTableSize?: number;
|
7177 | inflateDynamicTableSize?: number;
|
7178 | }
|
7179 |
|
7180 | export interface Http2Session extends events.EventEmitter {
|
7181 | readonly alpnProtocol?: string;
|
7182 | close(callback?: () => void): void;
|
7183 | readonly closed: boolean;
|
7184 | destroy(error?: Error, code?: number): void;
|
7185 | readonly destroyed: boolean;
|
7186 | readonly encrypted?: boolean;
|
7187 | goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView | NodeJS.TypedArray): void;
|
7188 | readonly localSettings: Settings;
|
7189 | readonly originSet?: string[];
|
7190 | readonly pendingSettingsAck: boolean;
|
7191 | ref(): void;
|
7192 | readonly remoteSettings: Settings;
|
7193 | rstStream(stream: Http2Stream, code?: number): void;
|
7194 | setTimeout(msecs: number, callback?: () => void): void;
|
7195 | readonly socket: net.Socket | tls.TLSSocket;
|
7196 | readonly state: SessionState;
|
7197 | priority(stream: Http2Stream, options: StreamPriorityOptions): void;
|
7198 | settings(settings: Settings): void;
|
7199 | readonly type: number;
|
7200 | unref(): void;
|
7201 |
|
7202 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7203 | addListener(event: "close", listener: () => void): this;
|
7204 | addListener(event: "error", listener: (err: Error) => void): this;
|
7205 | addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
7206 | addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
7207 | addListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
7208 | addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
7209 | addListener(event: "timeout", listener: () => void): this;
|
7210 |
|
7211 | emit(event: string | symbol, ...args: any[]): boolean;
|
7212 | emit(event: "close"): boolean;
|
7213 | emit(event: "error", err: Error): boolean;
|
7214 | emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean;
|
7215 | emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean;
|
7216 | emit(event: "localSettings", settings: Settings): boolean;
|
7217 | emit(event: "remoteSettings", settings: Settings): boolean;
|
7218 | emit(event: "timeout"): boolean;
|
7219 |
|
7220 | on(event: string, listener: (...args: any[]) => void): this;
|
7221 | on(event: "close", listener: () => void): this;
|
7222 | on(event: "error", listener: (err: Error) => void): this;
|
7223 | on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
7224 | on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
7225 | on(event: "localSettings", listener: (settings: Settings) => void): this;
|
7226 | on(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
7227 | on(event: "timeout", listener: () => void): this;
|
7228 |
|
7229 | once(event: string, listener: (...args: any[]) => void): this;
|
7230 | once(event: "close", listener: () => void): this;
|
7231 | once(event: "error", listener: (err: Error) => void): this;
|
7232 | once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
7233 | once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
7234 | once(event: "localSettings", listener: (settings: Settings) => void): this;
|
7235 | once(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
7236 | once(event: "timeout", listener: () => void): this;
|
7237 |
|
7238 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7239 | prependListener(event: "close", listener: () => void): this;
|
7240 | prependListener(event: "error", listener: (err: Error) => void): this;
|
7241 | prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
7242 | prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
7243 | prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
7244 | prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
7245 | prependListener(event: "timeout", listener: () => void): this;
|
7246 |
|
7247 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7248 | prependOnceListener(event: "close", listener: () => void): this;
|
7249 | prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
7250 | prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
7251 | prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
7252 | prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
7253 | prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
7254 | prependOnceListener(event: "timeout", listener: () => void): this;
|
7255 | }
|
7256 |
|
7257 | export interface ClientHttp2Session extends Http2Session {
|
7258 | request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
|
7259 |
|
7260 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7261 | addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
7262 | addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7263 | addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7264 |
|
7265 | emit(event: string | symbol, ...args: any[]): boolean;
|
7266 | emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
|
7267 | emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
7268 | emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
7269 |
|
7270 | on(event: string, listener: (...args: any[]) => void): this;
|
7271 | on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
7272 | on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7273 | on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7274 |
|
7275 | once(event: string, listener: (...args: any[]) => void): this;
|
7276 | once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
7277 | once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7278 | once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7279 |
|
7280 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7281 | prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
7282 | prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7283 | prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7284 |
|
7285 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7286 | prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
7287 | prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7288 | prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
7289 | }
|
7290 |
|
7291 | export interface AlternativeServiceOptions {
|
7292 | origin: number | string | url.URL;
|
7293 | }
|
7294 |
|
7295 | export interface ServerHttp2Session extends Http2Session {
|
7296 | altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
|
7297 | readonly server: Http2Server | Http2SecureServer;
|
7298 |
|
7299 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7300 | addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7301 | addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7302 |
|
7303 | emit(event: string | symbol, ...args: any[]): boolean;
|
7304 | emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
7305 | emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
7306 |
|
7307 | on(event: string, listener: (...args: any[]) => void): this;
|
7308 | on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7309 | on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7310 |
|
7311 | once(event: string, listener: (...args: any[]) => void): this;
|
7312 | once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7313 | once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7314 |
|
7315 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7316 | prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7317 | prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7318 |
|
7319 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7320 | prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
7321 | prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7322 | }
|
7323 |
|
7324 |
|
7325 |
|
7326 | export interface SessionOptions {
|
7327 | maxDeflateDynamicTableSize?: number;
|
7328 | maxReservedRemoteStreams?: number;
|
7329 | maxSendHeaderBlockLength?: number;
|
7330 | paddingStrategy?: number;
|
7331 | peerMaxConcurrentStreams?: number;
|
7332 | selectPadding?: (frameLen: number, maxFrameLen: number) => number;
|
7333 | settings?: Settings;
|
7334 | }
|
7335 |
|
7336 | export type ClientSessionOptions = SessionOptions;
|
7337 | export type ServerSessionOptions = SessionOptions;
|
7338 |
|
7339 | export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { }
|
7340 | export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { }
|
7341 |
|
7342 | export interface ServerOptions extends ServerSessionOptions {
|
7343 | allowHTTP1?: boolean;
|
7344 | }
|
7345 |
|
7346 | export interface SecureServerOptions extends SecureServerSessionOptions {
|
7347 | allowHTTP1?: boolean;
|
7348 | }
|
7349 |
|
7350 | export interface Http2Server extends net.Server {
|
7351 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7352 | addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7353 | addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7354 | addListener(event: "sessionError", listener: (err: Error) => void): this;
|
7355 | addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7356 | addListener(event: "timeout", listener: () => void): this;
|
7357 |
|
7358 | emit(event: string | symbol, ...args: any[]): boolean;
|
7359 | emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
7360 | emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
7361 | emit(event: "sessionError", err: Error): boolean;
|
7362 | emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
7363 | emit(event: "timeout"): boolean;
|
7364 |
|
7365 | on(event: string, listener: (...args: any[]) => void): this;
|
7366 | on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7367 | on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7368 | on(event: "sessionError", listener: (err: Error) => void): this;
|
7369 | on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7370 | on(event: "timeout", listener: () => void): this;
|
7371 |
|
7372 | once(event: string, listener: (...args: any[]) => void): this;
|
7373 | once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7374 | once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7375 | once(event: "sessionError", listener: (err: Error) => void): this;
|
7376 | once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7377 | once(event: "timeout", listener: () => void): this;
|
7378 |
|
7379 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7380 | prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7381 | prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7382 | prependListener(event: "sessionError", listener: (err: Error) => void): this;
|
7383 | prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7384 | prependListener(event: "timeout", listener: () => void): this;
|
7385 |
|
7386 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7387 | prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7388 | prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7389 | prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
|
7390 | prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7391 | prependOnceListener(event: "timeout", listener: () => void): this;
|
7392 | }
|
7393 |
|
7394 | export interface Http2SecureServer extends tls.Server {
|
7395 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7396 | addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7397 | addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7398 | addListener(event: "sessionError", listener: (err: Error) => void): this;
|
7399 | addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7400 | addListener(event: "timeout", listener: () => void): this;
|
7401 | addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
7402 |
|
7403 | emit(event: string | symbol, ...args: any[]): boolean;
|
7404 | emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
7405 | emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
7406 | emit(event: "sessionError", err: Error): boolean;
|
7407 | emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
7408 | emit(event: "timeout"): boolean;
|
7409 | emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean;
|
7410 |
|
7411 | on(event: string, listener: (...args: any[]) => void): this;
|
7412 | on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7413 | on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7414 | on(event: "sessionError", listener: (err: Error) => void): this;
|
7415 | on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7416 | on(event: "timeout", listener: () => void): this;
|
7417 | on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
7418 |
|
7419 | once(event: string, listener: (...args: any[]) => void): this;
|
7420 | once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7421 | once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7422 | once(event: "sessionError", listener: (err: Error) => void): this;
|
7423 | once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7424 | once(event: "timeout", listener: () => void): this;
|
7425 | once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
7426 |
|
7427 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7428 | prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7429 | prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7430 | prependListener(event: "sessionError", listener: (err: Error) => void): this;
|
7431 | prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7432 | prependListener(event: "timeout", listener: () => void): this;
|
7433 | prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
7434 |
|
7435 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7436 | prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7437 | prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
7438 | prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
|
7439 | prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
7440 | prependOnceListener(event: "timeout", listener: () => void): this;
|
7441 | prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
7442 | }
|
7443 |
|
7444 | export interface Http2ServerRequest extends stream.Readable {
|
7445 | headers: IncomingHttpHeaders;
|
7446 | httpVersion: string;
|
7447 | method: string;
|
7448 | rawHeaders: string[];
|
7449 | rawTrailers: string[];
|
7450 | setTimeout(msecs: number, callback?: () => void): void;
|
7451 | socket: net.Socket | tls.TLSSocket;
|
7452 | stream: ServerHttp2Stream;
|
7453 | trailers: IncomingHttpHeaders;
|
7454 | url: string;
|
7455 |
|
7456 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7457 | addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7458 |
|
7459 | emit(event: string | symbol, ...args: any[]): boolean;
|
7460 | emit(event: "aborted", hadError: boolean, code: number): boolean;
|
7461 |
|
7462 | on(event: string, listener: (...args: any[]) => void): this;
|
7463 | on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7464 |
|
7465 | once(event: string, listener: (...args: any[]) => void): this;
|
7466 | once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7467 |
|
7468 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7469 | prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7470 |
|
7471 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7472 | prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7473 | }
|
7474 |
|
7475 | export interface Http2ServerResponse extends events.EventEmitter {
|
7476 | addTrailers(trailers: OutgoingHttpHeaders): void;
|
7477 | connection: net.Socket | tls.TLSSocket;
|
7478 | end(callback?: () => void): void;
|
7479 | end(data?: string | Buffer, callback?: () => void): void;
|
7480 | end(data?: string | Buffer, encoding?: string, callback?: () => void): void;
|
7481 | readonly finished: boolean;
|
7482 | getHeader(name: string): string;
|
7483 | getHeaderNames(): string[];
|
7484 | getHeaders(): OutgoingHttpHeaders;
|
7485 | hasHeader(name: string): boolean;
|
7486 | readonly headersSent: boolean;
|
7487 | removeHeader(name: string): void;
|
7488 | sendDate: boolean;
|
7489 | setHeader(name: string, value: number | string | string[]): void;
|
7490 | setTimeout(msecs: number, callback?: () => void): void;
|
7491 | socket: net.Socket | tls.TLSSocket;
|
7492 | statusCode: number;
|
7493 | statusMessage: '';
|
7494 | stream: ServerHttp2Stream;
|
7495 | write(chunk: string | Buffer, callback?: (err: Error) => void): boolean;
|
7496 | write(chunk: string | Buffer, encoding?: string, callback?: (err: Error) => void): boolean;
|
7497 | writeContinue(): void;
|
7498 | writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void;
|
7499 | writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders): void;
|
7500 | createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void;
|
7501 |
|
7502 | addListener(event: string, listener: (...args: any[]) => void): this;
|
7503 | addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7504 | addListener(event: "close", listener: () => void): this;
|
7505 | addListener(event: "drain", listener: () => void): this;
|
7506 | addListener(event: "error", listener: (error: Error) => void): this;
|
7507 | addListener(event: "finish", listener: () => void): this;
|
7508 |
|
7509 | emit(event: string | symbol, ...args: any[]): boolean;
|
7510 | emit(event: "aborted", hadError: boolean, code: number): boolean;
|
7511 | emit(event: "close"): boolean;
|
7512 | emit(event: "drain"): boolean;
|
7513 | emit(event: "error", error: Error): boolean;
|
7514 | emit(event: "finish"): boolean;
|
7515 |
|
7516 | on(event: string, listener: (...args: any[]) => void): this;
|
7517 | on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7518 | on(event: "close", listener: () => void): this;
|
7519 | on(event: "drain", listener: () => void): this;
|
7520 | on(event: "error", listener: (error: Error) => void): this;
|
7521 | on(event: "finish", listener: () => void): this;
|
7522 |
|
7523 | once(event: string, listener: (...args: any[]) => void): this;
|
7524 | once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7525 | once(event: "close", listener: () => void): this;
|
7526 | once(event: "drain", listener: () => void): this;
|
7527 | once(event: "error", listener: (error: Error) => void): this;
|
7528 | once(event: "finish", listener: () => void): this;
|
7529 |
|
7530 | prependListener(event: string, listener: (...args: any[]) => void): this;
|
7531 | prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7532 | prependListener(event: "close", listener: () => void): this;
|
7533 | prependListener(event: "drain", listener: () => void): this;
|
7534 | prependListener(event: "error", listener: (error: Error) => void): this;
|
7535 | prependListener(event: "finish", listener: () => void): this;
|
7536 |
|
7537 | prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
7538 | prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
7539 | prependOnceListener(event: "close", listener: () => void): this;
|
7540 | prependOnceListener(event: "drain", listener: () => void): this;
|
7541 | prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
7542 | prependOnceListener(event: "finish", listener: () => void): this;
|
7543 | }
|
7544 |
|
7545 |
|
7546 |
|
7547 | export namespace constants {
|
7548 | export const NGHTTP2_SESSION_SERVER: number;
|
7549 | export const NGHTTP2_SESSION_CLIENT: number;
|
7550 | export const NGHTTP2_STREAM_STATE_IDLE: number;
|
7551 | export const NGHTTP2_STREAM_STATE_OPEN: number;
|
7552 | export const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number;
|
7553 | export const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number;
|
7554 | export const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number;
|
7555 | export const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number;
|
7556 | export const NGHTTP2_STREAM_STATE_CLOSED: number;
|
7557 | export const NGHTTP2_NO_ERROR: number;
|
7558 | export const NGHTTP2_PROTOCOL_ERROR: number;
|
7559 | export const NGHTTP2_INTERNAL_ERROR: number;
|
7560 | export const NGHTTP2_FLOW_CONTROL_ERROR: number;
|
7561 | export const NGHTTP2_SETTINGS_TIMEOUT: number;
|
7562 | export const NGHTTP2_STREAM_CLOSED: number;
|
7563 | export const NGHTTP2_FRAME_SIZE_ERROR: number;
|
7564 | export const NGHTTP2_REFUSED_STREAM: number;
|
7565 | export const NGHTTP2_CANCEL: number;
|
7566 | export const NGHTTP2_COMPRESSION_ERROR: number;
|
7567 | export const NGHTTP2_CONNECT_ERROR: number;
|
7568 | export const NGHTTP2_ENHANCE_YOUR_CALM: number;
|
7569 | export const NGHTTP2_INADEQUATE_SECURITY: number;
|
7570 | export const NGHTTP2_HTTP_1_1_REQUIRED: number;
|
7571 | export const NGHTTP2_ERR_FRAME_SIZE_ERROR: number;
|
7572 | export const NGHTTP2_FLAG_NONE: number;
|
7573 | export const NGHTTP2_FLAG_END_STREAM: number;
|
7574 | export const NGHTTP2_FLAG_END_HEADERS: number;
|
7575 | export const NGHTTP2_FLAG_ACK: number;
|
7576 | export const NGHTTP2_FLAG_PADDED: number;
|
7577 | export const NGHTTP2_FLAG_PRIORITY: number;
|
7578 | export const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number;
|
7579 | export const DEFAULT_SETTINGS_ENABLE_PUSH: number;
|
7580 | export const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number;
|
7581 | export const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number;
|
7582 | export const MAX_MAX_FRAME_SIZE: number;
|
7583 | export const MIN_MAX_FRAME_SIZE: number;
|
7584 | export const MAX_INITIAL_WINDOW_SIZE: number;
|
7585 | export const NGHTTP2_DEFAULT_WEIGHT: number;
|
7586 | export const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number;
|
7587 | export const NGHTTP2_SETTINGS_ENABLE_PUSH: number;
|
7588 | export const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number;
|
7589 | export const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number;
|
7590 | export const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number;
|
7591 | export const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number;
|
7592 | export const PADDING_STRATEGY_NONE: number;
|
7593 | export const PADDING_STRATEGY_MAX: number;
|
7594 | export const PADDING_STRATEGY_CALLBACK: number;
|
7595 | export const HTTP2_HEADER_STATUS: string;
|
7596 | export const HTTP2_HEADER_METHOD: string;
|
7597 | export const HTTP2_HEADER_AUTHORITY: string;
|
7598 | export const HTTP2_HEADER_SCHEME: string;
|
7599 | export const HTTP2_HEADER_PATH: string;
|
7600 | export const HTTP2_HEADER_ACCEPT_CHARSET: string;
|
7601 | export const HTTP2_HEADER_ACCEPT_ENCODING: string;
|
7602 | export const HTTP2_HEADER_ACCEPT_LANGUAGE: string;
|
7603 | export const HTTP2_HEADER_ACCEPT_RANGES: string;
|
7604 | export const HTTP2_HEADER_ACCEPT: string;
|
7605 | export const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string;
|
7606 | export const HTTP2_HEADER_AGE: string;
|
7607 | export const HTTP2_HEADER_ALLOW: string;
|
7608 | export const HTTP2_HEADER_AUTHORIZATION: string;
|
7609 | export const HTTP2_HEADER_CACHE_CONTROL: string;
|
7610 | export const HTTP2_HEADER_CONNECTION: string;
|
7611 | export const HTTP2_HEADER_CONTENT_DISPOSITION: string;
|
7612 | export const HTTP2_HEADER_CONTENT_ENCODING: string;
|
7613 | export const HTTP2_HEADER_CONTENT_LANGUAGE: string;
|
7614 | export const HTTP2_HEADER_CONTENT_LENGTH: string;
|
7615 | export const HTTP2_HEADER_CONTENT_LOCATION: string;
|
7616 | export const HTTP2_HEADER_CONTENT_MD5: string;
|
7617 | export const HTTP2_HEADER_CONTENT_RANGE: string;
|
7618 | export const HTTP2_HEADER_CONTENT_TYPE: string;
|
7619 | export const HTTP2_HEADER_COOKIE: string;
|
7620 | export const HTTP2_HEADER_DATE: string;
|
7621 | export const HTTP2_HEADER_ETAG: string;
|
7622 | export const HTTP2_HEADER_EXPECT: string;
|
7623 | export const HTTP2_HEADER_EXPIRES: string;
|
7624 | export const HTTP2_HEADER_FROM: string;
|
7625 | export const HTTP2_HEADER_HOST: string;
|
7626 | export const HTTP2_HEADER_IF_MATCH: string;
|
7627 | export const HTTP2_HEADER_IF_MODIFIED_SINCE: string;
|
7628 | export const HTTP2_HEADER_IF_NONE_MATCH: string;
|
7629 | export const HTTP2_HEADER_IF_RANGE: string;
|
7630 | export const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string;
|
7631 | export const HTTP2_HEADER_LAST_MODIFIED: string;
|
7632 | export const HTTP2_HEADER_LINK: string;
|
7633 | export const HTTP2_HEADER_LOCATION: string;
|
7634 | export const HTTP2_HEADER_MAX_FORWARDS: string;
|
7635 | export const HTTP2_HEADER_PREFER: string;
|
7636 | export const HTTP2_HEADER_PROXY_AUTHENTICATE: string;
|
7637 | export const HTTP2_HEADER_PROXY_AUTHORIZATION: string;
|
7638 | export const HTTP2_HEADER_RANGE: string;
|
7639 | export const HTTP2_HEADER_REFERER: string;
|
7640 | export const HTTP2_HEADER_REFRESH: string;
|
7641 | export const HTTP2_HEADER_RETRY_AFTER: string;
|
7642 | export const HTTP2_HEADER_SERVER: string;
|
7643 | export const HTTP2_HEADER_SET_COOKIE: string;
|
7644 | export const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string;
|
7645 | export const HTTP2_HEADER_TRANSFER_ENCODING: string;
|
7646 | export const HTTP2_HEADER_TE: string;
|
7647 | export const HTTP2_HEADER_UPGRADE: string;
|
7648 | export const HTTP2_HEADER_USER_AGENT: string;
|
7649 | export const HTTP2_HEADER_VARY: string;
|
7650 | export const HTTP2_HEADER_VIA: string;
|
7651 | export const HTTP2_HEADER_WWW_AUTHENTICATE: string;
|
7652 | export const HTTP2_HEADER_HTTP2_SETTINGS: string;
|
7653 | export const HTTP2_HEADER_KEEP_ALIVE: string;
|
7654 | export const HTTP2_HEADER_PROXY_CONNECTION: string;
|
7655 | export const HTTP2_METHOD_ACL: string;
|
7656 | export const HTTP2_METHOD_BASELINE_CONTROL: string;
|
7657 | export const HTTP2_METHOD_BIND: string;
|
7658 | export const HTTP2_METHOD_CHECKIN: string;
|
7659 | export const HTTP2_METHOD_CHECKOUT: string;
|
7660 | export const HTTP2_METHOD_CONNECT: string;
|
7661 | export const HTTP2_METHOD_COPY: string;
|
7662 | export const HTTP2_METHOD_DELETE: string;
|
7663 | export const HTTP2_METHOD_GET: string;
|
7664 | export const HTTP2_METHOD_HEAD: string;
|
7665 | export const HTTP2_METHOD_LABEL: string;
|
7666 | export const HTTP2_METHOD_LINK: string;
|
7667 | export const HTTP2_METHOD_LOCK: string;
|
7668 | export const HTTP2_METHOD_MERGE: string;
|
7669 | export const HTTP2_METHOD_MKACTIVITY: string;
|
7670 | export const HTTP2_METHOD_MKCALENDAR: string;
|
7671 | export const HTTP2_METHOD_MKCOL: string;
|
7672 | export const HTTP2_METHOD_MKREDIRECTREF: string;
|
7673 | export const HTTP2_METHOD_MKWORKSPACE: string;
|
7674 | export const HTTP2_METHOD_MOVE: string;
|
7675 | export const HTTP2_METHOD_OPTIONS: string;
|
7676 | export const HTTP2_METHOD_ORDERPATCH: string;
|
7677 | export const HTTP2_METHOD_PATCH: string;
|
7678 | export const HTTP2_METHOD_POST: string;
|
7679 | export const HTTP2_METHOD_PRI: string;
|
7680 | export const HTTP2_METHOD_PROPFIND: string;
|
7681 | export const HTTP2_METHOD_PROPPATCH: string;
|
7682 | export const HTTP2_METHOD_PUT: string;
|
7683 | export const HTTP2_METHOD_REBIND: string;
|
7684 | export const HTTP2_METHOD_REPORT: string;
|
7685 | export const HTTP2_METHOD_SEARCH: string;
|
7686 | export const HTTP2_METHOD_TRACE: string;
|
7687 | export const HTTP2_METHOD_UNBIND: string;
|
7688 | export const HTTP2_METHOD_UNCHECKOUT: string;
|
7689 | export const HTTP2_METHOD_UNLINK: string;
|
7690 | export const HTTP2_METHOD_UNLOCK: string;
|
7691 | export const HTTP2_METHOD_UPDATE: string;
|
7692 | export const HTTP2_METHOD_UPDATEREDIRECTREF: string;
|
7693 | export const HTTP2_METHOD_VERSION_CONTROL: string;
|
7694 | export const HTTP_STATUS_CONTINUE: number;
|
7695 | export const HTTP_STATUS_SWITCHING_PROTOCOLS: number;
|
7696 | export const HTTP_STATUS_PROCESSING: number;
|
7697 | export const HTTP_STATUS_OK: number;
|
7698 | export const HTTP_STATUS_CREATED: number;
|
7699 | export const HTTP_STATUS_ACCEPTED: number;
|
7700 | export const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number;
|
7701 | export const HTTP_STATUS_NO_CONTENT: number;
|
7702 | export const HTTP_STATUS_RESET_CONTENT: number;
|
7703 | export const HTTP_STATUS_PARTIAL_CONTENT: number;
|
7704 | export const HTTP_STATUS_MULTI_STATUS: number;
|
7705 | export const HTTP_STATUS_ALREADY_REPORTED: number;
|
7706 | export const HTTP_STATUS_IM_USED: number;
|
7707 | export const HTTP_STATUS_MULTIPLE_CHOICES: number;
|
7708 | export const HTTP_STATUS_MOVED_PERMANENTLY: number;
|
7709 | export const HTTP_STATUS_FOUND: number;
|
7710 | export const HTTP_STATUS_SEE_OTHER: number;
|
7711 | export const HTTP_STATUS_NOT_MODIFIED: number;
|
7712 | export const HTTP_STATUS_USE_PROXY: number;
|
7713 | export const HTTP_STATUS_TEMPORARY_REDIRECT: number;
|
7714 | export const HTTP_STATUS_PERMANENT_REDIRECT: number;
|
7715 | export const HTTP_STATUS_BAD_REQUEST: number;
|
7716 | export const HTTP_STATUS_UNAUTHORIZED: number;
|
7717 | export const HTTP_STATUS_PAYMENT_REQUIRED: number;
|
7718 | export const HTTP_STATUS_FORBIDDEN: number;
|
7719 | export const HTTP_STATUS_NOT_FOUND: number;
|
7720 | export const HTTP_STATUS_METHOD_NOT_ALLOWED: number;
|
7721 | export const HTTP_STATUS_NOT_ACCEPTABLE: number;
|
7722 | export const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number;
|
7723 | export const HTTP_STATUS_REQUEST_TIMEOUT: number;
|
7724 | export const HTTP_STATUS_CONFLICT: number;
|
7725 | export const HTTP_STATUS_GONE: number;
|
7726 | export const HTTP_STATUS_LENGTH_REQUIRED: number;
|
7727 | export const HTTP_STATUS_PRECONDITION_FAILED: number;
|
7728 | export const HTTP_STATUS_PAYLOAD_TOO_LARGE: number;
|
7729 | export const HTTP_STATUS_URI_TOO_LONG: number;
|
7730 | export const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number;
|
7731 | export const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number;
|
7732 | export const HTTP_STATUS_EXPECTATION_FAILED: number;
|
7733 | export const HTTP_STATUS_TEAPOT: number;
|
7734 | export const HTTP_STATUS_MISDIRECTED_REQUEST: number;
|
7735 | export const HTTP_STATUS_UNPROCESSABLE_ENTITY: number;
|
7736 | export const HTTP_STATUS_LOCKED: number;
|
7737 | export const HTTP_STATUS_FAILED_DEPENDENCY: number;
|
7738 | export const HTTP_STATUS_UNORDERED_COLLECTION: number;
|
7739 | export const HTTP_STATUS_UPGRADE_REQUIRED: number;
|
7740 | export const HTTP_STATUS_PRECONDITION_REQUIRED: number;
|
7741 | export const HTTP_STATUS_TOO_MANY_REQUESTS: number;
|
7742 | export const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number;
|
7743 | export const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number;
|
7744 | export const HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
|
7745 | export const HTTP_STATUS_NOT_IMPLEMENTED: number;
|
7746 | export const HTTP_STATUS_BAD_GATEWAY: number;
|
7747 | export const HTTP_STATUS_SERVICE_UNAVAILABLE: number;
|
7748 | export const HTTP_STATUS_GATEWAY_TIMEOUT: number;
|
7749 | export const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number;
|
7750 | export const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number;
|
7751 | export const HTTP_STATUS_INSUFFICIENT_STORAGE: number;
|
7752 | export const HTTP_STATUS_LOOP_DETECTED: number;
|
7753 | export const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number;
|
7754 | export const HTTP_STATUS_NOT_EXTENDED: number;
|
7755 | export const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number;
|
7756 | }
|
7757 |
|
7758 | export function getDefaultSettings(): Settings;
|
7759 | export function getPackedSettings(settings: Settings): Settings;
|
7760 | export function getUnpackedSettings(buf: Buffer | Uint8Array): Settings;
|
7761 |
|
7762 | export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
7763 | export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
7764 |
|
7765 | export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
7766 | export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
7767 |
|
7768 | export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
|
7769 | export function connect(authority: string | url.URL, options?: ClientSessionOptions | SecureClientSessionOptions, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
|
7770 | }
|
7771 |
|
7772 | declare module "perf_hooks" {
|
7773 | import { AsyncResource } from "async_hooks";
|
7774 |
|
7775 | export interface PerformanceEntry {
|
7776 | |
7777 |
|
7778 |
|
7779 |
|
7780 | readonly duration: number;
|
7781 |
|
7782 | |
7783 |
|
7784 |
|
7785 | readonly name: string;
|
7786 |
|
7787 | |
7788 |
|
7789 |
|
7790 | readonly startTime: number;
|
7791 |
|
7792 | |
7793 |
|
7794 |
|
7795 |
|
7796 | readonly entryType: string;
|
7797 |
|
7798 | |
7799 |
|
7800 |
|
7801 |
|
7802 |
|
7803 | readonly kind?: number;
|
7804 | }
|
7805 |
|
7806 | export interface PerformanceNodeTiming extends PerformanceEntry {
|
7807 | |
7808 |
|
7809 |
|
7810 | readonly bootstrapComplete: number;
|
7811 |
|
7812 | |
7813 |
|
7814 |
|
7815 | readonly clusterSetupEnd: number;
|
7816 |
|
7817 | |
7818 |
|
7819 |
|
7820 | readonly clusterSetupStart: number;
|
7821 |
|
7822 | |
7823 |
|
7824 |
|
7825 | readonly loopExit: number;
|
7826 |
|
7827 | |
7828 |
|
7829 |
|
7830 | readonly loopStart: number;
|
7831 |
|
7832 | |
7833 |
|
7834 |
|
7835 | readonly moduleLoadEnd: number;
|
7836 |
|
7837 | |
7838 |
|
7839 |
|
7840 | readonly moduleLoadStart: number;
|
7841 |
|
7842 | |
7843 |
|
7844 |
|
7845 | readonly nodeStart: number;
|
7846 |
|
7847 | |
7848 |
|
7849 |
|
7850 | readonly preloadModuleLoadEnd: number;
|
7851 |
|
7852 | |
7853 |
|
7854 |
|
7855 | readonly preloadModuleLoadStart: number;
|
7856 |
|
7857 | |
7858 |
|
7859 |
|
7860 | readonly thirdPartyMainEnd: number;
|
7861 |
|
7862 | |
7863 |
|
7864 |
|
7865 | readonly thirdPartyMainStart: number;
|
7866 |
|
7867 | |
7868 |
|
7869 |
|
7870 | readonly v8Start: number;
|
7871 | }
|
7872 |
|
7873 | export interface Performance {
|
7874 | |
7875 |
|
7876 |
|
7877 |
|
7878 |
|
7879 | clearFunctions(name?: string): void;
|
7880 |
|
7881 | |
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 | clearMarks(name?: string): void;
|
7887 |
|
7888 | |
7889 |
|
7890 |
|
7891 |
|
7892 | clearMeasures(name?: string): void;
|
7893 |
|
7894 | |
7895 |
|
7896 |
|
7897 |
|
7898 | getEntries(): PerformanceEntry[];
|
7899 |
|
7900 | |
7901 |
|
7902 |
|
7903 |
|
7904 |
|
7905 |
|
7906 |
|
7907 | getEntriesByName(name: string, type?: string): PerformanceEntry[];
|
7908 |
|
7909 | |
7910 |
|
7911 |
|
7912 |
|
7913 |
|
7914 |
|
7915 | getEntriesByType(type: string): PerformanceEntry[];
|
7916 |
|
7917 | |
7918 |
|
7919 |
|
7920 |
|
7921 |
|
7922 |
|
7923 |
|
7924 | mark(name?: string): void;
|
7925 |
|
7926 | |
7927 |
|
7928 |
|
7929 |
|
7930 |
|
7931 |
|
7932 |
|
7933 |
|
7934 |
|
7935 |
|
7936 |
|
7937 |
|
7938 |
|
7939 |
|
7940 |
|
7941 | measure(name: string, startMark: string, endMark: string): void;
|
7942 |
|
7943 | |
7944 |
|
7945 |
|
7946 | readonly nodeTiming: PerformanceNodeTiming;
|
7947 |
|
7948 | |
7949 |
|
7950 |
|
7951 | now(): number;
|
7952 |
|
7953 | |
7954 |
|
7955 |
|
7956 | readonly timeOrigin: number;
|
7957 |
|
7958 | |
7959 |
|
7960 |
|
7961 |
|
7962 |
|
7963 | timerify<T extends (...optionalParams: any[]) => any>(fn: T): T;
|
7964 | }
|
7965 |
|
7966 | export interface PerformanceObserverEntryList {
|
7967 | |
7968 |
|
7969 |
|
7970 | getEntries(): PerformanceEntry[];
|
7971 |
|
7972 | |
7973 |
|
7974 |
|
7975 |
|
7976 | getEntriesByName(name: string, type?: string): PerformanceEntry[];
|
7977 |
|
7978 | |
7979 |
|
7980 |
|
7981 |
|
7982 | getEntriesByType(type: string): PerformanceEntry[];
|
7983 | }
|
7984 |
|
7985 | export type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
|
7986 |
|
7987 | export class PerformanceObserver extends AsyncResource {
|
7988 | constructor(callback: PerformanceObserverCallback);
|
7989 |
|
7990 | /**
|
7991 | * Disconnects the PerformanceObserver instance from all notifications.
|
7992 | */
|
7993 | disconnect(): void;
|
7994 |
|
7995 | /**
|
7996 | * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes.
|
7997 | * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance.
|
7998 | * Property buffered defaults to false.
|
7999 | * @param options
|
8000 | */
|
8001 | observe(options: { entryTypes: string[], buffered?: boolean }): void;
|
8002 | }
|
8003 |
|
8004 | export namespace constants {
|
8005 | export const NODE_PERFORMANCE_GC_MAJOR: number;
|
8006 | export const NODE_PERFORMANCE_GC_MINOR: number;
|
8007 | export const NODE_PERFORMANCE_GC_INCREMENTAL: number;
|
8008 | export const NODE_PERFORMANCE_GC_WEAKCB: number;
|
8009 | }
|
8010 |
|
8011 | const performance: Performance;
|
8012 | }
|