mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
TLSSocket is actually a class
Thanks for point it out, @vvakame .
This commit is contained in:
226
node/node.d.ts
vendored
226
node/node.d.ts
vendored
@@ -17,10 +17,10 @@ interface Error {
|
||||
// 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.8.
|
||||
interface MapConstructor {}
|
||||
interface WeakMapConstructor {}
|
||||
interface SetConstructor {}
|
||||
interface WeakSetConstructor {}
|
||||
interface MapConstructor { }
|
||||
interface WeakMapConstructor { }
|
||||
interface SetConstructor { }
|
||||
interface WeakSetConstructor { }
|
||||
|
||||
/************************************************
|
||||
* *
|
||||
@@ -45,7 +45,7 @@ interface NodeRequireFunction {
|
||||
}
|
||||
|
||||
interface NodeRequire extends NodeRequireFunction {
|
||||
resolve(id:string): string;
|
||||
resolve(id: string): string;
|
||||
cache: any;
|
||||
extensions: any;
|
||||
main: any;
|
||||
@@ -81,7 +81,7 @@ declare var SlowBuffer: {
|
||||
|
||||
// Buffer class
|
||||
type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex";
|
||||
interface Buffer extends NodeBuffer {}
|
||||
interface Buffer extends NodeBuffer { }
|
||||
|
||||
/**
|
||||
* Raw data is stored in instances of the Buffer class.
|
||||
@@ -145,7 +145,7 @@ declare var Buffer: {
|
||||
* @param byteOffset
|
||||
* @param length
|
||||
*/
|
||||
from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?:number): Buffer;
|
||||
from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
||||
/**
|
||||
* Copies the passed {buffer} data onto a new Buffer instance.
|
||||
*
|
||||
@@ -228,7 +228,7 @@ declare namespace NodeJS {
|
||||
|
||||
export interface ReadableStream extends EventEmitter {
|
||||
readable: boolean;
|
||||
read(size?: number): string|Buffer;
|
||||
read(size?: number): string | Buffer;
|
||||
setEncoding(encoding: string): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
@@ -241,7 +241,7 @@ declare namespace NodeJS {
|
||||
|
||||
export interface WritableStream extends EventEmitter {
|
||||
writable: boolean;
|
||||
write(buffer: Buffer|string, cb?: Function): boolean;
|
||||
write(buffer: Buffer | string, cb?: Function): boolean;
|
||||
write(str: string, encoding?: string, cb?: Function): boolean;
|
||||
end(): void;
|
||||
end(buffer: Buffer, cb?: Function): void;
|
||||
@@ -249,7 +249,7 @@ declare namespace NodeJS {
|
||||
end(str: string, encoding?: string, cb?: Function): void;
|
||||
}
|
||||
|
||||
export interface ReadWriteStream extends ReadableStream, WritableStream {}
|
||||
export interface ReadWriteStream extends ReadableStream, WritableStream { }
|
||||
|
||||
export interface Events extends EventEmitter { }
|
||||
|
||||
@@ -328,7 +328,7 @@ declare namespace NodeJS {
|
||||
visibility: string;
|
||||
};
|
||||
};
|
||||
kill(pid:number, signal?: string|number): void;
|
||||
kill(pid: number, signal?: string | number): void;
|
||||
pid: number;
|
||||
title: string;
|
||||
arch: string;
|
||||
@@ -337,7 +337,7 @@ declare namespace NodeJS {
|
||||
nextTick(callback: Function): void;
|
||||
umask(mask?: number): number;
|
||||
uptime(): number;
|
||||
hrtime(time?:number[]): number[];
|
||||
hrtime(time?: number[]): number[];
|
||||
domain: Domain;
|
||||
|
||||
// Worker
|
||||
@@ -413,8 +413,8 @@ declare namespace NodeJS {
|
||||
}
|
||||
|
||||
export interface Timer {
|
||||
ref() : void;
|
||||
unref() : void;
|
||||
ref(): void;
|
||||
unref(): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ declare module "http" {
|
||||
path?: string;
|
||||
headers?: { [key: string]: any };
|
||||
auth?: string;
|
||||
agent?: Agent|boolean;
|
||||
agent?: Agent | boolean;
|
||||
}
|
||||
|
||||
export interface Server extends events.EventEmitter, net.Server {
|
||||
@@ -679,7 +679,7 @@ declare module "http" {
|
||||
[errorCode: number]: string;
|
||||
[errorCode: string]: string;
|
||||
};
|
||||
export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server;
|
||||
export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server;
|
||||
export function createClient(port?: number, host?: string): any;
|
||||
export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
@@ -763,19 +763,19 @@ declare module "zlib" {
|
||||
export function createInflateRaw(options?: ZlibOptions): InflateRaw;
|
||||
export function createUnzip(options?: ZlibOptions): Unzip;
|
||||
|
||||
export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function deflate(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function deflateSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function gzip(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function gzipSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function gunzip(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function gunzipSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function inflate(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function inflateSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void;
|
||||
export function unzip(buf: Buffer, callback: (error: Error, result: any) => void): void;
|
||||
export function unzipSync(buf: Buffer, options?: ZlibOptions): any;
|
||||
|
||||
// Constants
|
||||
@@ -846,7 +846,7 @@ declare module "os" {
|
||||
export function totalmem(): number;
|
||||
export function freemem(): number;
|
||||
export function cpus(): CpuInfo[];
|
||||
export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]};
|
||||
export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };
|
||||
export var EOL: string;
|
||||
}
|
||||
|
||||
@@ -870,7 +870,7 @@ declare module "https" {
|
||||
SNICallback?: (servername: string) => any;
|
||||
}
|
||||
|
||||
export interface RequestOptions extends http.RequestOptions{
|
||||
export interface RequestOptions extends http.RequestOptions {
|
||||
pfx?: any;
|
||||
key?: any;
|
||||
passphrase?: string;
|
||||
@@ -891,8 +891,8 @@ declare module "https" {
|
||||
};
|
||||
export interface Server extends tls.Server { }
|
||||
export function createServer(options: ServerOptions, requestListener?: Function): Server;
|
||||
export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest;
|
||||
export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
|
||||
@@ -946,7 +946,7 @@ declare module "readline" {
|
||||
pause(): ReadLine;
|
||||
resume(): ReadLine;
|
||||
close(): void;
|
||||
write(data: string|Buffer, key?: Key): void;
|
||||
write(data: string | Buffer, key?: Key): void;
|
||||
}
|
||||
|
||||
export interface Completer {
|
||||
@@ -971,7 +971,7 @@ declare module "readline" {
|
||||
export function createInterface(options: ReadLineOptions): ReadLine;
|
||||
|
||||
export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void;
|
||||
export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void;
|
||||
export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
|
||||
export function clearLine(stream: NodeJS.WritableStream, dir: number): void;
|
||||
export function clearScreenDown(stream: NodeJS.WritableStream): void;
|
||||
}
|
||||
@@ -1013,7 +1013,7 @@ declare module "child_process" {
|
||||
import * as stream from "stream";
|
||||
|
||||
export interface ChildProcess extends events.EventEmitter {
|
||||
stdin: stream.Writable;
|
||||
stdin: stream.Writable;
|
||||
stdout: stream.Readable;
|
||||
stderr: stream.Readable;
|
||||
stdio: [stream.Writable, stream.Readable, stream.Readable];
|
||||
@@ -1051,11 +1051,11 @@ declare module "child_process" {
|
||||
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;
|
||||
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 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;
|
||||
@@ -1072,16 +1072,16 @@ declare module "child_process" {
|
||||
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;
|
||||
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;
|
||||
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 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;
|
||||
@@ -1197,24 +1197,24 @@ declare module "url" {
|
||||
path?: string;
|
||||
}
|
||||
|
||||
export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url;
|
||||
export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url;
|
||||
export function format(url: Url): string;
|
||||
export function resolve(from: string, to: string): string;
|
||||
}
|
||||
|
||||
declare module "dns" {
|
||||
export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string;
|
||||
export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string;
|
||||
export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[];
|
||||
export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[];
|
||||
export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) => void): string;
|
||||
export function lookup(domain: string, callback: (err: Error, address: string, family: number) => void): string;
|
||||
export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolve(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolve4(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolve6(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[];
|
||||
export function reverse(ip: string, callback: (err: Error, domains: string[]) => void): string[];
|
||||
}
|
||||
|
||||
declare module "net" {
|
||||
@@ -1289,12 +1289,12 @@ declare module "net" {
|
||||
maxConnections: number;
|
||||
connections: number;
|
||||
}
|
||||
export function createServer(connectionListener?: (socket: Socket) =>void ): Server;
|
||||
export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server;
|
||||
export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
|
||||
export function createServer(connectionListener?: (socket: Socket) => void): Server;
|
||||
export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) => void): Server;
|
||||
export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
|
||||
export function connect(port: number, host?: string, connectionListener?: Function): Socket;
|
||||
export function connect(path: string, connectionListener?: Function): Socket;
|
||||
export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
|
||||
export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;
|
||||
export function createConnection(port: number, host?: string, connectionListener?: Function): Socket;
|
||||
export function createConnection(path: string, connectionListener?: Function): Socket;
|
||||
export function isIP(input: string): number;
|
||||
@@ -1422,7 +1422,7 @@ declare module "fs" {
|
||||
export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void;
|
||||
export function readlinkSync(path: string): string;
|
||||
export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
|
||||
export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void;
|
||||
export function realpath(path: string, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
|
||||
export function realpathSync(path: string, cache?: { [path: string]: string }): string;
|
||||
/*
|
||||
* Asynchronous unlink - deletes the file specified in {path}
|
||||
@@ -1612,7 +1612,7 @@ declare module "fs" {
|
||||
export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void;
|
||||
export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
|
||||
/** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */
|
||||
export function accessSync(path: string, mode ?: number): void;
|
||||
export function accessSync(path: string, mode?: number): void;
|
||||
export function createReadStream(path: string, options?: {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
@@ -1744,33 +1744,33 @@ declare module "path" {
|
||||
export function format(pathObject: ParsedPath): string;
|
||||
|
||||
export module posix {
|
||||
export function normalize(p: string): string;
|
||||
export function join(...paths: any[]): string;
|
||||
export function resolve(...pathSegments: any[]): string;
|
||||
export function isAbsolute(p: string): boolean;
|
||||
export function relative(from: string, to: string): string;
|
||||
export function dirname(p: string): string;
|
||||
export function basename(p: string, ext?: string): string;
|
||||
export function extname(p: string): string;
|
||||
export var sep: string;
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
export function normalize(p: string): string;
|
||||
export function join(...paths: any[]): string;
|
||||
export function resolve(...pathSegments: any[]): string;
|
||||
export function isAbsolute(p: string): boolean;
|
||||
export function relative(from: string, to: string): string;
|
||||
export function dirname(p: string): string;
|
||||
export function basename(p: string, ext?: string): string;
|
||||
export function extname(p: string): string;
|
||||
export var sep: string;
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
}
|
||||
|
||||
export module win32 {
|
||||
export function normalize(p: string): string;
|
||||
export function join(...paths: any[]): string;
|
||||
export function resolve(...pathSegments: any[]): string;
|
||||
export function isAbsolute(p: string): boolean;
|
||||
export function relative(from: string, to: string): string;
|
||||
export function dirname(p: string): string;
|
||||
export function basename(p: string, ext?: string): string;
|
||||
export function extname(p: string): string;
|
||||
export var sep: string;
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
export function normalize(p: string): string;
|
||||
export function join(...paths: any[]): string;
|
||||
export function resolve(...pathSegments: any[]): string;
|
||||
export function isAbsolute(p: string): boolean;
|
||||
export function relative(from: string, to: string): string;
|
||||
export function dirname(p: string): string;
|
||||
export function basename(p: string, ext?: string): string;
|
||||
export function extname(p: string): string;
|
||||
export var sep: string;
|
||||
export var delimiter: string;
|
||||
export function parse(p: string): ParsedPath;
|
||||
export function format(pP: ParsedPath): string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1791,7 +1791,7 @@ declare module "tls" {
|
||||
|
||||
var CLIENT_RENEG_LIMIT: number;
|
||||
var CLIENT_RENEG_WINDOW: number;
|
||||
|
||||
|
||||
export interface Certificate {
|
||||
/**
|
||||
* Country code.
|
||||
@@ -1830,7 +1830,7 @@ declare module "tls" {
|
||||
version: string;
|
||||
}
|
||||
|
||||
export interface TLSSocket extends stream.Duplex {
|
||||
export class TLSSocket extends stream.Duplex {
|
||||
/**
|
||||
* Returns the bound address, the address family name and port of the underlying socket as reported by
|
||||
* the operating system.
|
||||
@@ -1931,7 +1931,7 @@ declare module "tls" {
|
||||
*/
|
||||
setMaxSendFragment(size: number): boolean;
|
||||
}
|
||||
|
||||
|
||||
export interface TlsOptions {
|
||||
host?: string;
|
||||
port?: number;
|
||||
@@ -2012,10 +2012,10 @@ declare module "tls" {
|
||||
context: any;
|
||||
}
|
||||
|
||||
export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server;
|
||||
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 createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) => void): Server;
|
||||
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?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
|
||||
export function createSecureContext(details: SecureContextOptions): SecureContext;
|
||||
}
|
||||
@@ -2051,9 +2051,9 @@ declare module "crypto" {
|
||||
export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;
|
||||
export interface Cipher extends NodeJS.ReadWriteStream {
|
||||
update(data: Buffer): Buffer;
|
||||
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;
|
||||
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;
|
||||
@@ -2063,9 +2063,9 @@ declare module "crypto" {
|
||||
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
|
||||
export interface Decipher extends NodeJS.ReadWriteStream {
|
||||
update(data: Buffer): Buffer;
|
||||
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;
|
||||
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;
|
||||
@@ -2094,14 +2094,14 @@ declare module "crypto" {
|
||||
setPrivateKey(public_key: string, encoding?: string): void;
|
||||
}
|
||||
export function getDiffieHellman(group_name: string): DiffieHellman;
|
||||
export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void;
|
||||
export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
|
||||
export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer;
|
||||
export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer;
|
||||
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void;
|
||||
export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;
|
||||
export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number): Buffer;
|
||||
export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer;
|
||||
export function randomBytes(size: number): Buffer;
|
||||
export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
|
||||
export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
|
||||
export function pseudoRandomBytes(size: number): Buffer;
|
||||
export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void;
|
||||
export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;
|
||||
export interface RsaPublicKey {
|
||||
key: string;
|
||||
padding?: any;
|
||||
@@ -2111,8 +2111,8 @@ declare module "crypto" {
|
||||
passphrase?: string,
|
||||
padding?: any;
|
||||
}
|
||||
export function publicEncrypt(public_key: string|RsaPublicKey, buffer: Buffer): Buffer
|
||||
export function privateDecrypt(private_key: string|RsaPrivateKey, buffer: Buffer): Buffer
|
||||
export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer
|
||||
export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer
|
||||
}
|
||||
|
||||
declare module "stream" {
|
||||
@@ -2176,7 +2176,7 @@ declare module "stream" {
|
||||
end(chunk: any, encoding?: string, cb?: Function): void;
|
||||
}
|
||||
|
||||
export interface TransformOptions extends ReadableOptions, WritableOptions {}
|
||||
export interface TransformOptions extends ReadableOptions, WritableOptions { }
|
||||
|
||||
// Note: Transform lacks the _read and _write methods of Readable/Writable.
|
||||
export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream {
|
||||
@@ -2201,7 +2201,7 @@ declare module "stream" {
|
||||
end(chunk: any, encoding?: string, cb?: Function): void;
|
||||
}
|
||||
|
||||
export class PassThrough extends Transform {}
|
||||
export class PassThrough extends Transform { }
|
||||
}
|
||||
|
||||
declare module "util" {
|
||||
@@ -2225,11 +2225,11 @@ declare module "util" {
|
||||
export function isDate(object: any): boolean;
|
||||
export function isError(object: any): boolean;
|
||||
export function inherits(constructor: any, superConstructor: any): void;
|
||||
export function debuglog(key:string): (msg:string,...param: any[])=>void;
|
||||
export function debuglog(key: string): (msg: string, ...param: any[]) => void;
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal (value: any, message?: string): void;
|
||||
function internal(value: any, message?: string): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -2239,8 +2239,10 @@ declare module "assert" {
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
|
||||
constructor(options?: {message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function});
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual?: any, expected?: any, message?: string, operator?: string): void;
|
||||
|
||||
Reference in New Issue
Block a user