diff --git a/node/node.d.ts b/node/node.d.ts index 848c05f45..565263d03 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -35,7 +35,7 @@ declare var module: { require(id: string): any; id: string; filename: string; - loaded: bool; + loaded: boolean; parent: any; children: any[]; } @@ -47,7 +47,7 @@ declare var SlowBuffer: { new (size: number): NodeBuffer; new (array: any[]): NodeBuffer; prototype: NodeBuffer; - isBuffer(obj: any): bool; + isBuffer(obj: any): boolean; byteLength(string: string, encoding?: string): number; concat(list: NodeBuffer[], totalLength?: number): NodeBuffer; }; @@ -56,7 +56,7 @@ declare var Buffer: { new (size: number): NodeBuffer; new (array: any[]): NodeBuffer; prototype: NodeBuffer; - isBuffer(obj: any): bool; + isBuffer(obj: any): boolean; byteLength(string: string, encoding?: string): number; concat(list: NodeBuffer[], totalLength?: number): NodeBuffer; } @@ -79,9 +79,9 @@ interface EventEmitter { } 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; end(str: string, enconding: string): void; end(buffer: NodeBuffer): void; @@ -90,12 +90,12 @@ interface WritableStream extends EventEmitter { } interface ReadableStream extends EventEmitter { - readable: bool; + readable: boolean; setEncoding(encoding: string): void; pause(): void; resume(): void; destroy(): void; - pipe(destination: WritableStream, options?: { end?: bool; }): void; + pipe(destination: WritableStream, options?: { end?: boolean; }): void; } interface NodeProcess extends EventEmitter { @@ -128,18 +128,18 @@ interface NodeProcess extends EventEmitter { variables: { clang: number; 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; }; }; @@ -163,34 +163,34 @@ interface NodeBuffer { length: number; copy(targetBuffer: NodeBuffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): void; 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; INSPECT_MAX_BYTES: number; } @@ -256,15 +256,15 @@ declare module "http" { } export interface ServerResponse extends events.NodeEventEmitter, stream.WritableStream { // 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; writeContinue(): void; writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; writeHead(statusCode: number, headers?: any): void; statusCode: number; setHeader(name: string, value: string): void; - sendDate: bool; + sendDate: boolean; getHeader(name: string): string; removeHeader(name: string): void; write(chunk: any, encoding?: string): any; @@ -273,15 +273,15 @@ declare module "http" { } export interface ClientRequest extends events.NodeEventEmitter, stream.WritableStream { // 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; write(chunk: any, encoding?: string): void; end(data?: any, encoding?: string): void; abort(): void; setTimeout(timeout: number, callback?: Function): void; setNoDelay(noDelay?: Function): void; - setSocketKeepAlive(enable?: bool, initialDelay?: number): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; } export interface ClientResponse extends events.NodeEventEmitter, stream.ReadableStream { statusCode: number; @@ -308,12 +308,12 @@ declare module "cluster" { export interface ClusterSettings { exec: string; args: string[]; - silent: bool; + silent: boolean; } export interface Worker { id: string; process: child_process; - suicide: bool; + suicide: boolean; send(message: any, sendHandle?: any): void; destroy(): void; disconnect(): void; @@ -321,8 +321,8 @@ declare module "cluster" { 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; @@ -430,9 +430,9 @@ declare module "https" { ca?: any; crl?: any; ciphers?: string; - honorCipherOrder?: bool; - requestCert?: bool; - rejectUnauthorized?: bool; + honorCipherOrder?: boolean; + requestCert?: boolean; + rejectUnauthorized?: boolean; NPNProtocols?: any; SNICallback?: (servername: string) => any; } @@ -452,7 +452,7 @@ declare module "https" { cert?: any; ca?: any; ciphers?: string; - rejectUnauthorized?: bool; + rejectUnauthorized?: boolean; } export interface NodeAgent { @@ -491,11 +491,11 @@ declare module "repl" { prompt?: string; input?: stream.ReadableStream; output?: stream.WritableStream; - terminal?: bool; + terminal?: boolean; eval?: Function; - useColors?: bool; - useGlobal?: bool; - ignoreUndefined?: bool; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; writer?: Function; } export function start(options: ReplOptions): events.NodeEventEmitter; @@ -507,7 +507,7 @@ declare module "readline" { 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; pause(): void; resume(): void; @@ -518,7 +518,7 @@ declare module "readline" { input: stream.ReadableStream; output: stream.WritableStream; completer?: Function; - terminal?: bool; + terminal?: boolean; } export function createInterface(options: ReadLineOptions): ReadLine; } @@ -555,7 +555,7 @@ declare module "child_process" { stdio?: any; custom?: any; env?: any; - detached?: bool; + detached?: boolean; }): ChildProcess; export function exec(command: string, options: { cwd?: string; @@ -596,7 +596,7 @@ declare module "url" { pathname: string; search: string; query: string; - slashes: bool; + slashes: boolean; } export function parse(urlStr: string, parseQueryString? , slashesDenoteHost? ): Url; @@ -624,8 +624,8 @@ declare module "net" { 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; connect(port: number, host?: string, connectionListener?: Function): void; connect(path: string, connectionListener?: Function): void; @@ -637,8 +637,8 @@ declare module "net" { pause(): void; resume(): void; setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: bool): void; - setKeepAlive(enable?: bool, initialDelay?: number): void; + setNoDelay(noDelay?: boolean): void; + setKeepAlive(enable?: boolean, initialDelay?: number): void; address(): { port: number; family: string; address: string; }; remoteAddress: string; remotePort: number; @@ -647,7 +647,7 @@ declare module "net" { } export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: bool; }): NodeSocket; + new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): NodeSocket; }; export interface Server extends NodeSocket { @@ -660,16 +660,16 @@ declare module "net" { connections: number; } 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 createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: NodeSocket) =>void ): Server; + export function connect(options: { allowHalfOpen?: boolean; }, 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(options: { allowHalfOpen?: boolean; }, connectionListener?: Function): void; export function createConnection(port: number, host?: string, connectionListener?: Function): void; export function createConnection(path: string, connectionListener?: Function): void; 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" { @@ -682,9 +682,9 @@ declare module "dgram" { bind(port: number, address?: string): void; close(): void; 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; dropMembership(multicastAddress: string, multicastInterface?: string): void; } @@ -694,13 +694,13 @@ declare module "fs" { import stream = module("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; ino: number; mode: number; @@ -786,11 +786,11 @@ declare module "fs" { export function appendFile(filename: string, data: any, callback?: (err) => void): void; export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: 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 watchFile(filename: string, options: { persistent?: boolean; 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 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?: { flags?: string; encoding?: string; @@ -847,8 +847,8 @@ declare module "tls" { crl?: any; //string or string array ciphers?: string; honorCipherOrder?: any; - requestCert?: bool; - rejectUnauthorized?: bool; + requestCert?: boolean; + rejectUnauthorized?: boolean; NPNProtocols?: any; //array or Buffer; SNICallback?: (servername: string) => any; } @@ -862,7 +862,7 @@ declare module "tls" { passphrase?: string; cert?: any; //string | Buffer ca?: any; //Array of string | Buffer - rejectUnauthorized?: bool; + rejectUnauthorized?: boolean; NPNProtocols?: any; //Array of string | Buffer servername?: string; } @@ -886,7 +886,7 @@ declare module "tls" { } export interface ClearTextStream extends stream.ReadWriteStream { - authorized: bool; + authorized: boolean; authorizationError: Error; getPeerCertificate(): any; getCipher: { @@ -911,7 +911,7 @@ declare module "tls" { export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; 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; } declare module "crypto" { @@ -941,14 +941,14 @@ declare module "crypto" { interface Cipher { update(data: any, input_encoding?: string, output_encoding?: string): string; final(output_encoding?: string): string; - setAutoPadding(auto_padding: bool): void; + setAutoPadding(auto_padding: boolean): void; createDecipher(algorithm: string, password: any): Decipher; createDecipheriv(algorithm: string, key: any, iv: any): Decipher; } interface Decipher { update(data: any, input_encoding?: string, output_encoding?: string): void; final(output_encoding?: string): string; - setAutoPadding(auto_padding: bool): void; + setAutoPadding(auto_padding: boolean): void; } export function createSign(algorithm: string): Signer; interface Signer { @@ -958,7 +958,7 @@ declare module "crypto" { export function createVerify(algorith: string): Verify; interface Verify { update(data: any): void; - verify(object: string, signature: string, signature_format?: string): bool; + verify(object: string, signature: string, signature_format?: string): boolean; } export function createDiffieHellman(prime_length: number): DiffieHellman; export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; @@ -981,9 +981,9 @@ declare module "stream" { import events = module("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; end(str: string, enconding: string): void; end(buffer: NodeBuffer): void; @@ -992,12 +992,12 @@ declare module "stream" { } export interface ReadableStream extends events.NodeEventEmitter { - readable: bool; + readable: boolean; setEncoding(encoding: string): void; pause(): void; resume(): void; destroy(): void; - pipe(destination: WritableStream, options?: { end?: bool; }): void; + pipe(destination: WritableStream, options?: { end?: boolean; }): void; } export interface ReadWriteStream extends ReadableStream, WritableStream { } @@ -1010,16 +1010,16 @@ declare module "util" { export function puts(...param: any[]): void; export function print(...param: any[]): 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): void; + 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; } declare module "assert" { - export function (booleanValue: bool, message?: string); + export function (booleanValue: boolean, message?: string); 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; @@ -1037,10 +1037,10 @@ declare module "assert" { declare module "tty" { import net = module("net"); - export function isatty(fd: string): bool; + export function isatty(fd: string): boolean; export interface ReadStream extends net.NodeSocket { - isRaw: bool; - setRawMode(mode: bool): void; + isRaw: boolean; + setRawMode(mode: boolean): void; } export interface WriteStream extends net.NodeSocket { columns: number;