type FetchImpl = (input: string, init?: RequestInit) => Promise; export interface NormalizeOptions { /** Override the underlying fetch. Defaults to `globalThis.fetch`. */ fetchImpl?: FetchImpl; /** Probe timeout per scheme attempt. Default 10s. */ timeoutMs?: number; } export interface NormalizeResult { /** Final URL string with explicit http(s) scheme. */ url: string; /** True when a scheme had to be added (caller may want to echo a notice). */ rewrote: boolean; } export declare class UnreachableUrlError extends Error { readonly input: string; constructor(input: string); } /** * Resolve a user-supplied URL to one with an explicit http(s) scheme. * * Behaviour: * 1. If the input already parses as an http(s) URL, return it unchanged. * 2. Otherwise probe `https://`. Any HTTP response (incl. 4xx/5xx) * counts as "reachable" — only connection errors fall through. * 3. If https fails, probe `http://`. * 4. If both fail, throw `UnreachableUrlError`. */ export declare function normalizeUrl(input: string, opts?: NormalizeOptions): Promise; export {};