/** Preview targets: the `/x/…` bootstrap prefix and the clean-path binding it establishes (docs/design/net.md § Client: service worker). */ /** Reserved path prefix. */ export declare const PREVIEW_PREFIX = "/x/"; export interface PreviewTarget { /** Gateway destination name — the routing key for multi-server gateways. */ dest: string; scheme: "http" | "https"; host: string; port: number; } /** `https://localhost:3000` → a target on `dest`. */ export declare function parsePreviewLocation(location: string, dest: string): PreviewTarget; /** The human form of a target, as typed and as remembered. */ export declare function formatPreviewLocation(target: PreviewTarget): string; /** Bootstrap URL for an iframe: carries the target explicitly, so the binding needs no side channel and survives a worker restart via `client.url`. */ export declare function previewBootstrapUrl(target: PreviewTarget, path?: string): string; /** Query parameter that names a frame's target. */ export declare const PREVIEW_QUERY = "blit-preview"; /** Query parameter carrying the initial path on that target. */ export declare const PREVIEW_PATH_QUERY = "blit-path"; /** * The URL an iframe is pointed at: the origin root, with the target in the * query. * * `pathname` is `/`, which is what a client-side router reads, so a previewed * SPA routes on its own paths rather than on a proxy prefix. Two constraints * force the query rather than something tidier. A navigation's * `Window.location` is the *request* URL, kept even across redirects, so no * response can rewrite a prefixed path after the fact; and a frame whose URL * equals an ancestor's is refused as recursive nesting, so a bare `/` cannot * load inside an app that is itself served at `/`. */ export declare function previewFrameUrl(target: PreviewTarget, path?: string): string; /** Parse what previewFrameUrl encoded, or null. */ export declare function parsePreviewFrameUrl(pathname: string, search: string): ParsedBootstrap | null; export interface ParsedBootstrap { target: PreviewTarget; /** Path on the target, always starting with "/". */ path: string; } /** Parse a bootstrap pathname (plus query) back into a target and path. */ export declare function parseBootstrapUrl(pathname: string, search?: string): ParsedBootstrap | null; /** * Whether a `[remote>][command]` entry is really a location. * * An explicit scheme, or a `host:port` — a port is what makes it unambiguous. * A bare word stays a command: `localhost` is a plausible program name, and * guessing wrong would swallow a terminal the user asked for. */ export declare function looksLikeWebLocation(entry: string): boolean; /** Two targets are the same relayed origin — the pooling and cookie-jar key. */ export declare function previewKey(target: PreviewTarget): string; //# sourceMappingURL=preview.d.ts.map