Urara-Blog/node_modules/.pnpm-store/v3/files/3e/077f820245d06411e1c63e7d15c70a3690c8f5b7f6ad35b6c9c99f848e87544d93de2d103a0f28009b5f4a04e3d22c6e12279bd05156daac8142331082c597
2022-08-14 01:14:53 +08:00

26 lines
841 B
Text

import {TLSSocket, ConnectionOptions} from 'tls'
import {IpcNetConnectOpts, Socket, TcpNetConnectOpts} from 'net'
export = buildConnector
declare function buildConnector (options?: buildConnector.BuildOptions): typeof buildConnector.connector
declare namespace buildConnector {
export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
maxCachedSessions?: number | null;
socketPath?: string | null;
timeout?: number | null;
port?: number;
}
export interface Options {
hostname: string
host?: string
protocol: string
port: number
servername?: string
}
export type Callback = (err: Error | null, socket: Socket | TLSSocket | null) => void
export function connector (options: buildConnector.Options, callback: buildConnector.Callback): Socket | TLSSocket;
}