This commit is contained in:
Philipp Kunz 2016-04-04 22:17:56 +02:00
parent a28f3ecc1d
commit fdc4a3bfde
11 changed files with 540 additions and 308 deletions

View File

@ -1,7 +1,7 @@
/// <reference path="./typings/main.d.ts" />
exports.log = require("./beautylog.node.log");
exports.table = require("./beautylog.node.table");
exports.code = require("./beautylog.node.code");
//handle figlet
var figletModule = require("./beautylog.node.figlet");
exports.figlet = figletModule.figlet;
exports.figletSync = figletModule.figletSync;
@ -54,4 +54,4 @@ exports.warn = function (logText) {
return exports.log(logText, 'warn');
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUU5QixXQUFHLFdBQVcsc0JBQXNCLENBQUMsQ0FBQztBQUN0QyxhQUFLLFdBQVcsd0JBQXdCLENBQUMsQ0FBQztBQUMxQyxZQUFJLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUN0RCxJQUFPLFlBQVksV0FBVyx5QkFBeUIsQ0FBQyxDQUFDO0FBRTlDLGNBQU0sR0FBRyxZQUFZLENBQUMsTUFBTSxDQUFDO0FBQzdCLGtCQUFVLEdBQUcsWUFBWSxDQUFDLFVBQVUsQ0FBQztBQUNoRDs7OztHQUlHO0FBQ1EsV0FBRyxHQUFHLFVBQVMsT0FBTztJQUM3QixNQUFNLENBQUMsV0FBRyxDQUFDLE9BQU8sRUFBRSxLQUFLLENBQUMsQ0FBQztBQUMvQixDQUFDLENBQUM7QUFHRjs7OztHQUlHO0FBQ1EsYUFBSyxHQUFHLFVBQVMsT0FBTztJQUMvQixNQUFNLENBQUMsV0FBRyxDQUFDLE9BQU8sRUFBRSxPQUFPLENBQUMsQ0FBQztBQUNqQyxDQUFDLENBQUM7QUFFRjs7OztHQUlHO0FBQ1EsWUFBSSxHQUFHLFVBQVMsT0FBTztJQUM5QixNQUFNLENBQUMsV0FBR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9ncyBhICd3YXJuOicgbWVzc2FnZSB0byBjb25zb2xlXG4gKiBAcGFyYW0gbG9nVGV4dCBzdHJpbmcgdG8gbG9nIGFzIGVycm9yXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn1cbiAqL1xuZXhwb3J0IGxldCB3YXJuID0gZnVuY3Rpb24obG9nVGV4dCkge1xuICAgIHJldHVybiBsb2cobG9nVGV4dCwgJ3dhcm4nKTtcbn07Il0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9

View File

@ -34,15 +34,14 @@
"cli-table2": "^0.2.0",
"colors": "1.1.2",
"figlet": "^1.1.1",
"hlight": "0.0.8",
"lodash": "^4.5.1",
"lodash": "^4.8.1",
"q": "^1.4.1",
"smartenv": "1.0.10"
"smartenv": "1.2.1"
},
"devDependencies": {
"easyserve": "0.0.5",
"gulp": "^3.9.1",
"gulp-browser": "1.0.10",
"npmts": "3.1.2"
"gulp-browser": "1.2.2",
"npmts": "4.0.2"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,IAAI,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACnC,IAAI,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAE5C,QAAQ,CAAC,WAAW,EAAC;IACjB,QAAQ,CAAC,uBAAuB,EAAC;QAC7B,EAAE,CAAC,sBAAsB,EAAC;YACtB,SAAS,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,uDAAuD,EAAC;YACvD,SAAS,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;YACvE,SAAS,CAAC,GAAG,CAAC,0DAA0D,EAAC,KAAK,CAAC,CAAC;YAChF,SAAS,CAAC,GAAG,CAAC,4DAA4D,EAAC,OAAO,CAAC,CAAC;YACpF,SAAS,CAAC,GAAG,CAAC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,IAAI,CAAC,CAAC,QAAQ,EAAC,OAAO,CAAC,CAAC,CAAC;gBACpC,UAAU,CAAC,KAAK,EAAE,CAAC;gBAEnB,IAAI,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAC,CAAC,SAAS,CAAC,GAAG,EAAC,SAAS,CAAC,IAAI,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC7F,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAC,MAAM,EAAC,OAAO,CAAC,CAAC,CAAC;gBACxC,UAAU,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC,CAAC,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,SAAS,EAAC;QACf,EAAE,CAAC,8CAA8C,EAAC,UAAS,IAAI;YAC3D,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAC,EAAC,IAAI,EAAC,WAAW,EAAC,KAAK,EAAC,QAAQ,EAAC,CAAC,CAAC,IAAI,CAAC,IAAI,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"}

View File

@ -72,17 +72,6 @@ describe("beautylog",function(){
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"
}
);
})
})
});

