cleanup
This commit is contained in:
parent
a28f3ecc1d
commit
fdc4a3bfde
4
dist/beautylog.node.js
vendored
4
dist/beautylog.node.js
vendored
@ -1,7 +1,7 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
exports.log = require("./beautylog.node.log");
|
exports.log = require("./beautylog.node.log");
|
||||||
exports.table = require("./beautylog.node.table");
|
exports.table = require("./beautylog.node.table");
|
||||||
exports.code = require("./beautylog.node.code");
|
//handle figlet
|
||||||
var figletModule = require("./beautylog.node.figlet");
|
var figletModule = require("./beautylog.node.figlet");
|
||||||
exports.figlet = figletModule.figlet;
|
exports.figlet = figletModule.figlet;
|
||||||
exports.figletSync = figletModule.figletSync;
|
exports.figletSync = figletModule.figletSync;
|
||||||
@ -54,4 +54,4 @@ exports.warn = function (logText) {
|
|||||||
return exports.log(logText, 'warn');
|
return exports.log(logText, 'warn');
|
||||||
};
|
};
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU5QixXQUFHLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUN0QyxhQUFLLFdBQVcsd0JBQXdCLENBQUMsQ0FBQztBQUMxQyxZQUFJLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUN0RCxJQUFPLFlBQVksV0FBVyx5QkFBeUIsQ0FBQyxDQUFDO0FBRTlDLGNBQU0sR0FBRyxZQUFZLENBQUMsTUFBTSxDQUFDO0FBQzdCLGtCQUFVLEdBQUcsWUFBWSxDQUFDLFVBQVUsQ0FBQztBQUNoRDs7OztHQUlHO0FBQ1EsV0FBRyxHQUFHLFVBQVMsT0FBTztJQUM3QixNQUFNLENBQUMsV0FBRyxDQUFDLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztBQUMvQixDQU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b25zb2xlXG4gKiBAcGFyYW0gbG9nVGV4dCBzdHJpbmcgdG8gbG9nIGFzIGVycm9yXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn1cbiAqL1xuZXhwb3J0IGxldCBzdWNjZXNzID0gZnVuY3Rpb24obG9nVGV4dCkge1xuICAgIHJldHVybiBsb2cobG9nVGV4dCwgJ3N1Y2Nlc3MnKTtcbn07XG5cbi8qKlxuICogbG9ncyBhICd3YXJuOicgbWVzc2FnZSB0byBjb25zb2xlXG4gKiBAcGFyYW0gbG9nVGV4dCBzdHJpbmcgdG8gbG9nIGFzIGVycm9yXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn1cbiAqL1xuZXhwb3J0IGxldCB3YXJuID0gZnVuY3Rpb24obG9nVGV4dCkge1xuICAgIHJldHVybiBsb2cobG9nVGV4dCwgJ3dhcm4nKTtcbn07Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
|
||||||
|
@ -34,15 +34,14 @@
|
|||||||
"cli-table2": "^0.2.0",
|
"cli-table2": "^0.2.0",
|
||||||
"colors": "1.1.2",
|
"colors": "1.1.2",
|
||||||
"figlet": "^1.1.1",
|
"figlet": "^1.1.1",
|
||||||
"hlight": "0.0.8",
|
"lodash": "^4.8.1",
|
||||||
"lodash": "^4.5.1",
|
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"smartenv": "1.0.10"
|
"smartenv": "1.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"easyserve": "0.0.5",
|
"easyserve": "0.0.5",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-browser": "1.0.10",
|
"gulp-browser": "1.2.2",
|
||||||
"npmts": "3.1.2"
|
"npmts": "4.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
test/test.js
10
test/test.js
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
|||||||
{"version":3,"file":"test.js","sourceRoot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CAAC,CAAC;QAC5E,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,aAAa,EAAC;QACnB,EAAE,CAAC,8CAA8C,EAAC;YAC9C,SAAS,CAAC,UAAU,CAAC,OAAO,EAAC,EAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,CAAC;QAClE,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
11
test/test.ts
11
test/test.ts
@ -72,17 +72,6 @@ describe("beautylog",function(){
|
|||||||
beautylog.figletSync("Sync!",{font:"Star Wars",color:"blue"});
|
beautylog.figletSync("Sync!",{font:"Star Wars",color:"blue"});
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
describe(".code",function(){
|
|
||||||
it("should highlight code",function(){
|
|
||||||
this.timeout(10000);
|
|
||||||
beautylog.code(
|
|
||||||
"var test = 3;\nfunction(){\n var hello = \"super\"\n};\nvar test;",
|
|
||||||
{
|
|
||||||
language:"javascript"
|
|
||||||
}
|
|
||||||
);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
|
||||||
|
|
||||||
import plugins = require("./beautylog.plugins");
|
|
||||||
var codeFunction = function(codeString,options?){
|
|
||||||
var codeSnippet = {
|
|
||||||
source:codeString,
|
|
||||||
highlighted:"default"
|
|
||||||
};
|
|
||||||
if (typeof codeString != "string"){
|
|
||||||
console.log("beautylog.code() expects a string as first argument!");
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
if (typeof options != "undefined"){
|
|
||||||
codeSnippet.highlighted = plugins.hlight(codeSnippet.source,options.language);
|
|
||||||
//console.log(codeSnippet.highlighted)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export = codeFunction;
|
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
export import log = require("./beautylog.node.log");
|
export import log = require("./beautylog.node.log");
|
||||||
export import table = require("./beautylog.node.table");
|
export import table = require("./beautylog.node.table");
|
||||||
export import code = require("./beautylog.node.code");
|
|
||||||
import figletModule = require("./beautylog.node.figlet");
|
|
||||||
|
|
||||||
|
//handle figlet
|
||||||
|
import figletModule = require("./beautylog.node.figlet");
|
||||||
export let figlet = figletModule.figlet;
|
export let figlet = figletModule.figlet;
|
||||||
export let figletSync = figletModule.figletSync;
|
export let figletSync = figletModule.figletSync;
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// Type definitions for Colors.js 0.6.0-1
|
// Type definitions for Colors.js 0.6.0-1
|
||||||
// Project: https://github.com/Marak/colors.js
|
// Project: https://github.com/Marak/colors.js
|
||||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
declare module "colors" {
|
declare module "colors" {
|
||||||
interface Color {
|
interface Color {
|
||||||
@ -45,7 +45,7 @@ declare module "colors" {
|
|||||||
random: Color;
|
random: Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
module e {
|
namespace e {
|
||||||
export function setTheme(theme:any): void;
|
export function setTheme(theme:any): void;
|
||||||
|
|
||||||
export var black: Color;
|
export var black: Color;
|
||||||
|
329
ts/typings/browser/ambient/node/node.d.ts
vendored
329
ts/typings/browser/ambient/node/node.d.ts
vendored
@ -2,8 +2,8 @@
|
|||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
|
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
|
||||||
// Type definitions for Node.js v4.x
|
// Type definitions for Node.js v4.x
|
||||||
// Project: http://nodejs.org/
|
// Project: http://nodejs.org/
|
||||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
|
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
/************************************************
|
/************************************************
|
||||||
* *
|
* *
|
||||||
@ -16,9 +16,9 @@ interface Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// compat for TypeScript 1.5.3
|
// compat for TypeScript 1.8
|
||||||
// if you use with --target es3 or --target es5 and use below definitions,
|
// if you use with --target es3 or --target es5 and use below definitions,
|
||||||
// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3.
|
// use the lib.es6.d.ts that is bundled with TypeScript 1.8.
|
||||||
interface MapConstructor {}
|
interface MapConstructor {}
|
||||||
interface WeakMapConstructor {}
|
interface WeakMapConstructor {}
|
||||||
interface SetConstructor {}
|
interface SetConstructor {}
|
||||||
@ -82,6 +82,7 @@ declare var SlowBuffer: {
|
|||||||
|
|
||||||
|
|
||||||
// Buffer class
|
// Buffer class
|
||||||
|
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex";
|
||||||
interface Buffer extends NodeBuffer {}
|
interface Buffer extends NodeBuffer {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +167,7 @@ declare var Buffer: {
|
|||||||
* GLOBAL INTERFACES *
|
* GLOBAL INTERFACES *
|
||||||
* *
|
* *
|
||||||
************************************************/
|
************************************************/
|
||||||
declare module NodeJS {
|
declare namespace NodeJS {
|
||||||
export interface ErrnoException extends Error {
|
export interface ErrnoException extends Error {
|
||||||
errno?: number;
|
errno?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
@ -176,12 +177,12 @@ declare module NodeJS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface EventEmitter {
|
export interface EventEmitter {
|
||||||
addListener(event: string, listener: Function): EventEmitter;
|
addListener(event: string, listener: Function): this;
|
||||||
on(event: string, listener: Function): EventEmitter;
|
on(event: string, listener: Function): this;
|
||||||
once(event: string, listener: Function): EventEmitter;
|
once(event: string, listener: Function): this;
|
||||||
removeListener(event: string, listener: Function): EventEmitter;
|
removeListener(event: string, listener: Function): this;
|
||||||
removeAllListeners(event?: string): EventEmitter;
|
removeAllListeners(event?: string): this;
|
||||||
setMaxListeners(n: number): EventEmitter;
|
setMaxListeners(n: number): this;
|
||||||
getMaxListeners(): number;
|
getMaxListeners(): number;
|
||||||
listeners(event: string): Function[];
|
listeners(event: string): Function[];
|
||||||
emit(event: string, ...args: any[]): boolean;
|
emit(event: string, ...args: any[]): boolean;
|
||||||
@ -213,6 +214,29 @@ declare module NodeJS {
|
|||||||
|
|
||||||
export interface ReadWriteStream extends ReadableStream, WritableStream {}
|
export interface ReadWriteStream extends ReadableStream, WritableStream {}
|
||||||
|
|
||||||
|
export interface Events extends EventEmitter { }
|
||||||
|
|
||||||
|
export interface Domain extends Events {
|
||||||
|
run(fn: Function): void;
|
||||||
|
add(emitter: Events): void;
|
||||||
|
remove(emitter: Events): void;
|
||||||
|
bind(cb: (err: Error, data: any) => any): any;
|
||||||
|
intercept(cb: (data: any) => any): any;
|
||||||
|
dispose(): void;
|
||||||
|
|
||||||
|
addListener(event: string, listener: Function): this;
|
||||||
|
on(event: string, listener: Function): this;
|
||||||
|
once(event: string, listener: Function): this;
|
||||||
|
removeListener(event: string, listener: Function): this;
|
||||||
|
removeAllListeners(event?: string): this;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MemoryUsage {
|
||||||
|
rss: number;
|
||||||
|
heapTotal: number;
|
||||||
|
heapUsed: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Process extends EventEmitter {
|
export interface Process extends EventEmitter {
|
||||||
stdout: WritableStream;
|
stdout: WritableStream;
|
||||||
stderr: WritableStream;
|
stderr: WritableStream;
|
||||||
@ -272,14 +296,17 @@ declare module NodeJS {
|
|||||||
title: string;
|
title: string;
|
||||||
arch: string;
|
arch: string;
|
||||||
platform: string;
|
platform: string;
|
||||||
memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; };
|
memoryUsage(): MemoryUsage;
|
||||||
nextTick(callback: Function): void;
|
nextTick(callback: Function): void;
|
||||||
umask(mask?: number): number;
|
umask(mask?: number): number;
|
||||||
uptime(): number;
|
uptime(): number;
|
||||||
hrtime(time?:number[]): number[];
|
hrtime(time?:number[]): number[];
|
||||||
|
domain: Domain;
|
||||||
|
|
||||||
// Worker
|
// Worker
|
||||||
send?(message: any, sendHandle?: any): void;
|
send?(message: any, sendHandle?: any): void;
|
||||||
|
disconnect(): void;
|
||||||
|
connected: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Global {
|
export interface Global {
|
||||||
@ -375,7 +402,7 @@ interface NodeBuffer {
|
|||||||
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||||
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||||
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||||
readUInt8(offset: number, noAsset?: boolean): number;
|
readUInt8(offset: number, noAssert?: boolean): number;
|
||||||
readUInt16LE(offset: number, noAssert?: boolean): number;
|
readUInt16LE(offset: number, noAssert?: boolean): number;
|
||||||
readUInt16BE(offset: number, noAssert?: boolean): number;
|
readUInt16BE(offset: number, noAssert?: boolean): number;
|
||||||
readUInt32LE(offset: number, noAssert?: boolean): number;
|
readUInt32LE(offset: number, noAssert?: boolean): number;
|
||||||
@ -442,12 +469,12 @@ declare module "events" {
|
|||||||
static listenerCount(emitter: EventEmitter, event: string): number; // deprecated
|
static listenerCount(emitter: EventEmitter, event: string): number; // deprecated
|
||||||
static defaultMaxListeners: number;
|
static defaultMaxListeners: number;
|
||||||
|
|
||||||
addListener(event: string, listener: Function): EventEmitter;
|
addListener(event: string, listener: Function): this;
|
||||||
on(event: string, listener: Function): EventEmitter;
|
on(event: string, listener: Function): this;
|
||||||
once(event: string, listener: Function): EventEmitter;
|
once(event: string, listener: Function): this;
|
||||||
removeListener(event: string, listener: Function): EventEmitter;
|
removeListener(event: string, listener: Function): this;
|
||||||
removeAllListeners(event?: string): EventEmitter;
|
removeAllListeners(event?: string): this;
|
||||||
setMaxListeners(n: number): EventEmitter;
|
setMaxListeners(n: number): this;
|
||||||
getMaxListeners(): number;
|
getMaxListeners(): number;
|
||||||
listeners(event: string): Function[];
|
listeners(event: string): Function[];
|
||||||
emit(event: string, ...args: any[]): boolean;
|
emit(event: string, ...args: any[]): boolean;
|
||||||
@ -475,14 +502,10 @@ declare module "http" {
|
|||||||
agent?: Agent|boolean;
|
agent?: Agent|boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Server extends events.EventEmitter {
|
export interface Server extends events.EventEmitter, net.Server {
|
||||||
listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
|
setTimeout(msecs: number, callback: Function): void;
|
||||||
listen(port: number, hostname?: string, callback?: Function): Server;
|
|
||||||
listen(path: string, callback?: Function): Server;
|
|
||||||
listen(handle: any, listeningListener?: Function): Server;
|
|
||||||
close(cb?: any): Server;
|
|
||||||
address(): { port: number; family: string; address: string; };
|
|
||||||
maxHeadersCount: number;
|
maxHeadersCount: number;
|
||||||
|
timeout: number;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @deprecated Use IncomingMessage
|
* @deprecated Use IncomingMessage
|
||||||
@ -532,6 +555,11 @@ declare module "http" {
|
|||||||
setNoDelay(noDelay?: boolean): void;
|
setNoDelay(noDelay?: boolean): void;
|
||||||
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
||||||
|
|
||||||
|
setHeader(name: string, value: string | string[]): void;
|
||||||
|
getHeader(name: string): string;
|
||||||
|
removeHeader(name: string): void;
|
||||||
|
addTrailers(headers: any): void;
|
||||||
|
|
||||||
// Extended base methods
|
// Extended base methods
|
||||||
end(): void;
|
end(): void;
|
||||||
end(buffer: Buffer, cb?: Function): void;
|
end(buffer: Buffer, cb?: Function): void;
|
||||||
@ -628,6 +656,12 @@ declare module "cluster" {
|
|||||||
silent?: boolean;
|
silent?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Address {
|
||||||
|
address: string;
|
||||||
|
port: number;
|
||||||
|
addressType: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class Worker extends events.EventEmitter {
|
export class Worker extends events.EventEmitter {
|
||||||
id: string;
|
id: string;
|
||||||
process: child.ChildProcess;
|
process: child.ChildProcess;
|
||||||
@ -900,15 +934,34 @@ declare module "readline" {
|
|||||||
|
|
||||||
declare module "vm" {
|
declare module "vm" {
|
||||||
export interface Context { }
|
export interface Context { }
|
||||||
export interface Script {
|
export interface ScriptOptions {
|
||||||
runInThisContext(): void;
|
filename?: string;
|
||||||
runInNewContext(sandbox?: Context): void;
|
lineOffset?: number;
|
||||||
|
columnOffset?: number;
|
||||||
|
displayErrors?: boolean;
|
||||||
|
timeout?: number;
|
||||||
|
cachedData?: Buffer;
|
||||||
|
produceCachedData?: boolean;
|
||||||
}
|
}
|
||||||
export function runInThisContext(code: string, filename?: string): void;
|
export interface RunningScriptOptions {
|
||||||
export function runInNewContext(code: string, sandbox?: Context, filename?: string): void;
|
filename?: string;
|
||||||
export function runInContext(code: string, context: Context, filename?: string): void;
|
lineOffset?: number;
|
||||||
export function createContext(initSandbox?: Context): Context;
|
columnOffset?: number;
|
||||||
export function createScript(code: string, filename?: string): Script;
|
displayErrors?: boolean;
|
||||||
|
timeout?: number;
|
||||||
|
}
|
||||||
|
export class Script {
|
||||||
|
constructor(code: string, options?: ScriptOptions);
|
||||||
|
runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
|
||||||
|
runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
|
||||||
|
runInThisContext(options?: RunningScriptOptions): any;
|
||||||
|
}
|
||||||
|
export function createContext(sandbox?: Context): Context;
|
||||||
|
export function isContext(sandbox: Context): boolean;
|
||||||
|
export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any;
|
||||||
|
export function runInDebugContext(code: string): any;
|
||||||
|
export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any;
|
||||||
|
export function runInThisContext(code: string, options?: RunningScriptOptions): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "child_process" {
|
declare module "child_process" {
|
||||||
@ -919,7 +972,7 @@ declare module "child_process" {
|
|||||||
stdin: stream.Writable;
|
stdin: stream.Writable;
|
||||||
stdout: stream.Readable;
|
stdout: stream.Readable;
|
||||||
stderr: stream.Readable;
|
stderr: stream.Readable;
|
||||||
stdio: (stream.Readable|stream.Writable)[];
|
stdio: [stream.Writable, stream.Readable, stream.Readable];
|
||||||
pid: number;
|
pid: number;
|
||||||
kill(signal?: string): void;
|
kill(signal?: string): void;
|
||||||
send(message: any, sendHandle?: any): void;
|
send(message: any, sendHandle?: any): void;
|
||||||
@ -927,39 +980,66 @@ declare module "child_process" {
|
|||||||
unref(): void;
|
unref(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function spawn(command: string, args?: string[], options?: {
|
export interface SpawnOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
stdio?: any;
|
|
||||||
custom?: any;
|
|
||||||
env?: any;
|
env?: any;
|
||||||
|
stdio?: any;
|
||||||
detached?: boolean;
|
detached?: boolean;
|
||||||
}): ChildProcess;
|
uid?: number;
|
||||||
export function exec(command: string, options: {
|
gid?: number;
|
||||||
|
shell?: boolean | string;
|
||||||
|
}
|
||||||
|
export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
|
||||||
|
|
||||||
|
export interface ExecOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
stdio?: any;
|
|
||||||
customFds?: any;
|
|
||||||
env?: any;
|
env?: any;
|
||||||
encoding?: string;
|
shell?: string;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
maxBuffer?: number;
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
uid?: number;
|
||||||
export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
gid?: number;
|
||||||
export function execFile(file: string,
|
}
|
||||||
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
export interface ExecOptionsWithStringEncoding extends ExecOptions {
|
||||||
export function execFile(file: string, args?: string[],
|
encoding: BufferEncoding;
|
||||||
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
}
|
||||||
export function execFile(file: string, args?: string[], options?: {
|
export interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
// usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {});
|
||||||
|
export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||||
|
export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
|
||||||
|
export interface ExecFileOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
stdio?: any;
|
|
||||||
customFds?: any;
|
|
||||||
env?: any;
|
env?: any;
|
||||||
encoding?: string;
|
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
maxBuffer?: number;
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
uid?: number;
|
||||||
export function fork(modulePath: string, args?: string[], options?: {
|
gid?: number;
|
||||||
|
}
|
||||||
|
export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
// usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {});
|
||||||
|
export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
// usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {});
|
||||||
|
export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
|
||||||
|
export interface ForkOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: any;
|
env?: any;
|
||||||
execPath?: string;
|
execPath?: string;
|
||||||
@ -967,8 +1047,10 @@ declare module "child_process" {
|
|||||||
silent?: boolean;
|
silent?: boolean;
|
||||||
uid?: number;
|
uid?: number;
|
||||||
gid?: number;
|
gid?: number;
|
||||||
}): ChildProcess;
|
}
|
||||||
export function spawnSync(command: string, args?: string[], options?: {
|
export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess;
|
||||||
|
|
||||||
|
export interface SpawnSyncOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
input?: string | Buffer;
|
input?: string | Buffer;
|
||||||
stdio?: any;
|
stdio?: any;
|
||||||
@ -976,42 +1058,83 @@ declare module "child_process" {
|
|||||||
uid?: number;
|
uid?: number;
|
||||||
gid?: number;
|
gid?: number;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
|
maxBuffer?: number;
|
||||||
encoding?: string;
|
encoding?: string;
|
||||||
}): {
|
shell?: boolean | string;
|
||||||
|
}
|
||||||
|
export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export interface SpawnSyncReturns<T> {
|
||||||
pid: number;
|
pid: number;
|
||||||
output: string[];
|
output: string[];
|
||||||
stdout: string | Buffer;
|
stdout: T;
|
||||||
stderr: string | Buffer;
|
stderr: T;
|
||||||
status: number;
|
status: number;
|
||||||
signal: string;
|
signal: string;
|
||||||
error: Error;
|
error: Error;
|
||||||
};
|
}
|
||||||
export function execSync(command: string, options?: {
|
export function spawnSync(command: string): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||||
|
export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||||
|
export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
||||||
|
|
||||||
|
export interface ExecSyncOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
input?: string|Buffer;
|
input?: string | Buffer;
|
||||||
|
stdio?: any;
|
||||||
|
env?: any;
|
||||||
|
shell?: string;
|
||||||
|
uid?: number;
|
||||||
|
gid?: number;
|
||||||
|
timeout?: number;
|
||||||
|
killSignal?: string;
|
||||||
|
maxBuffer?: number;
|
||||||
|
encoding?: string;
|
||||||
|
}
|
||||||
|
export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function execSync(command: string): Buffer;
|
||||||
|
export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
|
||||||
|
export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
|
||||||
|
export function execSync(command: string, options?: ExecSyncOptions): Buffer;
|
||||||
|
|
||||||
|
export interface ExecFileSyncOptions {
|
||||||
|
cwd?: string;
|
||||||
|
input?: string | Buffer;
|
||||||
stdio?: any;
|
stdio?: any;
|
||||||
env?: any;
|
env?: any;
|
||||||
uid?: number;
|
uid?: number;
|
||||||
gid?: number;
|
gid?: number;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
encoding?: string;
|
|
||||||
}): string | Buffer;
|
|
||||||
export function execFileSync(command: string, args?: string[], options?: {
|
|
||||||
cwd?: string;
|
|
||||||
input?: string|Buffer;
|
|
||||||
stdio?: any;
|
|
||||||
env?: any;
|
|
||||||
uid?: number;
|
|
||||||
gid?: number;
|
|
||||||
timeout?: number;
|
|
||||||
maxBuffer?: number;
|
maxBuffer?: number;
|
||||||
killSignal?: string;
|
|
||||||
encoding?: string;
|
encoding?: string;
|
||||||
}): string | Buffer;
|
}
|
||||||
|
export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function execFileSync(command: string): Buffer;
|
||||||
|
export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
||||||
|
export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||||
|
export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
|
||||||
|
export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string;
|
||||||
|
export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||||
|
export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "url" {
|
declare module "url" {
|
||||||
@ -1096,12 +1219,29 @@ declare module "net" {
|
|||||||
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
|
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface ListenOptions {
|
||||||
|
port?: number;
|
||||||
|
host?: string;
|
||||||
|
backlog?: number;
|
||||||
|
path?: string;
|
||||||
|
exclusive?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Server extends Socket {
|
export interface Server extends Socket {
|
||||||
listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server;
|
listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server;
|
||||||
|
listen(port: number, hostname?: string, listeningListener?: Function): Server;
|
||||||
|
listen(port: number, backlog?: number, listeningListener?: Function): Server;
|
||||||
|
listen(port: number, listeningListener?: Function): Server;
|
||||||
|
listen(path: string, backlog?: number, listeningListener?: Function): Server;
|
||||||
listen(path: string, listeningListener?: Function): Server;
|
listen(path: string, listeningListener?: Function): Server;
|
||||||
|
listen(handle: any, backlog?: number, listeningListener?: Function): Server;
|
||||||
listen(handle: any, listeningListener?: Function): Server;
|
listen(handle: any, listeningListener?: Function): Server;
|
||||||
|
listen(options: ListenOptions, listeningListener?: Function): Server;
|
||||||
close(callback?: Function): Server;
|
close(callback?: Function): Server;
|
||||||
address(): { port: number; family: string; address: string; };
|
address(): { port: number; family: string; address: string; };
|
||||||
|
getConnections(cb: (error: Error, count: number) => void): void;
|
||||||
|
ref(): Server;
|
||||||
|
unref(): Server;
|
||||||
maxConnections: number;
|
maxConnections: number;
|
||||||
connections: number;
|
connections: number;
|
||||||
}
|
}
|
||||||
@ -1329,7 +1469,8 @@ declare module "fs" {
|
|||||||
export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
||||||
export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
||||||
export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
||||||
export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
|
export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number;
|
||||||
|
export function writeSync(fd: number, data: any, position?: number, enconding?: string): number;
|
||||||
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
|
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
|
||||||
export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
|
export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
|
||||||
/*
|
/*
|
||||||
@ -1625,12 +1766,6 @@ declare module "tls" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Server extends net.Server {
|
export interface Server extends net.Server {
|
||||||
// Extended base methods
|
|
||||||
listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server;
|
|
||||||
listen(path: string, listeningListener?: Function): Server;
|
|
||||||
listen(handle: any, listeningListener?: Function): Server;
|
|
||||||
|
|
||||||
listen(port: number, host?: string, callback?: Function): Server;
|
|
||||||
close(): Server;
|
close(): Server;
|
||||||
address(): { port: number; family: string; address: string; };
|
address(): { port: number; family: string; address: string; };
|
||||||
addContext(hostName: string, credentials: {
|
addContext(hostName: string, credentials: {
|
||||||
@ -1716,21 +1851,27 @@ declare module "crypto" {
|
|||||||
}
|
}
|
||||||
export function createCipher(algorithm: string, password: any): Cipher;
|
export function createCipher(algorithm: string, password: any): Cipher;
|
||||||
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
||||||
export interface Cipher {
|
export interface Cipher extends NodeJS.ReadWriteStream {
|
||||||
update(data: Buffer): Buffer;
|
update(data: Buffer): Buffer;
|
||||||
update(data: string, input_encoding?: string, output_encoding?: string): string;
|
update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer;
|
||||||
|
update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string;
|
||||||
|
update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string;
|
||||||
final(): Buffer;
|
final(): Buffer;
|
||||||
final(output_encoding: string): string;
|
final(output_encoding: string): string;
|
||||||
setAutoPadding(auto_padding: boolean): void;
|
setAutoPadding(auto_padding: boolean): void;
|
||||||
|
getAuthTag(): Buffer;
|
||||||
}
|
}
|
||||||
export function createDecipher(algorithm: string, password: any): Decipher;
|
export function createDecipher(algorithm: string, password: any): Decipher;
|
||||||
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
|
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
|
||||||
export interface Decipher {
|
export interface Decipher extends NodeJS.ReadWriteStream {
|
||||||
update(data: Buffer): Buffer;
|
update(data: Buffer): Buffer;
|
||||||
update(data: string, input_encoding?: string, output_encoding?: string): string;
|
update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer;
|
||||||
|
update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string;
|
||||||
|
update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string;
|
||||||
final(): Buffer;
|
final(): Buffer;
|
||||||
final(output_encoding: string): string;
|
final(output_encoding: string): string;
|
||||||
setAutoPadding(auto_padding: boolean): void;
|
setAutoPadding(auto_padding: boolean): void;
|
||||||
|
setAuthTag(tag: Buffer): void;
|
||||||
}
|
}
|
||||||
export function createSign(algorithm: string): Signer;
|
export function createSign(algorithm: string): Signer;
|
||||||
export interface Signer extends NodeJS.WritableStream {
|
export interface Signer extends NodeJS.WritableStream {
|
||||||
@ -1891,7 +2032,7 @@ declare module "util" {
|
|||||||
|
|
||||||
declare module "assert" {
|
declare module "assert" {
|
||||||
function internal (value: any, message?: string): void;
|
function internal (value: any, message?: string): void;
|
||||||
module internal {
|
namespace internal {
|
||||||
export class AssertionError implements Error {
|
export class AssertionError implements Error {
|
||||||
name: string;
|
name: string;
|
||||||
message: string;
|
message: string;
|
||||||
@ -1953,19 +2094,13 @@ declare module "tty" {
|
|||||||
declare module "domain" {
|
declare module "domain" {
|
||||||
import * as events from "events";
|
import * as events from "events";
|
||||||
|
|
||||||
export class Domain extends events.EventEmitter {
|
export class Domain extends events.EventEmitter implements NodeJS.Domain {
|
||||||
run(fn: Function): void;
|
run(fn: Function): void;
|
||||||
add(emitter: events.EventEmitter): void;
|
add(emitter: events.EventEmitter): void;
|
||||||
remove(emitter: events.EventEmitter): void;
|
remove(emitter: events.EventEmitter): void;
|
||||||
bind(cb: (err: Error, data: any) => any): any;
|
bind(cb: (err: Error, data: any) => any): any;
|
||||||
intercept(cb: (data: any) => any): any;
|
intercept(cb: (data: any) => any): any;
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
|
|
||||||
addListener(event: string, listener: Function): Domain;
|
|
||||||
on(event: string, listener: Function): Domain;
|
|
||||||
once(event: string, listener: Function): Domain;
|
|
||||||
removeListener(event: string, listener: Function): Domain;
|
|
||||||
removeAllListeners(event?: string): Domain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function create(): Domain;
|
export function create(): Domain;
|
||||||
|
4
ts/typings/main/ambient/colors/colors.d.ts
vendored
4
ts/typings/main/ambient/colors/colors.d.ts
vendored
@ -3,7 +3,7 @@
|
|||||||
// Type definitions for Colors.js 0.6.0-1
|
// Type definitions for Colors.js 0.6.0-1
|
||||||
// Project: https://github.com/Marak/colors.js
|
// Project: https://github.com/Marak/colors.js
|
||||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
declare module "colors" {
|
declare module "colors" {
|
||||||
interface Color {
|
interface Color {
|
||||||
@ -45,7 +45,7 @@ declare module "colors" {
|
|||||||
random: Color;
|
random: Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
module e {
|
namespace e {
|
||||||
export function setTheme(theme:any): void;
|
export function setTheme(theme:any): void;
|
||||||
|
|
||||||
export var black: Color;
|
export var black: Color;
|
||||||
|
329
ts/typings/main/ambient/node/node.d.ts
vendored
329
ts/typings/main/ambient/node/node.d.ts
vendored
@ -2,8 +2,8 @@
|
|||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
|
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
|
||||||
// Type definitions for Node.js v4.x
|
// Type definitions for Node.js v4.x
|
||||||
// Project: http://nodejs.org/
|
// Project: http://nodejs.org/
|
||||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
|
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
/************************************************
|
/************************************************
|
||||||
* *
|
* *
|
||||||
@ -16,9 +16,9 @@ interface Error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// compat for TypeScript 1.5.3
|
// compat for TypeScript 1.8
|
||||||
// if you use with --target es3 or --target es5 and use below definitions,
|
// if you use with --target es3 or --target es5 and use below definitions,
|
||||||
// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3.
|
// use the lib.es6.d.ts that is bundled with TypeScript 1.8.
|
||||||
interface MapConstructor {}
|
interface MapConstructor {}
|
||||||
interface WeakMapConstructor {}
|
interface WeakMapConstructor {}
|
||||||
interface SetConstructor {}
|
interface SetConstructor {}
|
||||||
@ -82,6 +82,7 @@ declare var SlowBuffer: {
|
|||||||
|
|
||||||
|
|
||||||
// Buffer class
|
// Buffer class
|
||||||
|
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex";
|
||||||
interface Buffer extends NodeBuffer {}
|
interface Buffer extends NodeBuffer {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +167,7 @@ declare var Buffer: {
|
|||||||
* GLOBAL INTERFACES *
|
* GLOBAL INTERFACES *
|
||||||
* *
|
* *
|
||||||
************************************************/
|
************************************************/
|
||||||
declare module NodeJS {
|
declare namespace NodeJS {
|
||||||
export interface ErrnoException extends Error {
|
export interface ErrnoException extends Error {
|
||||||
errno?: number;
|
errno?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
@ -176,12 +177,12 @@ declare module NodeJS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface EventEmitter {
|
export interface EventEmitter {
|
||||||
addListener(event: string, listener: Function): EventEmitter;
|
addListener(event: string, listener: Function): this;
|
||||||
on(event: string, listener: Function): EventEmitter;
|
on(event: string, listener: Function): this;
|
||||||
once(event: string, listener: Function): EventEmitter;
|
once(event: string, listener: Function): this;
|
||||||
removeListener(event: string, listener: Function): EventEmitter;
|
removeListener(event: string, listener: Function): this;
|
||||||
removeAllListeners(event?: string): EventEmitter;
|
removeAllListeners(event?: string): this;
|
||||||
setMaxListeners(n: number): EventEmitter;
|
setMaxListeners(n: number): this;
|
||||||
getMaxListeners(): number;
|
getMaxListeners(): number;
|
||||||
listeners(event: string): Function[];
|
listeners(event: string): Function[];
|
||||||
emit(event: string, ...args: any[]): boolean;
|
emit(event: string, ...args: any[]): boolean;
|
||||||
@ -213,6 +214,29 @@ declare module NodeJS {
|
|||||||
|
|
||||||
export interface ReadWriteStream extends ReadableStream, WritableStream {}
|
export interface ReadWriteStream extends ReadableStream, WritableStream {}
|
||||||
|
|
||||||
|
export interface Events extends EventEmitter { }
|
||||||
|
|
||||||
|
export interface Domain extends Events {
|
||||||
|
run(fn: Function): void;
|
||||||
|
add(emitter: Events): void;
|
||||||
|
remove(emitter: Events): void;
|
||||||
|
bind(cb: (err: Error, data: any) => any): any;
|
||||||
|
intercept(cb: (data: any) => any): any;
|
||||||
|
dispose(): void;
|
||||||
|
|
||||||
|
addListener(event: string, listener: Function): this;
|
||||||
|
on(event: string, listener: Function): this;
|
||||||
|
once(event: string, listener: Function): this;
|
||||||
|
removeListener(event: string, listener: Function): this;
|
||||||
|
removeAllListeners(event?: string): this;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MemoryUsage {
|
||||||
|
rss: number;
|
||||||
|
heapTotal: number;
|
||||||
|
heapUsed: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Process extends EventEmitter {
|
export interface Process extends EventEmitter {
|
||||||
stdout: WritableStream;
|
stdout: WritableStream;
|
||||||
stderr: WritableStream;
|
stderr: WritableStream;
|
||||||
@ -272,14 +296,17 @@ declare module NodeJS {
|
|||||||
title: string;
|
title: string;
|
||||||
arch: string;
|
arch: string;
|
||||||
platform: string;
|
platform: string;
|
||||||
memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; };
|
memoryUsage(): MemoryUsage;
|
||||||
nextTick(callback: Function): void;
|
nextTick(callback: Function): void;
|
||||||
umask(mask?: number): number;
|
umask(mask?: number): number;
|
||||||
uptime(): number;
|
uptime(): number;
|
||||||
hrtime(time?:number[]): number[];
|
hrtime(time?:number[]): number[];
|
||||||
|
domain: Domain;
|
||||||
|
|
||||||
// Worker
|
// Worker
|
||||||
send?(message: any, sendHandle?: any): void;
|
send?(message: any, sendHandle?: any): void;
|
||||||
|
disconnect(): void;
|
||||||
|
connected: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Global {
|
export interface Global {
|
||||||
@ -375,7 +402,7 @@ interface NodeBuffer {
|
|||||||
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||||
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||||
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||||
readUInt8(offset: number, noAsset?: boolean): number;
|
readUInt8(offset: number, noAssert?: boolean): number;
|
||||||
readUInt16LE(offset: number, noAssert?: boolean): number;
|
readUInt16LE(offset: number, noAssert?: boolean): number;
|
||||||
readUInt16BE(offset: number, noAssert?: boolean): number;
|
readUInt16BE(offset: number, noAssert?: boolean): number;
|
||||||
readUInt32LE(offset: number, noAssert?: boolean): number;
|
readUInt32LE(offset: number, noAssert?: boolean): number;
|
||||||
@ -442,12 +469,12 @@ declare module "events" {
|
|||||||
static listenerCount(emitter: EventEmitter, event: string): number; // deprecated
|
static listenerCount(emitter: EventEmitter, event: string): number; // deprecated
|
||||||
static defaultMaxListeners: number;
|
static defaultMaxListeners: number;
|
||||||
|
|
||||||
addListener(event: string, listener: Function): EventEmitter;
|
addListener(event: string, listener: Function): this;
|
||||||
on(event: string, listener: Function): EventEmitter;
|
on(event: string, listener: Function): this;
|
||||||
once(event: string, listener: Function): EventEmitter;
|
once(event: string, listener: Function): this;
|
||||||
removeListener(event: string, listener: Function): EventEmitter;
|
removeListener(event: string, listener: Function): this;
|
||||||
removeAllListeners(event?: string): EventEmitter;
|
removeAllListeners(event?: string): this;
|
||||||
setMaxListeners(n: number): EventEmitter;
|
setMaxListeners(n: number): this;
|
||||||
getMaxListeners(): number;
|
getMaxListeners(): number;
|
||||||
listeners(event: string): Function[];
|
listeners(event: string): Function[];
|
||||||
emit(event: string, ...args: any[]): boolean;
|
emit(event: string, ...args: any[]): boolean;
|
||||||
@ -475,14 +502,10 @@ declare module "http" {
|
|||||||
agent?: Agent|boolean;
|
agent?: Agent|boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Server extends events.EventEmitter {
|
export interface Server extends events.EventEmitter, net.Server {
|
||||||
listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
|
setTimeout(msecs: number, callback: Function): void;
|
||||||
listen(port: number, hostname?: string, callback?: Function): Server;
|
|
||||||
listen(path: string, callback?: Function): Server;
|
|
||||||
listen(handle: any, listeningListener?: Function): Server;
|
|
||||||
close(cb?: any): Server;
|
|
||||||
address(): { port: number; family: string; address: string; };
|
|
||||||
maxHeadersCount: number;
|
maxHeadersCount: number;
|
||||||
|
timeout: number;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @deprecated Use IncomingMessage
|
* @deprecated Use IncomingMessage
|
||||||
@ -532,6 +555,11 @@ declare module "http" {
|
|||||||
setNoDelay(noDelay?: boolean): void;
|
setNoDelay(noDelay?: boolean): void;
|
||||||
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
||||||
|
|
||||||
|
setHeader(name: string, value: string | string[]): void;
|
||||||
|
getHeader(name: string): string;
|
||||||
|
removeHeader(name: string): void;
|
||||||
|
addTrailers(headers: any): void;
|
||||||
|
|
||||||
// Extended base methods
|
// Extended base methods
|
||||||
end(): void;
|
end(): void;
|
||||||
end(buffer: Buffer, cb?: Function): void;
|
end(buffer: Buffer, cb?: Function): void;
|
||||||
@ -628,6 +656,12 @@ declare module "cluster" {
|
|||||||
silent?: boolean;
|
silent?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Address {
|
||||||
|
address: string;
|
||||||
|
port: number;
|
||||||
|
addressType: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class Worker extends events.EventEmitter {
|
export class Worker extends events.EventEmitter {
|
||||||
id: string;
|
id: string;
|
||||||
process: child.ChildProcess;
|
process: child.ChildProcess;
|
||||||
@ -900,15 +934,34 @@ declare module "readline" {
|
|||||||
|
|
||||||
declare module "vm" {
|
declare module "vm" {
|
||||||
export interface Context { }
|
export interface Context { }
|
||||||
export interface Script {
|
export interface ScriptOptions {
|
||||||
runInThisContext(): void;
|
filename?: string;
|
||||||
runInNewContext(sandbox?: Context): void;
|
lineOffset?: number;
|
||||||
|
columnOffset?: number;
|
||||||
|
displayErrors?: boolean;
|
||||||
|
timeout?: number;
|
||||||
|
cachedData?: Buffer;
|
||||||
|
produceCachedData?: boolean;
|
||||||
}
|
}
|
||||||
export function runInThisContext(code: string, filename?: string): void;
|
export interface RunningScriptOptions {
|
||||||
export function runInNewContext(code: string, sandbox?: Context, filename?: string): void;
|
filename?: string;
|
||||||
export function runInContext(code: string, context: Context, filename?: string): void;
|
lineOffset?: number;
|
||||||
export function createContext(initSandbox?: Context): Context;
|
columnOffset?: number;
|
||||||
export function createScript(code: string, filename?: string): Script;
|
displayErrors?: boolean;
|
||||||
|
timeout?: number;
|
||||||
|
}
|
||||||
|
export class Script {
|
||||||
|
constructor(code: string, options?: ScriptOptions);
|
||||||
|
runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
|
||||||
|
runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
|
||||||
|
runInThisContext(options?: RunningScriptOptions): any;
|
||||||
|
}
|
||||||
|
export function createContext(sandbox?: Context): Context;
|
||||||
|
export function isContext(sandbox: Context): boolean;
|
||||||
|
export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any;
|
||||||
|
export function runInDebugContext(code: string): any;
|
||||||
|
export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any;
|
||||||
|
export function runInThisContext(code: string, options?: RunningScriptOptions): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "child_process" {
|
declare module "child_process" {
|
||||||
@ -919,7 +972,7 @@ declare module "child_process" {
|
|||||||
stdin: stream.Writable;
|
stdin: stream.Writable;
|
||||||
stdout: stream.Readable;
|
stdout: stream.Readable;
|
||||||
stderr: stream.Readable;
|
stderr: stream.Readable;
|
||||||
stdio: (stream.Readable|stream.Writable)[];
|
stdio: [stream.Writable, stream.Readable, stream.Readable];
|
||||||
pid: number;
|
pid: number;
|
||||||
kill(signal?: string): void;
|
kill(signal?: string): void;
|
||||||
send(message: any, sendHandle?: any): void;
|
send(message: any, sendHandle?: any): void;
|
||||||
@ -927,39 +980,66 @@ declare module "child_process" {
|
|||||||
unref(): void;
|
unref(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function spawn(command: string, args?: string[], options?: {
|
export interface SpawnOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
stdio?: any;
|
|
||||||
custom?: any;
|
|
||||||
env?: any;
|
env?: any;
|
||||||
|
stdio?: any;
|
||||||
detached?: boolean;
|
detached?: boolean;
|
||||||
}): ChildProcess;
|
uid?: number;
|
||||||
export function exec(command: string, options: {
|
gid?: number;
|
||||||
|
shell?: boolean | string;
|
||||||
|
}
|
||||||
|
export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
|
||||||
|
|
||||||
|
export interface ExecOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
stdio?: any;
|
|
||||||
customFds?: any;
|
|
||||||
env?: any;
|
env?: any;
|
||||||
encoding?: string;
|
shell?: string;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
maxBuffer?: number;
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
uid?: number;
|
||||||
export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
gid?: number;
|
||||||
export function execFile(file: string,
|
}
|
||||||
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
export interface ExecOptionsWithStringEncoding extends ExecOptions {
|
||||||
export function execFile(file: string, args?: string[],
|
encoding: BufferEncoding;
|
||||||
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
}
|
||||||
export function execFile(file: string, args?: string[], options?: {
|
export interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
// usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {});
|
||||||
|
export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||||
|
export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
|
||||||
|
export interface ExecFileOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
stdio?: any;
|
|
||||||
customFds?: any;
|
|
||||||
env?: any;
|
env?: any;
|
||||||
encoding?: string;
|
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
maxBuffer?: number;
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
uid?: number;
|
||||||
export function fork(modulePath: string, args?: string[], options?: {
|
gid?: number;
|
||||||
|
}
|
||||||
|
export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
// usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {});
|
||||||
|
export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
// usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {});
|
||||||
|
export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
|
||||||
|
export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess;
|
||||||
|
|
||||||
|
export interface ForkOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
env?: any;
|
env?: any;
|
||||||
execPath?: string;
|
execPath?: string;
|
||||||
@ -967,8 +1047,10 @@ declare module "child_process" {
|
|||||||
silent?: boolean;
|
silent?: boolean;
|
||||||
uid?: number;
|
uid?: number;
|
||||||
gid?: number;
|
gid?: number;
|
||||||
}): ChildProcess;
|
}
|
||||||
export function spawnSync(command: string, args?: string[], options?: {
|
export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess;
|
||||||
|
|
||||||
|
export interface SpawnSyncOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
input?: string | Buffer;
|
input?: string | Buffer;
|
||||||
stdio?: any;
|
stdio?: any;
|
||||||
@ -976,42 +1058,83 @@ declare module "child_process" {
|
|||||||
uid?: number;
|
uid?: number;
|
||||||
gid?: number;
|
gid?: number;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
|
maxBuffer?: number;
|
||||||
encoding?: string;
|
encoding?: string;
|
||||||
}): {
|
shell?: boolean | string;
|
||||||
|
}
|
||||||
|
export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export interface SpawnSyncReturns<T> {
|
||||||
pid: number;
|
pid: number;
|
||||||
output: string[];
|
output: string[];
|
||||||
stdout: string | Buffer;
|
stdout: T;
|
||||||
stderr: string | Buffer;
|
stderr: T;
|
||||||
status: number;
|
status: number;
|
||||||
signal: string;
|
signal: string;
|
||||||
error: Error;
|
error: Error;
|
||||||
};
|
}
|
||||||
export function execSync(command: string, options?: {
|
export function spawnSync(command: string): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||||
|
export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||||
|
export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||||
|
export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
||||||
|
|
||||||
|
export interface ExecSyncOptions {
|
||||||
cwd?: string;
|
cwd?: string;
|
||||||
input?: string|Buffer;
|
input?: string | Buffer;
|
||||||
|
stdio?: any;
|
||||||
|
env?: any;
|
||||||
|
shell?: string;
|
||||||
|
uid?: number;
|
||||||
|
gid?: number;
|
||||||
|
timeout?: number;
|
||||||
|
killSignal?: string;
|
||||||
|
maxBuffer?: number;
|
||||||
|
encoding?: string;
|
||||||
|
}
|
||||||
|
export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function execSync(command: string): Buffer;
|
||||||
|
export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
|
||||||
|
export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
|
||||||
|
export function execSync(command: string, options?: ExecSyncOptions): Buffer;
|
||||||
|
|
||||||
|
export interface ExecFileSyncOptions {
|
||||||
|
cwd?: string;
|
||||||
|
input?: string | Buffer;
|
||||||
stdio?: any;
|
stdio?: any;
|
||||||
env?: any;
|
env?: any;
|
||||||
uid?: number;
|
uid?: number;
|
||||||
gid?: number;
|
gid?: number;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
maxBuffer?: number;
|
|
||||||
killSignal?: string;
|
killSignal?: string;
|
||||||
encoding?: string;
|
|
||||||
}): string | Buffer;
|
|
||||||
export function execFileSync(command: string, args?: string[], options?: {
|
|
||||||
cwd?: string;
|
|
||||||
input?: string|Buffer;
|
|
||||||
stdio?: any;
|
|
||||||
env?: any;
|
|
||||||
uid?: number;
|
|
||||||
gid?: number;
|
|
||||||
timeout?: number;
|
|
||||||
maxBuffer?: number;
|
maxBuffer?: number;
|
||||||
killSignal?: string;
|
|
||||||
encoding?: string;
|
encoding?: string;
|
||||||
}): string | Buffer;
|
}
|
||||||
|
export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
|
||||||
|
encoding: BufferEncoding;
|
||||||
|
}
|
||||||
|
export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
||||||
|
encoding: string; // specify `null`.
|
||||||
|
}
|
||||||
|
export function execFileSync(command: string): Buffer;
|
||||||
|
export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
||||||
|
export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||||
|
export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
|
||||||
|
export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string;
|
||||||
|
export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||||
|
export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "url" {
|
declare module "url" {
|
||||||
@ -1096,12 +1219,29 @@ declare module "net" {
|
|||||||
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
|
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface ListenOptions {
|
||||||
|
port?: number;
|
||||||
|
host?: string;
|
||||||
|
backlog?: number;
|
||||||
|
path?: string;
|
||||||
|
exclusive?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Server extends Socket {
|
export interface Server extends Socket {
|
||||||
listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server;
|
listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server;
|
||||||
|
listen(port: number, hostname?: string, listeningListener?: Function): Server;
|
||||||
|
listen(port: number, backlog?: number, listeningListener?: Function): Server;
|
||||||
|
listen(port: number, listeningListener?: Function): Server;
|
||||||
|
listen(path: string, backlog?: number, listeningListener?: Function): Server;
|
||||||
listen(path: string, listeningListener?: Function): Server;
|
listen(path: string, listeningListener?: Function): Server;
|
||||||
|
listen(handle: any, backlog?: number, listeningListener?: Function): Server;
|
||||||
listen(handle: any, listeningListener?: Function): Server;
|
listen(handle: any, listeningListener?: Function): Server;
|
||||||
|
listen(options: ListenOptions, listeningListener?: Function): Server;
|
||||||
close(callback?: Function): Server;
|
close(callback?: Function): Server;
|
||||||
address(): { port: number; family: string; address: string; };
|
address(): { port: number; family: string; address: string; };
|
||||||
|
getConnections(cb: (error: Error, count: number) => void): void;
|
||||||
|
ref(): Server;
|
||||||
|
unref(): Server;
|
||||||
maxConnections: number;
|
maxConnections: number;
|
||||||
connections: number;
|
connections: number;
|
||||||
}
|
}
|
||||||
@ -1329,7 +1469,8 @@ declare module "fs" {
|
|||||||
export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
||||||
export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
||||||
export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
|
||||||
export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
|
export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number;
|
||||||
|
export function writeSync(fd: number, data: any, position?: number, enconding?: string): number;
|
||||||
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
|
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
|
||||||
export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
|
export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;
|
||||||
/*
|
/*
|
||||||
@ -1625,12 +1766,6 @@ declare module "tls" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Server extends net.Server {
|
export interface Server extends net.Server {
|
||||||
// Extended base methods
|
|
||||||
listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server;
|
|
||||||
listen(path: string, listeningListener?: Function): Server;
|
|
||||||
listen(handle: any, listeningListener?: Function): Server;
|
|
||||||
|
|
||||||
listen(port: number, host?: string, callback?: Function): Server;
|
|
||||||
close(): Server;
|
close(): Server;
|
||||||
address(): { port: number; family: string; address: string; };
|
address(): { port: number; family: string; address: string; };
|
||||||
addContext(hostName: string, credentials: {
|
addContext(hostName: string, credentials: {
|
||||||
@ -1716,21 +1851,27 @@ declare module "crypto" {
|
|||||||
}
|
}
|
||||||
export function createCipher(algorithm: string, password: any): Cipher;
|
export function createCipher(algorithm: string, password: any): Cipher;
|
||||||
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
||||||
export interface Cipher {
|
export interface Cipher extends NodeJS.ReadWriteStream {
|
||||||
update(data: Buffer): Buffer;
|
update(data: Buffer): Buffer;
|
||||||
update(data: string, input_encoding?: string, output_encoding?: string): string;
|
update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer;
|
||||||
|
update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string;
|
||||||
|
update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string;
|
||||||
final(): Buffer;
|
final(): Buffer;
|
||||||
final(output_encoding: string): string;
|
final(output_encoding: string): string;
|
||||||
setAutoPadding(auto_padding: boolean): void;
|
setAutoPadding(auto_padding: boolean): void;
|
||||||
|
getAuthTag(): Buffer;
|
||||||
}
|
}
|
||||||
export function createDecipher(algorithm: string, password: any): Decipher;
|
export function createDecipher(algorithm: string, password: any): Decipher;
|
||||||
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
|
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
|
||||||
export interface Decipher {
|
export interface Decipher extends NodeJS.ReadWriteStream {
|
||||||
update(data: Buffer): Buffer;
|
update(data: Buffer): Buffer;
|
||||||
update(data: string, input_encoding?: string, output_encoding?: string): string;
|
update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer;
|
||||||
|
update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string;
|
||||||
|
update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string;
|
||||||
final(): Buffer;
|
final(): Buffer;
|
||||||
final(output_encoding: string): string;
|
final(output_encoding: string): string;
|
||||||
setAutoPadding(auto_padding: boolean): void;
|
setAutoPadding(auto_padding: boolean): void;
|
||||||
|
setAuthTag(tag: Buffer): void;
|
||||||
}
|
}
|
||||||
export function createSign(algorithm: string): Signer;
|
export function createSign(algorithm: string): Signer;
|
||||||
export interface Signer extends NodeJS.WritableStream {
|
export interface Signer extends NodeJS.WritableStream {
|
||||||
@ -1891,7 +2032,7 @@ declare module "util" {
|
|||||||
|
|
||||||
declare module "assert" {
|
declare module "assert" {
|
||||||
function internal (value: any, message?: string): void;
|
function internal (value: any, message?: string): void;
|
||||||
module internal {
|
namespace internal {
|
||||||
export class AssertionError implements Error {
|
export class AssertionError implements Error {
|
||||||
name: string;
|
name: string;
|
||||||
message: string;
|
message: string;
|
||||||
@ -1953,19 +2094,13 @@ declare module "tty" {
|
|||||||
declare module "domain" {
|
declare module "domain" {
|
||||||
import * as events from "events";
|
import * as events from "events";
|
||||||
|
|
||||||
export class Domain extends events.EventEmitter {
|
export class Domain extends events.EventEmitter implements NodeJS.Domain {
|
||||||
run(fn: Function): void;
|
run(fn: Function): void;
|
||||||
add(emitter: events.EventEmitter): void;
|
add(emitter: events.EventEmitter): void;
|
||||||
remove(emitter: events.EventEmitter): void;
|
remove(emitter: events.EventEmitter): void;
|
||||||
bind(cb: (err: Error, data: any) => any): any;
|
bind(cb: (err: Error, data: any) => any): any;
|
||||||
intercept(cb: (data: any) => any): any;
|
intercept(cb: (data: any) => any): any;
|
||||||
dispose(): void;
|
dispose(): void;
|
||||||
|
|
||||||
addListener(event: string, listener: Function): Domain;
|
|
||||||
on(event: string, listener: Function): Domain;
|
|
||||||
once(event: string, listener: Function): Domain;
|
|
||||||
removeListener(event: string, listener: Function): Domain;
|
|
||||||
removeAllListeners(event?: string): Domain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function create(): Domain;
|
export function create(): Domain;
|
||||||
|
Loading…
Reference in New Issue
Block a user