typescript-require
Advanced tools
Comparing version 0.2.2 to 0.2.3
14
index.js
@@ -11,3 +11,4 @@ var os = require('os'); | ||
nodeLib: false, | ||
targetES5: true | ||
targetES5: true, | ||
moduleKind: 'commonjs' | ||
}; | ||
@@ -28,4 +29,4 @@ | ||
"--target", | ||
options.targetES5 ? "ES5" : "ES3", | ||
"--out", | ||
options.targetES5 ? "ES5" : "ES3", !! options.moduleKind ? "--module" : "", !! options.moduleKind ? options.moduleKind : "", | ||
"--outDir", | ||
tmpDir, | ||
@@ -46,3 +47,6 @@ path.resolve(__dirname, "typings/lib.d.ts"), | ||
process: proc, | ||
require: require | ||
require: require, | ||
module: module, | ||
Buffer: Buffer, | ||
setTimeout: setTimeout | ||
}; | ||
@@ -71,3 +75,3 @@ | ||
var narr = []; | ||
arr.forEach(function (data) { | ||
arr.forEach(function(data) { | ||
if (data) narr.push(data); | ||
@@ -74,0 +78,0 @@ }); |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"main": "./index.js", | ||
@@ -19,3 +19,6 @@ "repository": { | ||
}, | ||
"keywords": ["typescript", "require"], | ||
"keywords": [ | ||
"typescript", | ||
"require" | ||
], | ||
"devDependencies": {}, | ||
@@ -22,0 +25,0 @@ "optionalDependencies": {}, |
/************************************************ | ||
* * | ||
* Node.js v0.8.8 API * | ||
* Node.js v0.10.1 API * | ||
* * | ||
@@ -15,26 +15,18 @@ ************************************************/ | ||
declare var console: { | ||
log(...data: any[]): void; | ||
info(...data: any[]): void; | ||
error(...data: any[]): void; | ||
warn(...data: any[]): void; | ||
dir(obj: any): void; | ||
timeEnd(label: string): void; | ||
trace(label: string): void; | ||
assert(expression: any, ...message: string[]): void; | ||
} | ||
declare var __filename: string; | ||
declare var __dirname: string; | ||
declare function setTimeout(callback: () => void , ms: number): any; | ||
declare function clearTimeout(timeoutId: any); | ||
declare function setInterval(callback: () => void , ms: number): any; | ||
declare function clearInterval(intervalId: any); | ||
declare function setTimeout(callback: (...args: any[]) => void , ms: number , ...args: any[]): NodeTimer; | ||
declare function clearTimeout(timeoutId: NodeTimer): void; | ||
declare function setInterval(callback: (...args: any[]) => void , ms: number , ...args: any[]): NodeTimer; | ||
declare function clearInterval(intervalId: NodeTimer): void; | ||
declare function setImmediate(callback: (...args: any[]) => void , ...args: any[]): any; | ||
declare function clearImmediate(immediateId: any): void; | ||
declare var require: { | ||
(id: string): any; | ||
resolve(): string; | ||
resolve(id:string): string; | ||
cache: any; | ||
extensions: any; | ||
main: any; | ||
} | ||
@@ -47,3 +39,3 @@ | ||
filename: string; | ||
loaded: bool; | ||
loaded: boolean; | ||
parent: any; | ||
@@ -60,3 +52,3 @@ children: any[]; | ||
prototype: NodeBuffer; | ||
isBuffer(obj: any): bool; | ||
isBuffer(obj: any): boolean; | ||
byteLength(string: string, encoding?: string): number; | ||
@@ -70,3 +62,3 @@ concat(list: NodeBuffer[], totalLength?: number): NodeBuffer; | ||
prototype: NodeBuffer; | ||
isBuffer(obj: any): bool; | ||
isBuffer(obj: any): boolean; | ||
byteLength(string: string, encoding?: string): number; | ||
@@ -83,16 +75,16 @@ concat(list: NodeBuffer[], totalLength?: number): NodeBuffer; | ||
interface EventEmitter { | ||
addListener(event: string, listener: Function); | ||
on(event: string, listener: Function); | ||
once(event: string, listener: Function): void; | ||
removeListener(event: string, listener: Function): void; | ||
removeAllListener(event: string): void; | ||
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): void; | ||
listeners(event: string): { Function; }[]; | ||
emit(event: string, arg1?: any, arg2?: any): void; | ||
listeners(event: string): Function[]; | ||
emit(event: string, ...args: any[]): boolean; | ||
} | ||
interface WritableStream extends EventEmitter { | ||
writable: bool; | ||
write(str: string, encoding?: string, fd?: string): bool; | ||
write(buffer: NodeBuffer): bool; | ||
writable: boolean; | ||
write(str: string, encoding?: string, fd?: string): boolean; | ||
write(buffer: NodeBuffer): boolean; | ||
end(): void; | ||
@@ -106,3 +98,3 @@ end(str: string, enconding: string): void; | ||
interface ReadableStream extends EventEmitter { | ||
readable: bool; | ||
readable: boolean; | ||
setEncoding(encoding: string): void; | ||
@@ -112,3 +104,3 @@ pause(): void; | ||
destroy(): void; | ||
pipe(destination: WritableStream, options?: { end?: bool; }): void; | ||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T; | ||
} | ||
@@ -124,3 +116,3 @@ | ||
chdir(directory: string): void; | ||
cwd(): void; | ||
cwd(): string; | ||
env: any; | ||
@@ -130,4 +122,6 @@ exit(code?: number): void; | ||
setgid(id: number): void; | ||
setgid(id: string): void; | ||
getuid(): number; | ||
setuid(id: number): void; | ||
setuid(id: string): void; | ||
version: string; | ||
@@ -146,14 +140,14 @@ versions: { http_parser: string; node: string; v8: string; ares: string; uv: string; zlib: string; openssl: string; }; | ||
host_arch: string; | ||
node_install_npm: bool; | ||
node_install_waf: bool; | ||
node_install_npm: boolean; | ||
node_install_waf: boolean; | ||
node_prefix: string; | ||
node_shared_openssl: bool; | ||
node_shared_v8: bool; | ||
node_shared_zlib: bool; | ||
node_use_dtrace: bool; | ||
node_use_etw: bool; | ||
node_use_openssl: bool; | ||
node_shared_openssl: boolean; | ||
node_shared_v8: boolean; | ||
node_shared_zlib: boolean; | ||
node_use_dtrace: boolean; | ||
node_use_etw: boolean; | ||
node_use_openssl: boolean; | ||
target_arch: string; | ||
v8_no_strict_aliasing: number; | ||
v8_use_snapshot: bool; | ||
v8_use_snapshot: boolean; | ||
visibility: string; | ||
@@ -167,7 +161,10 @@ }; | ||
platform: string; | ||
memoryUsage(): { rss: number; heapTotal; number; heapUsed: number; }; | ||
memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; | ||
nextTick(callback: Function): void; | ||
umask(mask?: number): number; | ||
uptime(): number; | ||
hrtime(): number[]; | ||
hrtime(time?:number[]): number[]; | ||
// Worker | ||
send?(message: any, sendHandle?: any): void; | ||
} | ||
@@ -179,34 +176,34 @@ | ||
write(string: string, offset?: number, length?: number, encoding?: string): number; | ||
toString(encoding: string, start: number, end: number): string; | ||
toString(encoding?: string, start?: number, end?: number): string; | ||
length: number; | ||
copy(targetBuffer: NodeBuffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): void; | ||
copy(targetBuffer: NodeBuffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; | ||
slice(start?: number, end?: number): NodeBuffer; | ||
readUInt8(offset: number, noAsset?: bool): number; | ||
readUInt16LE(offset: number, noAssert?: bool): number; | ||
readUInt16BE(offset: number, noAssert?: bool): number; | ||
readUInt32LE(offset: number, noAssert?: bool): number; | ||
readUInt32BE(offset: number, noAssert?: bool): number; | ||
readInt8(offset: number, noAssert?: bool): number; | ||
readInt16LE(offset: number, noAssert?: bool): number; | ||
readInt16BE(offset: number, noAssert?: bool): number; | ||
readInt32LE(offset: number, noAssert?: bool): number; | ||
readInt32BE(offset: number, noAssert?: bool): number; | ||
readFloatLE(offset: number, noAssert?: bool): number; | ||
readFloatBE(offset: number, noAssert?: bool): number; | ||
readDoubleLE(offset: number, noAssert?: bool): number; | ||
readDoubleBE(offset: number, noAssert?: bool): number; | ||
writeUInt8(value: number, offset: number, noAssert?: bool): void; | ||
writeUInt16LE(value: number, offset: number, noAssert?: bool): void; | ||
writeUInt16BE(value: number, offset: number, noAssert?: bool): void; | ||
writeUInt32LE(value: number, offset: number, noAssert?: bool): void; | ||
writeUInt32BE(value: number, offset: number, noAssert?: bool): void; | ||
writeInt8(value: number, offset: number, noAssert?: bool): void; | ||
writeInt16LE(value: number, offset: number, noAssert?: bool): void; | ||
writeInt16BE(value: number, offset: number, noAssert?: bool): void; | ||
writeInt32LE(value: number, offset: number, noAssert?: bool): void; | ||
writeInt32BE(value: number, offset: number, noAssert?: bool): void; | ||
writeFloatLE(value: number, offset: number, noAssert?: bool): void; | ||
writeFloatBE(value: number, offset: number, noAssert?: bool): void; | ||
writeDoubleLE(value: number, offset: number, noAssert?: bool): void; | ||
writeDoubleBE(value: number, offset: number, noAssert?: bool): void; | ||
readUInt8(offset: number, noAsset?: boolean): number; | ||
readUInt16LE(offset: number, noAssert?: boolean): number; | ||
readUInt16BE(offset: number, noAssert?: boolean): number; | ||
readUInt32LE(offset: number, noAssert?: boolean): number; | ||
readUInt32BE(offset: number, noAssert?: boolean): number; | ||
readInt8(offset: number, noAssert?: boolean): number; | ||
readInt16LE(offset: number, noAssert?: boolean): number; | ||
readInt16BE(offset: number, noAssert?: boolean): number; | ||
readInt32LE(offset: number, noAssert?: boolean): number; | ||
readInt32BE(offset: number, noAssert?: boolean): number; | ||
readFloatLE(offset: number, noAssert?: boolean): number; | ||
readFloatBE(offset: number, noAssert?: boolean): number; | ||
readDoubleLE(offset: number, noAssert?: boolean): number; | ||
readDoubleBE(offset: number, noAssert?: boolean): number; | ||
writeUInt8(value: number, offset: number, noAssert?: boolean): void; | ||
writeUInt16LE(value: number, offset: number, noAssert?: boolean): void; | ||
writeUInt16BE(value: number, offset: number, noAssert?: boolean): void; | ||
writeUInt32LE(value: number, offset: number, noAssert?: boolean): void; | ||
writeUInt32BE(value: number, offset: number, noAssert?: boolean): void; | ||
writeInt8(value: number, offset: number, noAssert?: boolean): void; | ||
writeInt16LE(value: number, offset: number, noAssert?: boolean): void; | ||
writeInt16BE(value: number, offset: number, noAssert?: boolean): void; | ||
writeInt32LE(value: number, offset: number, noAssert?: boolean): void; | ||
writeInt32BE(value: number, offset: number, noAssert?: boolean): void; | ||
writeFloatLE(value: number, offset: number, noAssert?: boolean): void; | ||
writeFloatBE(value: number, offset: number, noAssert?: boolean): void; | ||
writeDoubleLE(value: number, offset: number, noAssert?: boolean): void; | ||
writeDoubleBE(value: number, offset: number, noAssert?: boolean): void; | ||
fill(value: any, offset?: number, end?: number): void; | ||
@@ -216,2 +213,7 @@ INSPECT_MAX_BYTES: number; | ||
interface NodeTimer { | ||
ref() : void; | ||
unref() : void; | ||
} | ||
/************************************************ | ||
@@ -231,19 +233,30 @@ * * | ||
export interface NodeEventEmitter { | ||
addListener(event: string, listener: Function); | ||
on(event: string, listener: Function): any; | ||
once(event: string, listener: Function): void; | ||
removeListener(event: string, listener: Function): void; | ||
removeAllListener(event: string): void; | ||
addListener(event: string, listener: Function): NodeEventEmitter; | ||
on(event: string, listener: Function): NodeEventEmitter; | ||
once(event: string, listener: Function): NodeEventEmitter; | ||
removeListener(event: string, listener: Function): NodeEventEmitter; | ||
removeAllListeners(event?: string): NodeEventEmitter; | ||
setMaxListeners(n: number): void; | ||
listeners(event: string): { Function; }[]; | ||
emit(event: string, arg1?: any, arg2?: any): void; | ||
listeners(event: string): Function[]; | ||
emit(event: string, ...args: any[]): boolean; | ||
} | ||
export var EventEmitter: NodeEventEmitter; | ||
export class EventEmitter implements NodeEventEmitter { | ||
static listenerCount(emitter: EventEmitter, event: string): 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): void; | ||
listeners(event: string): Function[]; | ||
emit(event: string, ...args: any[]): boolean; | ||
} | ||
} | ||
declare module "http" { | ||
import events = module("events"); | ||
import net = module("net"); | ||
import stream = module("stream"); | ||
import events = require("events"); | ||
import net = require("net"); | ||
import stream = require("stream"); | ||
@@ -260,3 +273,3 @@ export interface Server extends events.NodeEventEmitter { | ||
url: string; | ||
headers: string; | ||
headers: any; | ||
trailers: string; | ||
@@ -271,4 +284,4 @@ httpVersion: string; | ||
// Extended base methods | ||
write(str: string, encoding?: string, fd?: string): bool; | ||
write(buffer: NodeBuffer): bool; | ||
write(str: string, encoding?: string, fd?: string): boolean; | ||
write(buffer: NodeBuffer): boolean; | ||
@@ -280,3 +293,3 @@ writeContinue(): void; | ||
setHeader(name: string, value: string): void; | ||
sendDate: bool; | ||
sendDate: boolean; | ||
getHeader(name: string): string; | ||
@@ -290,4 +303,4 @@ removeHeader(name: string): void; | ||
// Extended base methods | ||
write(str: string, encoding?: string, fd?: string): bool; | ||
write(buffer: NodeBuffer): bool; | ||
write(str: string, encoding?: string, fd?: string): boolean; | ||
write(buffer: NodeBuffer): boolean; | ||
@@ -299,3 +312,3 @@ write(chunk: any, encoding?: string): void; | ||
setNoDelay(noDelay?: Function): void; | ||
setSocketKeepAlive(enable?: bool, initialDelay?: number): void; | ||
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; | ||
} | ||
@@ -313,3 +326,3 @@ export interface ClientResponse extends events.NodeEventEmitter, stream.ReadableStream { | ||
export var STATUS_CODES; | ||
export var STATUS_CODES: any; | ||
export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; | ||
@@ -323,26 +336,29 @@ export function createClient(port?: number, host?: string): any; | ||
declare module "cluster" { | ||
import child_process = module("child_process"); | ||
import child = require("child_process"); | ||
import events = require("events"); | ||
export interface ClusterSettings { | ||
exec: string; | ||
args: string[]; | ||
silent: bool; | ||
exec?: string; | ||
args?: string[]; | ||
silent?: boolean; | ||
} | ||
export interface Worker { | ||
export class Worker extends events.EventEmitter { | ||
id: string; | ||
process: child_process; | ||
suicide: bool; | ||
process: child.ChildProcess; | ||
suicide: boolean; | ||
send(message: any, sendHandle?: any): void; | ||
destroy(): void; | ||
kill(signal?: string): void; | ||
destroy(signal?: string): void; | ||
disconnect(): void; | ||
} | ||
export var settings: ClusterSettings; | ||
export var isMaster: bool; | ||
export var isWorker: bool; | ||
export var isMaster: boolean; | ||
export var isWorker: boolean; | ||
export function setupMaster(settings?: ClusterSettings): void; | ||
export function fork(env?: any): Worker; | ||
export function disconnect(callback?: Function): void; | ||
export var workers: any; | ||
export var worker: Worker; | ||
export var workers: Worker[]; | ||
@@ -354,10 +370,10 @@ // Event emitter | ||
export function removeListener(event: string, listener: Function): void; | ||
export function removeAllListener(event: string): void; | ||
export function removeAllListeners(event?: string): void; | ||
export function setMaxListeners(n: number): void; | ||
export function listeners(event: string): { Function; }[]; | ||
export function emit(event: string, arg1?: any, arg2?: any): void; | ||
export function listeners(event: string): Function[]; | ||
export function emit(event: string, ...args: any[]): boolean; | ||
} | ||
declare module "zlib" { | ||
import stream = module("stream"); | ||
import stream = require("stream"); | ||
export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } | ||
@@ -373,17 +389,17 @@ | ||
export function createGzip(options: ZlibOptions): Gzip; | ||
export function createGunzip(options: ZlibOptions): Gunzip; | ||
export function createDeflate(options: ZlibOptions): Deflate; | ||
export function createInflate(options: ZlibOptions): Inflate; | ||
export function createDeflateRaw(options: ZlibOptions): DeflateRaw; | ||
export function createInflateRaw(options: ZlibOptions): InflateRaw; | ||
export function createUnzip(options: ZlibOptions): Unzip; | ||
export function createGzip(options?: ZlibOptions): Gzip; | ||
export function createGunzip(options?: ZlibOptions): Gunzip; | ||
export function createDeflate(options?: ZlibOptions): Deflate; | ||
export function createInflate(options?: ZlibOptions): Inflate; | ||
export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; | ||
export function createInflateRaw(options?: ZlibOptions): InflateRaw; | ||
export function createUnzip(options?: ZlibOptions): Unzip; | ||
export function deflate(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function deflateRaw(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function gzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function gunzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function inflate(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function inflateRaw(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function unzip(buf: NodeBuffer, callback: (error: Error, result) =>void ): void; | ||
export function deflate(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
export function deflateRaw(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
export function gzip(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
export function gunzip(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
export function inflate(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
export function inflateRaw(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
export function unzip(buf: NodeBuffer, callback: (error: Error, result: any) =>void ): void; | ||
@@ -441,5 +457,5 @@ // Constants | ||
declare module "https" { | ||
import tls = module("tls"); | ||
import events = module("events"); | ||
import http = module("http"); | ||
import tls = require("tls"); | ||
import events = require("events"); | ||
import http = require("http"); | ||
@@ -454,5 +470,5 @@ export interface ServerOptions { | ||
ciphers?: string; | ||
honorCipherOrder?: bool; | ||
requestCert?: bool; | ||
rejectUnauthorized?: bool; | ||
honorCipherOrder?: boolean; | ||
requestCert?: boolean; | ||
rejectUnauthorized?: boolean; | ||
NPNProtocols?: any; | ||
@@ -477,3 +493,3 @@ SNICallback?: (servername: string) => any; | ||
ciphers?: string; | ||
rejectUnauthorized?: bool; | ||
rejectUnauthorized?: boolean; | ||
} | ||
@@ -506,8 +522,8 @@ | ||
} | ||
export var version; | ||
export var version: any; | ||
} | ||
declare module "repl" { | ||
import stream = module("stream"); | ||
import events = module("events"); | ||
import stream = require("stream"); | ||
import events = require("events"); | ||
@@ -518,7 +534,7 @@ export interface ReplOptions { | ||
output?: stream.WritableStream; | ||
terminal?: bool; | ||
terminal?: boolean; | ||
eval?: Function; | ||
useColors?: bool; | ||
useGlobal?: bool; | ||
ignoreUndefined?: bool; | ||
useColors?: boolean; | ||
useGlobal?: boolean; | ||
ignoreUndefined?: boolean; | ||
writer?: Function; | ||
@@ -530,8 +546,8 @@ } | ||
declare module "readline" { | ||
import events = module("events"); | ||
import stream = module("stream"); | ||
import events = require("events"); | ||
import stream = require("stream"); | ||
export interface ReadLine extends events.NodeEventEmitter { | ||
setPrompt(prompt: string, length: number): void; | ||
prompt(preserveCursor?: bool): void; | ||
prompt(preserveCursor?: boolean): void; | ||
question(query: string, callback: Function): void; | ||
@@ -547,3 +563,3 @@ pause(): void; | ||
completer?: Function; | ||
terminal?: bool; | ||
terminal?: boolean; | ||
} | ||
@@ -567,4 +583,4 @@ export function createInterface(options: ReadLineOptions): ReadLine; | ||
declare module "child_process" { | ||
import events = module("events"); | ||
import stream = module("stream"); | ||
import events = require("events"); | ||
import stream = require("stream"); | ||
@@ -586,3 +602,3 @@ export interface ChildProcess extends events.NodeEventEmitter { | ||
env?: any; | ||
detached?: bool; | ||
detached?: boolean; | ||
}): ChildProcess; | ||
@@ -619,3 +635,15 @@ export function exec(command: string, options: { | ||
export interface Url { | ||
href?: string; | ||
href: string; | ||
protocol: string; | ||
auth: string; | ||
hostname: string; | ||
port: string; | ||
host: string; | ||
pathname: string; | ||
search: string; | ||
query: string; | ||
slashes: boolean; | ||
} | ||
export interface UrlOptions { | ||
protocol?: string; | ||
@@ -628,9 +656,7 @@ auth?: string; | ||
search?: string; | ||
query?: string; | ||
slashes?: bool; | ||
hash?: string; | ||
query?: any; | ||
} | ||
export function parse(urlStr: string, parseQueryString? , slashesDenoteHost? ): Url; | ||
export function format(url: Url): string; | ||
export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; | ||
export function format(url: UrlOptions): string; | ||
export function resolve(from: string, to: string): string; | ||
@@ -655,8 +681,8 @@ } | ||
declare module "net" { | ||
import stream = module("stream"); | ||
import stream = require("stream"); | ||
export interface NodeSocket extends stream.ReadWriteStream { | ||
// Extended base methods | ||
write(str: string, encoding?: string, fd?: string): bool; | ||
write(buffer: NodeBuffer): bool; | ||
write(str: string, encoding?: string, fd?: string): boolean; | ||
write(buffer: NodeBuffer): boolean; | ||
@@ -672,5 +698,5 @@ connect(port: number, host?: string, connectionListener?: Function): void; | ||
resume(): void; | ||
setTimeout(timeout: number, callback?: Function); void; | ||
setNoDelay(noDelay?: bool): void; | ||
setKeepAlive(enable?: bool, initialDelay?: number): void; | ||
setTimeout(timeout: number, callback?: Function): void; | ||
setNoDelay(noDelay?: boolean): void; | ||
setKeepAlive(enable?: boolean, initialDelay?: number): void; | ||
address(): { port: number; family: string; address: string; }; | ||
@@ -684,3 +710,3 @@ remoteAddress: string; | ||
export var Socket: { | ||
new (options?: { fd?: string; type?: string; allowHalfOpen?: bool; }): NodeSocket; | ||
new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): NodeSocket; | ||
}; | ||
@@ -698,16 +724,16 @@ | ||
export function createServer(connectionListener?: (socket: NodeSocket) =>void ): Server; | ||
export function createServer(options?: { allowHalfOpen?: bool; }, connectionListener?: (socket: NodeSocket) =>void ): Server; | ||
export function connect(options: { allowHalfOpen?: bool; }, connectionListener?: Function): void; | ||
export function connect(port: number, host?: string, connectionListener?: Function): void; | ||
export function connect(path: string, connectionListener?: Function): void; | ||
export function createConnection(options: { allowHalfOpen?: bool; }, connectionListener?: Function): void; | ||
export function createConnection(port: number, host?: string, connectionListener?: Function): void; | ||
export function createConnection(path: string, connectionListener?: Function): void; | ||
export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: NodeSocket) =>void ): Server; | ||
export function connect(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): NodeSocket; | ||
export function connect(port: number, host?: string, connectionListener?: Function): NodeSocket; | ||
export function connect(path: string, connectionListener?: Function): NodeSocket; | ||
export function createConnection(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): NodeSocket; | ||
export function createConnection(port: number, host?: string, connectionListener?: Function): NodeSocket; | ||
export function createConnection(path: string, connectionListener?: Function): NodeSocket; | ||
export function isIP(input: string): number; | ||
export function isIPv4(input: string): bool; | ||
export function isIPv6(input: string): bool; | ||
export function isIPv4(input: string): boolean; | ||
export function isIPv6(input: string): boolean; | ||
} | ||
declare module "dgram" { | ||
import events = module("events"); | ||
import events = require("events"); | ||
@@ -721,5 +747,5 @@ export function createSocket(type: string, callback?: Function): Socket; | ||
address: { address: string; family: string; port: number; }; | ||
setBroadcast(flag: bool): void; | ||
setBroadcast(flag: boolean): void; | ||
setMulticastTTL(ttl: number): void; | ||
setMulticastLoopback(flag: bool): void; | ||
setMulticastLoopback(flag: boolean): void; | ||
addMembership(multicastAddress: string, multicastInterface?: string): void; | ||
@@ -731,12 +757,12 @@ dropMembership(multicastAddress: string, multicastInterface?: string): void; | ||
declare module "fs" { | ||
import stream = module("stream"); | ||
import stream = require("stream"); | ||
interface Stats { | ||
isFile(): bool; | ||
isDirectory(): bool; | ||
isBlockDevice(): bool; | ||
isCharacterDevice(): bool; | ||
isSymbolicLink(): bool; | ||
isFIFO(): bool; | ||
isSocket(): bool; | ||
isFile(): boolean; | ||
isDirectory(): boolean; | ||
isBlockDevice(): boolean; | ||
isCharacterDevice(): boolean; | ||
isSymbolicLink(): boolean; | ||
isFIFO(): boolean; | ||
isSocket(): boolean; | ||
dev: number; | ||
@@ -757,3 +783,3 @@ ino: number; | ||
interface FSWatcher { | ||
interface FSWatcher extends EventEmitter { | ||
close(): void; | ||
@@ -767,4 +793,8 @@ } | ||
export function renameSync(oldPath: string, newPath: string): void; | ||
export function truncate(fd: number, len: number, callback?: Function): void; | ||
export function truncateSync(fd: number, len: number): void; | ||
export function truncate(path: string, callback?: Function): void; | ||
export function truncate(path: string, len: number, callback?: Function): void; | ||
export function truncateSync(path: string, len?: number): void; | ||
export function ftruncate(fd: number, callback?: Function): void; | ||
export function ftruncate(fd: number, len: number, callback?: Function): void; | ||
export function ftruncateSync(fd: number, len?: number): void; | ||
export function chown(path: string, uid: number, gid: number, callback?: Function): void; | ||
@@ -784,9 +814,9 @@ export function chownSync(path: string, uid: number, gid: number): void; | ||
export function fchmodSync(fd: number, mode: string): void; | ||
export function lchmod(path: string, mode: number, callback?: Function): void; | ||
export function lchmod(path: string, mode: string, callback?: Function): void; | ||
export function lchmod(path: string, mode: number, callback?: Function): void; | ||
export function lchmodSync(path: string, mode: number): void; | ||
export function lchmodSync(path: string, mode: string): void; | ||
export function stat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats; | ||
export function lstat(path: string, callback?: (err: Error, stats: Stats) =>any): Stats; | ||
export function fstat(fd: number, callback?: (err: Error, stats: Stats) =>any): Stats; | ||
export function stat(path: string, callback?: (err: Error, stats: Stats) => any): void; | ||
export function lstat(path: string, callback?: (err: Error, stats: Stats) => any): void; | ||
export function fstat(fd: number, callback?: (err: Error, stats: Stats) => any): void; | ||
export function statSync(path: string): Stats; | ||
@@ -799,6 +829,7 @@ export function lstatSync(path: string): Stats; | ||
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; | ||
export function readlink(path: string, callback?: (err: Error, linkString: string) =>any): void; | ||
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) =>any): void; | ||
export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) =>any): void; | ||
export function realpathSync(path: string, cache?: string): string; | ||
export function readlink(path: string, callback?: (err: Error, linkString: string) => any): void; | ||
export function readlinkSync(path: string): string; | ||
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => any): void; | ||
export function realpath(path: string, cache: {[path: string]: string}, callback: (err: Error, resolvedPath: string) =>any): void; | ||
export function realpathSync(path: string, cache?: {[path: string]: string}): void; | ||
export function unlink(path: string, callback?: Function): void; | ||
@@ -808,4 +839,5 @@ export function unlinkSync(path: string): void; | ||
export function rmdirSync(path: string): void; | ||
export function mkdir(path: string, mode?: number, callback?: Function): void; | ||
export function mkdir(path: string, mode?: string, callback?: Function): void; | ||
export function mkdir(path: string, callback?: Function): void; | ||
export function mkdir(path: string, mode: number, callback?: Function): void; | ||
export function mkdir(path: string, mode: string, callback?: Function): void; | ||
export function mkdirSync(path: string, mode?: number): void; | ||
@@ -817,3 +849,6 @@ export function mkdirSync(path: string, mode?: string): void; | ||
export function closeSync(fd: number): void; | ||
export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fd: number) =>any): void; | ||
export function open(path: string, flags: string, callback?: (err: Error, fd: number) => any): void; | ||
export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: number) => any): void; | ||
export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: number) => any): void; | ||
export function openSync(path: string, flags: string, mode?: number): number; | ||
export function openSync(path: string, flags: string, mode?: string): number; | ||
@@ -826,20 +861,27 @@ export function utimes(path: string, atime: number, mtime: number, callback?: Function): void; | ||
export function fsyncSync(fd: number): void; | ||
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) =>any): void; | ||
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void; | ||
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; | ||
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void; | ||
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; | ||
export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void; | ||
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: Error, data: any) => void): void; | ||
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void; | ||
export function readFileSync(filename: string): NodeBuffer; | ||
export function readFileSync(filename: string, encoding: string): string; | ||
export function writeFile(filename: string, data: any, encoding?: string, callback?: Function): void; | ||
export function writeFileSync(filename: string, data: any, encoding?: string): void; | ||
export function appendFile(filename: string, data: any, encoding?: string, callback?: Function): void; | ||
export function appendFileSync(filename: string, data: any, encoding?: string): void; | ||
export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void; | ||
export function watchFile(filename: string, options: { persistent?: bool; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void; | ||
export function unwatchFile(filename: string, listener?: Stats): void; | ||
export function watch(filename: string, options?: { persistent?: bool; }, listener?: (event: string, filename: string) =>any): FSWatcher; | ||
export function exists(path: string, callback?: (exists: bool) =>void ): void; | ||
export function existsSync(path: string): bool; | ||
export function readFileSync(filename: string, options?: { flag?: string; }): NodeBuffer; | ||
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; | ||
export function writeFile(filename: string, data: any, callback?: (err: Error) => void): void; | ||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void; | ||
export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void; | ||
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; | ||
export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; | ||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: Error) => void): void; | ||
export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: Error) => void): void; | ||
export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void; | ||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; | ||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; | ||
export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; | ||
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; | ||
export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; | ||
export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; | ||
export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; | ||
export function exists(path: string, callback?: (exists: boolean) => void): void; | ||
export function existsSync(path: string): boolean; | ||
export function createReadStream(path: string, options?: { | ||
@@ -852,2 +894,9 @@ flags?: string; | ||
}): ReadStream; | ||
export function createReadStream(path: string, options?: { | ||
flags?: string; | ||
encoding?: string; | ||
fd?: string; | ||
mode?: string; | ||
bufferSize?: number; | ||
}): ReadStream; | ||
export function createWriteStream(path: string, options?: { | ||
@@ -863,7 +912,3 @@ flags?: string; | ||
export function join(...paths: any[]): string; | ||
export function resolve(from: string, to: string): string; | ||
export function resolve(from: string, from2: string, to: string): string; | ||
export function resolve(from: string, from2: string, from3: string, to: string): string; | ||
export function resolve(from: string, from2: string, from3: string, from4: string, to: string): string; | ||
export function resolve(from: string, from2: string, from3: string, from4: string, from5: string, to: string): string; | ||
export function resolve(...pathSegments: any[]): string; | ||
export function relative(from: string, to: string): string; | ||
@@ -887,5 +932,5 @@ export function dirname(p: string): string; | ||
declare module "tls" { | ||
import crypto = module("crypto"); | ||
import net = module("net"); | ||
import stream = module("stream"); | ||
import crypto = require("crypto"); | ||
import net = require("net"); | ||
import stream = require("stream"); | ||
@@ -904,4 +949,4 @@ var CLIENT_RENEG_LIMIT: number; | ||
honorCipherOrder?: any; | ||
requestCert?: bool; | ||
rejectUnauthorized?: bool; | ||
requestCert?: boolean; | ||
rejectUnauthorized?: boolean; | ||
NPNProtocols?: any; //array or Buffer; | ||
@@ -920,3 +965,3 @@ SNICallback?: (servername: string) => any; | ||
ca?: any; //Array of string | Buffer | ||
rejectUnauthorized?: bool; | ||
rejectUnauthorized?: boolean; | ||
NPNProtocols?: any; //Array of string | Buffer | ||
@@ -945,3 +990,3 @@ servername?: string; | ||
export interface ClearTextStream extends stream.ReadWriteStream { | ||
authorized: bool; | ||
authorized: boolean; | ||
authorizationError: Error; | ||
@@ -971,3 +1016,3 @@ getPeerCertificate(): any; | ||
export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; | ||
export function createSecurePair(credentials?: crypto.Credentials, isServer?: bool, requestCert?: bool, rejectUnauthorized?: bool): SecurePair; | ||
export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; | ||
} | ||
@@ -990,3 +1035,3 @@ | ||
interface Hash { | ||
update(data: any, input_encoding?: string): void; | ||
update(data: any, input_encoding?: string): Hash; | ||
digest(encoding?: string): string; | ||
@@ -1003,3 +1048,3 @@ } | ||
final(output_encoding?: string): string; | ||
setAutoPadding(auto_padding: bool): void; | ||
setAutoPadding(auto_padding: boolean): void; | ||
createDecipher(algorithm: string, password: any): Decipher; | ||
@@ -1011,3 +1056,3 @@ createDecipheriv(algorithm: string, key: any, iv: any): Decipher; | ||
final(output_encoding?: string): string; | ||
setAutoPadding(auto_padding: bool): void; | ||
setAutoPadding(auto_padding: boolean): void; | ||
} | ||
@@ -1022,3 +1067,3 @@ export function createSign(algorithm: string): Signer; | ||
update(data: any): void; | ||
verify(object: string, signature: string, signature_format?: string): bool; | ||
verify(object: string, signature: string, signature_format?: string): boolean; | ||
} | ||
@@ -1039,12 +1084,15 @@ export function createDiffieHellman(prime_length: number): DiffieHellman; | ||
export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void; | ||
export function randomBytes(size: number, callback?: (err: Error, buf: NodeBuffer) =>void ); | ||
export function randomBytes(size: number): NodeBuffer; | ||
export function randomBytes(size: number, callback: (err: Error, buf: NodeBuffer) =>void ): void; | ||
export function pseudoRandomBytes(size: number): NodeBuffer; | ||
export function pseudoRandomBytes(size: number, callback: (err: Error, buf: NodeBuffer) =>void ): void; | ||
} | ||
declare module "stream" { | ||
import events = module("events"); | ||
import events = require("events"); | ||
export interface WritableStream extends events.NodeEventEmitter { | ||
writable: bool; | ||
write(str: string, encoding?: string, fd?: string): bool; | ||
write(buffer: NodeBuffer): bool; | ||
writable: boolean; | ||
write(str: string, encoding?: string, fd?: string): boolean; | ||
write(buffer: NodeBuffer): boolean; | ||
end(): void; | ||
@@ -1058,3 +1106,3 @@ end(str: string, enconding: string): void; | ||
export interface ReadableStream extends events.NodeEventEmitter { | ||
readable: bool; | ||
readable: boolean; | ||
setEncoding(encoding: string): void; | ||
@@ -1064,5 +1112,23 @@ pause(): void; | ||
destroy(): void; | ||
pipe(destination: WritableStream, options?: { end?: bool; }): void; | ||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T; | ||
} | ||
export interface ReadableOptions { | ||
highWaterMark?: number; | ||
encoding?: string; | ||
objectMode?: boolean; | ||
} | ||
export class Readable extends events.EventEmitter implements ReadableStream { | ||
readable: boolean; | ||
constructor(opts?: ReadableOptions); | ||
setEncoding(encoding: string): void; | ||
pause(): void; | ||
resume(): void; | ||
destroy(): void; | ||
pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T; | ||
_read(): void; | ||
push(chunk: any, encoding?: string): boolean; | ||
} | ||
export interface ReadWriteStream extends ReadableStream, WritableStream { } | ||
@@ -1072,2 +1138,9 @@ } | ||
declare module "util" { | ||
export interface InspectOptions { | ||
showHidden?: boolean; | ||
depth?: number; | ||
colors?: boolean; | ||
customInspect?: boolean; | ||
} | ||
export function format(format: any, ...param: any[]): string; | ||
@@ -1079,7 +1152,8 @@ export function debug(string: string): void; | ||
export function log(string: string): void; | ||
export function inspect(object: any, showHidden?: bool, depth?: number, color?: bool): void; | ||
export function isArray(object: any): bool; | ||
export function isRegExp(object: any): bool; | ||
export function isDate(object: any): bool; | ||
export function isError(object: any): bool; | ||
export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; | ||
export function inspect(object: any, options: InspectOptions): string; | ||
export function isArray(object: any): boolean; | ||
export function isRegExp(object: any): boolean; | ||
export function isDate(object: any): boolean; | ||
export function isError(object: any): boolean; | ||
export function inherits(constructor: any, superConstructor: any): void; | ||
@@ -1089,23 +1163,51 @@ } | ||
declare module "assert" { | ||
export function fail(actual: any, expected: any, message: string, operator: string): void; | ||
export function assert(value: any, message: string): void; | ||
export function ok(value: any, message?: string): void; | ||
export function equal(actual: any, expected: any, message?: string): void; | ||
export function notEqual(actual: any, expected: any, message?: string): void; | ||
export function deepEqual(actual: any, expected: any, message?: string): void; | ||
export function notDeepEqual(acutal: any, expected: any, message?: string): void; | ||
export function strictEqual(actual: any, expected: any, message?: string): void; | ||
export function notStrictEqual(actual: any, expected: any, message?: string): void; | ||
export function throws(block: any, error?: any, messsage?: string): void; | ||
export function doesNotThrow(block: any, error?: any, messsage?: string): void; | ||
export function ifError(value: any): void; | ||
function internal (value: any, message?: string): void; | ||
module internal { | ||
export class AssertionError implements Error { | ||
name: string; | ||
message: string; | ||
actual: any; | ||
expected: any; | ||
operator: string; | ||
generatedMessage: boolean; | ||
constructor(options?: {message?: string; actual?: any; expected?: any; | ||
operator?: string; stackStartFunction?: Function}); | ||
} | ||
export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; | ||
export function ok(value: any, message?: string): void; | ||
export function equal(actual: any, expected: any, message?: string): void; | ||
export function notEqual(actual: any, expected: any, message?: string): void; | ||
export function deepEqual(actual: any, expected: any, message?: string): void; | ||
export function notDeepEqual(acutal: any, expected: any, message?: string): void; | ||
export function strictEqual(actual: any, expected: any, message?: string): void; | ||
export function notStrictEqual(actual: any, expected: any, message?: string): void; | ||
export var throws: { | ||
(block: Function, message?: string): void; | ||
(block: Function, error: Function, message?: string): void; | ||
(block: Function, error: RegExp, message?: string): void; | ||
(block: Function, error: (err: any) => boolean, message?: string): void; | ||
} | ||
export var doesNotThrow: { | ||
(block: Function, message?: string): void; | ||
(block: Function, error: Function, message?: string): void; | ||
(block: Function, error: RegExp, message?: string): void; | ||
(block: Function, error: (err: any) => boolean, message?: string): void; | ||
} | ||
export function ifError(value: any): void; | ||
} | ||
export = internal; | ||
} | ||
declare module "tty" { | ||
import net = module("net"); | ||
import net = require("net"); | ||
export function isatty(fd: string): bool; | ||
export function isatty(fd: number): boolean; | ||
export interface ReadStream extends net.NodeSocket { | ||
isRaw: bool; | ||
setRawMode(mode: bool): void; | ||
isRaw: boolean; | ||
setRawMode(mode: boolean): void; | ||
} | ||
@@ -1119,13 +1221,20 @@ export interface WriteStream extends net.NodeSocket { | ||
declare module "domain" { | ||
import events = module("events"); | ||
import events = require("events"); | ||
export interface Domain extends events.NodeEventEmitter { } | ||
export class Domain extends events.EventEmitter { | ||
run(fn: Function): void; | ||
add(emitter: events.NodeEventEmitter): void; | ||
remove(emitter: events.NodeEventEmitter): 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; | ||
export function run(fn: Function): void; | ||
export function add(emitter: events.NodeEventEmitter): void; | ||
export function remove(emitter: events.NodeEventEmitter): void; | ||
export function bind(cb: (er: Error, data: any) =>any): any; | ||
export function intercept(cb: (data: any) => any): any; | ||
export function dispose(): void; | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
579665
14355
5