View File

@ -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;

View File

@ -2,9 +2,9 @@
export import log = require("./beautylog.node.log");
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 figletSync = figletModule.figletSync;
/**

View File

@ -3,7 +3,7 @@
// Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js
// 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" {
interface Color {
@ -45,7 +45,7 @@ declare module "colors" {
random: Color;
}
module e {
namespace e {
export function setTheme(theme:any): void;
export var black: Color;

View File

@ -2,8 +2,8 @@
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
// Type definitions for Node.js v4.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/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,
// 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 WeakMapConstructor {}
interface SetConstructor {}
@ -82,6 +82,7 @@ declare var SlowBuffer: {
// Buffer class
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex";
interface Buffer extends NodeBuffer {}
/**
@ -166,7 +167,7 @@ declare var Buffer: {
* GLOBAL INTERFACES *
* *
************************************************/
declare module NodeJS {
declare namespace NodeJS {
export interface ErrnoException extends Error {
errno?: number;
code?: string;
@ -176,12 +177,12 @@ declare module NodeJS {
}
export interface EventEmitter {
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
once(event: string, listener: Function): EventEmitter;
removeListener(event: string, listener: Function): EventEmitter;
removeAllListeners(event?: string): EventEmitter;
setMaxListeners(n: number): EventEmitter;
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;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
@ -213,6 +214,29 @@ declare module NodeJS {
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 {
stdout: WritableStream;
stderr: WritableStream;
@ -272,14 +296,17 @@ declare module NodeJS {
title: string;
arch: string;
platform: string;
memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; };
memoryUsage(): MemoryUsage;
nextTick(callback: Function): void;
umask(mask?: number): number;
uptime(): number;
hrtime(time?:number[]): number[];
domain: Domain;
// Worker
send?(message: any, sendHandle?: any): void;
disconnect(): void;
connected: boolean;
}
export interface Global {
@ -375,7 +402,7 @@ interface NodeBuffer {
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntLE(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;
readUInt16BE(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 defaultMaxListeners: number;
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
once(event: string, listener: Function): EventEmitter;
removeListener(event: string, listener: Function): EventEmitter;
removeAllListeners(event?: string): EventEmitter;
setMaxListeners(n: number): EventEmitter;
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;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
@ -475,14 +502,10 @@ declare module "http" {
agent?: Agent|boolean;
}
export interface Server extends events.EventEmitter {
listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
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; };
export interface Server extends events.EventEmitter, net.Server {
setTimeout(msecs: number, callback: Function): void;
maxHeadersCount: number;
timeout: number;
}
/**
* @deprecated Use IncomingMessage
@ -532,6 +555,11 @@ declare module "http" {
setNoDelay(noDelay?: boolean): 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
end(): void;
end(buffer: Buffer, cb?: Function): void;
@ -569,41 +597,41 @@ declare module "http" {
*/
export interface ClientResponse extends IncomingMessage { }
export interface AgentOptions {
/**
* Keep sockets around in a pool to be used by other requests in the future. Default = false
*/
keepAlive?: boolean;
/**
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
* Only relevant if keepAlive is set to true.
*/
keepAliveMsecs?: number;
/**
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
*/
maxSockets?: number;
/**
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
*/
maxFreeSockets?: number;
}
export interface AgentOptions {
/**
* Keep sockets around in a pool to be used by other requests in the future. Default = false
*/
keepAlive?: boolean;
/**
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
* Only relevant if keepAlive is set to true.
*/
keepAliveMsecs?: number;
/**
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
*/
maxSockets?: number;
/**
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
*/
maxFreeSockets?: number;
}
export class Agent {
maxSockets: number;
sockets: any;
requests: any;
maxSockets: number;
sockets: any;
requests: any;
constructor(opts?: AgentOptions);
constructor(opts?: AgentOptions);
/**
* Destroy any sockets that are currently in use by the agent.
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
* sockets may hang open for quite a long time before the server terminates them.
*/
destroy(): void;
}
/**
* Destroy any sockets that are currently in use by the agent.
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
* sockets may hang open for quite a long time before the server terminates them.
*/
destroy(): void;
}
export var METHODS: string[];
@ -628,6 +656,12 @@ declare module "cluster" {
silent?: boolean;
}
export interface Address {
address: string;
port: number;
addressType: string;
}
export class Worker extends events.EventEmitter {
id: string;
process: child.ChildProcess;
@ -900,15 +934,34 @@ declare module "readline" {
declare module "vm" {
export interface Context { }
export interface Script {
runInThisContext(): void;
runInNewContext(sandbox?: Context): void;
export interface ScriptOptions {
filename?: string;
lineOffset?: number;
columnOffset?: number;
displayErrors?: boolean;
timeout?: number;
cachedData?: Buffer;
produceCachedData?: boolean;
}
export function runInThisContext(code: string, filename?: string): void;
export function runInNewContext(code: string, sandbox?: Context, filename?: string): void;
export function runInContext(code: string, context: Context, filename?: string): void;
export function createContext(initSandbox?: Context): Context;
export function createScript(code: string, filename?: string): Script;
export interface RunningScriptOptions {
filename?: string;
lineOffset?: number;
columnOffset?: number;
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" {
@ -919,7 +972,7 @@ declare module "child_process" {
stdin: stream.Writable;
stdout: stream.Readable;
stderr: stream.Readable;
stdio: (stream.Readable|stream.Writable)[];
stdio: [stream.Writable, stream.Readable, stream.Readable];
pid: number;
kill(signal?: string): void;
send(message: any, sendHandle?: any): void;
@ -927,39 +980,66 @@ declare module "child_process" {
unref(): void;
}
export function spawn(command: string, args?: string[], options?: {
export interface SpawnOptions {
cwd?: string;
stdio?: any;
custom?: any;
env?: any;
stdio?: any;
detached?: boolean;
}): ChildProcess;
export function exec(command: string, options: {
uid?: number;
gid?: number;
shell?: boolean | string;
}
export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
export interface ExecOptions {
cwd?: string;
stdio?: any;
customFds?: any;
env?: any;
encoding?: string;
shell?: string;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function execFile(file: string,
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function execFile(file: string, args?: string[],
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function execFile(file: string, args?: string[], options?: {
uid?: number;
gid?: number;
}
export interface ExecOptionsWithStringEncoding extends ExecOptions {
encoding: BufferEncoding;
}
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;
stdio?: any;
customFds?: any;
env?: any;
encoding?: string;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function fork(modulePath: string, args?: string[], options?: {
uid?: number;
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;
env?: any;
execPath?: string;
@ -967,8 +1047,10 @@ declare module "child_process" {
silent?: boolean;
uid?: 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;
input?: string | Buffer;
stdio?: any;
@ -976,42 +1058,83 @@ declare module "child_process" {
uid?: number;
gid?: number;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
maxBuffer?: number;
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;
output: string[];
stdout: string | Buffer;
stderr: string | Buffer;
stdout: T;
stderr: T;
status: number;
signal: string;
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;
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;
env?: any;
uid?: number;
gid?: number;
timeout?: number;
maxBuffer?: number;
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;
killSignal?: 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" {
@ -1096,12 +1219,29 @@ declare module "net" {
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 {
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(handle: any, backlog?: number, listeningListener?: Function): Server;
listen(handle: any, listeningListener?: Function): Server;
listen(options: ListenOptions, listeningListener?: Function): Server;
close(callback?: Function): Server;
address(): { port: number; family: string; address: string; };
getConnections(cb: (error: Error, count: number) => void): void;
ref(): Server;
unref(): Server;
maxConnections: 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, 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 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 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 {
// 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;
address(): { port: number; family: string; address: string; };
addContext(hostName: string, credentials: {
@ -1716,21 +1851,27 @@ declare module "crypto" {
}
export function createCipher(algorithm: string, password: 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: 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(output_encoding: string): string;
setAutoPadding(auto_padding: boolean): void;
getAuthTag(): Buffer;
}
export function createDecipher(algorithm: string, password: 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: 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(output_encoding: string): string;
setAutoPadding(auto_padding: boolean): void;
setAuthTag(tag: Buffer): void;
}
export function createSign(algorithm: string): Signer;
export interface Signer extends NodeJS.WritableStream {
@ -1891,7 +2032,7 @@ declare module "util" {
declare module "assert" {
function internal (value: any, message?: string): void;
module internal {
namespace internal {
export class AssertionError implements Error {
name: string;
message: string;
@ -1953,19 +2094,13 @@ declare module "tty" {
declare module "domain" {
import * as events from "events";
export class Domain extends events.EventEmitter {
export class Domain extends events.EventEmitter implements NodeJS.Domain {
run(fn: Function): void;
add(emitter: events.EventEmitter): void;
remove(emitter: events.EventEmitter): void;
bind(cb: (err: Error, data: any) => any): any;
intercept(cb: (data: any) => any): any;
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;

View File

@ -3,7 +3,7 @@
// Type definitions for Colors.js 0.6.0-1
// Project: https://github.com/Marak/colors.js
// 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" {
interface Color {
@ -45,7 +45,7 @@ declare module "colors" {
random: Color;
}
module e {
namespace e {
export function setTheme(theme:any): void;
export var black: Color;

View File

@ -2,8 +2,8 @@
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/node/node.d.ts
// Type definitions for Node.js v4.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/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,
// 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 WeakMapConstructor {}
interface SetConstructor {}
@ -82,6 +82,7 @@ declare var SlowBuffer: {
// Buffer class
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex";
interface Buffer extends NodeBuffer {}
/**
@ -166,7 +167,7 @@ declare var Buffer: {
* GLOBAL INTERFACES *
* *
************************************************/
declare module NodeJS {
declare namespace NodeJS {
export interface ErrnoException extends Error {
errno?: number;
code?: string;
@ -176,12 +177,12 @@ declare module NodeJS {
}
export interface EventEmitter {
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
once(event: string, listener: Function): EventEmitter;
removeListener(event: string, listener: Function): EventEmitter;
removeAllListeners(event?: string): EventEmitter;
setMaxListeners(n: number): EventEmitter;
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;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
@ -213,6 +214,29 @@ declare module NodeJS {
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 {
stdout: WritableStream;
stderr: WritableStream;
@ -272,14 +296,17 @@ declare module NodeJS {
title: string;
arch: string;
platform: string;
memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; };
memoryUsage(): MemoryUsage;
nextTick(callback: Function): void;
umask(mask?: number): number;
uptime(): number;
hrtime(time?:number[]): number[];
domain: Domain;
// Worker
send?(message: any, sendHandle?: any): void;
disconnect(): void;
connected: boolean;
}
export interface Global {
@ -375,7 +402,7 @@ interface NodeBuffer {
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntLE(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;
readUInt16BE(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 defaultMaxListeners: number;
addListener(event: string, listener: Function): EventEmitter;
on(event: string, listener: Function): EventEmitter;
once(event: string, listener: Function): EventEmitter;
removeListener(event: string, listener: Function): EventEmitter;
removeAllListeners(event?: string): EventEmitter;
setMaxListeners(n: number): EventEmitter;
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;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: string): Function[];
emit(event: string, ...args: any[]): boolean;
@ -475,14 +502,10 @@ declare module "http" {
agent?: Agent|boolean;
}
export interface Server extends events.EventEmitter {
listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
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; };
export interface Server extends events.EventEmitter, net.Server {
setTimeout(msecs: number, callback: Function): void;
maxHeadersCount: number;
timeout: number;
}
/**
* @deprecated Use IncomingMessage
@ -532,6 +555,11 @@ declare module "http" {
setNoDelay(noDelay?: boolean): 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
end(): void;
end(buffer: Buffer, cb?: Function): void;
@ -569,41 +597,41 @@ declare module "http" {
*/
export interface ClientResponse extends IncomingMessage { }
export interface AgentOptions {
/**
* Keep sockets around in a pool to be used by other requests in the future. Default = false
*/
keepAlive?: boolean;
/**
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
* Only relevant if keepAlive is set to true.
*/
keepAliveMsecs?: number;
/**
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
*/
maxSockets?: number;
/**
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
*/
maxFreeSockets?: number;
}
export interface AgentOptions {
/**
* Keep sockets around in a pool to be used by other requests in the future. Default = false
*/
keepAlive?: boolean;
/**
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
* Only relevant if keepAlive is set to true.
*/
keepAliveMsecs?: number;
/**
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
*/
maxSockets?: number;
/**
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
*/
maxFreeSockets?: number;
}
export class Agent {
maxSockets: number;
sockets: any;
requests: any;
maxSockets: number;
sockets: any;
requests: any;
constructor(opts?: AgentOptions);
constructor(opts?: AgentOptions);
/**
* Destroy any sockets that are currently in use by the agent.
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
* sockets may hang open for quite a long time before the server terminates them.
*/
destroy(): void;
}
/**
* Destroy any sockets that are currently in use by the agent.
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
* sockets may hang open for quite a long time before the server terminates them.
*/
destroy(): void;
}
export var METHODS: string[];
@ -628,6 +656,12 @@ declare module "cluster" {
silent?: boolean;
}
export interface Address {
address: string;
port: number;
addressType: string;
}
export class Worker extends events.EventEmitter {
id: string;
process: child.ChildProcess;
@ -900,15 +934,34 @@ declare module "readline" {
declare module "vm" {
export interface Context { }
export interface Script {
runInThisContext(): void;
runInNewContext(sandbox?: Context): void;
export interface ScriptOptions {
filename?: string;
lineOffset?: number;
columnOffset?: number;
displayErrors?: boolean;
timeout?: number;
cachedData?: Buffer;
produceCachedData?: boolean;
}
export function runInThisContext(code: string, filename?: string): void;
export function runInNewContext(code: string, sandbox?: Context, filename?: string): void;
export function runInContext(code: string, context: Context, filename?: string): void;
export function createContext(initSandbox?: Context): Context;
export function createScript(code: string, filename?: string): Script;
export interface RunningScriptOptions {
filename?: string;
lineOffset?: number;
columnOffset?: number;
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" {
@ -919,7 +972,7 @@ declare module "child_process" {
stdin: stream.Writable;
stdout: stream.Readable;
stderr: stream.Readable;
stdio: (stream.Readable|stream.Writable)[];
stdio: [stream.Writable, stream.Readable, stream.Readable];
pid: number;
kill(signal?: string): void;
send(message: any, sendHandle?: any): void;
@ -927,39 +980,66 @@ declare module "child_process" {
unref(): void;
}
export function spawn(command: string, args?: string[], options?: {
export interface SpawnOptions {
cwd?: string;
stdio?: any;
custom?: any;
env?: any;
stdio?: any;
detached?: boolean;
}): ChildProcess;
export function exec(command: string, options: {
uid?: number;
gid?: number;
shell?: boolean | string;
}
export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;
export interface ExecOptions {
cwd?: string;
stdio?: any;
customFds?: any;
env?: any;
encoding?: string;
shell?: string;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function execFile(file: string,
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function execFile(file: string, args?: string[],
callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function execFile(file: string, args?: string[], options?: {
uid?: number;
gid?: number;
}
export interface ExecOptionsWithStringEncoding extends ExecOptions {
encoding: BufferEncoding;
}
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;
stdio?: any;
customFds?: any;
env?: any;
encoding?: string;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
}, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess;
export function fork(modulePath: string, args?: string[], options?: {
uid?: number;
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;
env?: any;
execPath?: string;
@ -967,8 +1047,10 @@ declare module "child_process" {
silent?: boolean;
uid?: 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;
input?: string | Buffer;
stdio?: any;
@ -976,42 +1058,83 @@ declare module "child_process" {
uid?: number;
gid?: number;
timeout?: number;
maxBuffer?: number;
killSignal?: string;
maxBuffer?: number;
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;
output: string[];
stdout: string | Buffer;
stderr: string | Buffer;
stdout: T;
stderr: T;
status: number;
signal: string;
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;
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;
env?: any;
uid?: number;
gid?: number;
timeout?: number;
maxBuffer?: number;
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;
killSignal?: 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" {
@ -1096,12 +1219,29 @@ declare module "net" {
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 {
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(handle: any, backlog?: number, listeningListener?: Function): Server;
listen(handle: any, listeningListener?: Function): Server;
listen(options: ListenOptions, listeningListener?: Function): Server;
close(callback?: Function): Server;
address(): { port: number; family: string; address: string; };
getConnections(cb: (error: Error, count: number) => void): void;
ref(): Server;
unref(): Server;
maxConnections: 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, 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 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 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 {
// 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;
address(): { port: number; family: string; address: string; };
addContext(hostName: string, credentials: {
@ -1716,21 +1851,27 @@ declare module "crypto" {
}
export function createCipher(algorithm: string, password: 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: 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(output_encoding: string): string;
setAutoPadding(auto_padding: boolean): void;
getAuthTag(): Buffer;
}
export function createDecipher(algorithm: string, password: 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: 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(output_encoding: string): string;
setAutoPadding(auto_padding: boolean): void;
setAuthTag(tag: Buffer): void;
}
export function createSign(algorithm: string): Signer;
export interface Signer extends NodeJS.WritableStream {
@ -1891,7 +2032,7 @@ declare module "util" {
declare module "assert" {
function internal (value: any, message?: string): void;
module internal {
namespace internal {
export class AssertionError implements Error {
name: string;
message: string;
@ -1953,19 +2094,13 @@ declare module "tty" {
declare module "domain" {
import * as events from "events";
export class Domain extends events.EventEmitter {
export class Domain extends events.EventEmitter implements NodeJS.Domain {
run(fn: Function): void;
add(emitter: events.EventEmitter): void;
remove(emitter: events.EventEmitter): void;
bind(cb: (err: Error, data: any) => any): any;
intercept(cb: (data: any) => any): any;
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;