/** * Throwable response helpers — mirror the shape of `redirect()` so route loaders * and components can short-circuit rendering by throwing a typed error. The * edge adapter catches them in its outer `try/catch` and maps each to an * `EdgeResponse`. * * Example: * * ```ts * if (!user) throw notFound(); * if (!data) throw json({ message: 'no data' }, 502); * ``` */ export type SsrJsonStatus = number; export declare class SsrJsonResponse extends Error { readonly status: SsrJsonStatus; readonly body: unknown; readonly headers: Record; constructor(body: unknown, status?: SsrJsonStatus, headers?: Record); } export declare class SsrNotFound extends Error { readonly message: string; constructor(message?: string); } /** Throwable JSON helper. Status defaults to 200. */ export declare function json(body: unknown, status?: SsrJsonStatus, headers?: Record): never; /** Throwable 404. */ export declare function notFound(message?: string): never; export declare function isJsonResponse(err: unknown): err is SsrJsonResponse; export declare function isNotFound(err: unknown): err is SsrNotFound; //# sourceMappingURL=response.d.ts.map