/** * Normalise app configuration into the map the resolver reads. * * Resolved once at boot rather than per request: `@stacksjs/config` fills in * overrides asynchronously, so a per-request read would answer differently * depending on how far boot had got. * * Invalid entries are dropped rather than thrown on. A malformed redirect * should not stop a site from booting, and the one that matters — a rule that * points at itself, which would loop the browser until it gives up — is caught * here rather than in production. */ export declare function resolveRedirectRules(input?: RedirectConfig): RedirectRules; /*': 'https://dash.example.com'` lands on * `https://dash.example.com/events/42`. No regular expressions, no captures, * no ordering to reason about. */ export declare function resolveRedirect(url: URL, rules?: RedirectRules): Response | undefined; /** * A one-line summary for the dev server's boot output. * * Same reasoning as `describeApiProxyRules`: a redirect you did not expect is * very hard to diagnose when the rule that caused it is invisible. */ export declare function describeRedirectRules(rules: RedirectRules): string; /** Permanent unless the app says otherwise: these describe moved pages. */ export declare const DEFAULT_REDIRECT_STATUS: 301; export declare interface RedirectTarget { to: string status?: number preserveQuery?: boolean } export declare interface RedirectRule { from: string to: string status: number preserveQuery: boolean subtree: boolean } /** What an app writes in `config/server.ts` under `redirects`. */ export type RedirectConfig = Record; export type RedirectRules = Map;