UNPKG

904 BTypeScriptView Raw
1/// <reference types="node" />
2/// <reference types="node" />
3/// <reference types="node" />
4import net from 'net';
5import dns from 'dns';
6type LookupFunction = (hostname: string, options: dns.LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void) => void;
7export declare function connectInParallel(options: {
8 host: string;
9 port: number;
10 localAddress?: string | undefined;
11}, lookup: LookupFunction, signal: AbortSignal): Promise<net.Socket>;
12export declare function connectInSequence(options: {
13 host: string;
14 port: number;
15 localAddress?: string | undefined;
16}, lookup: LookupFunction, signal: AbortSignal): Promise<net.Socket>;
17/**
18 * Look up all addresses for the given hostname.
19 */
20export declare function lookupAllAddresses(host: string, lookup: LookupFunction, signal: AbortSignal): Promise<dns.LookupAddress[]>;
21export {};