export interface ValidatedAddress { address: string; family: number; } interface PinnedLookupOptions { family?: number | "IPv4" | "IPv6"; all?: boolean; } type PinnedLookupCallback = (err: NodeJS.ErrnoException | null, address: string | ValidatedAddress[], family?: number) => void; /** Node's lookup callback used by http/https request `lookup` option. */ export type PinnedLookup = (hostname: string, options: PinnedLookupOptions | PinnedLookupCallback, callback?: PinnedLookupCallback) => void; export declare function isPrivateIpv4(value: string): boolean; export declare function isPrivateIpv6(value: string): boolean; export declare function isLocalHostname(hostname: string): boolean; export declare function isPrivateAddress(value: string): boolean; /** * Validate that `targetUrl` is a public destination and return the exact set of * IP addresses it resolved to. Callers MUST connect using {@link createPinnedLookup} * with the returned addresses so the socket cannot be re-pointed at a private IP * between validation and connection (DNS-rebinding / TOCTOU SSRF). */ export declare function assertPublicRequestTarget(targetUrl: URL): Promise; export declare function assertPublicRedirectTarget(targetUrl: URL): Promise; /** * Build a `lookup` function for http/https requests that only ever yields the * pre-validated public addresses, closing the gap between validation and the * connection's own DNS resolution. */ export declare function createPinnedLookup(addresses: ValidatedAddress[]): PinnedLookup; export {};