export interface HttpErrorDetails { [key: string]: unknown; } export interface HttpErrorJson { error: string; status: number; details?: HttpErrorDetails; } /** * HTTP error class for structured error handling in route handlers. * Provides static factory methods for common HTTP error responses. */ export declare class HttpError extends Error { readonly status: number; readonly details?: HttpErrorDetails; constructor(status: number, message: string, details?: HttpErrorDetails); /** * Detects HttpError across bundle boundaries where `instanceof` can fail. * * @remarks * Page modules may load a different class identity than core runtime code. * Prefer this over `instanceof` when catching errors from app page bundles. */ static isHttpError(error: unknown): error is HttpError; /** * Serialize error to JSON for API responses. */ toJSON(): HttpErrorJson; /** * Create a Response object from this error. */ toResponse(): Response; static BadRequest(message?: string, details?: HttpErrorDetails): HttpError; static Unauthorized(message?: string): HttpError; static Forbidden(message?: string): HttpError; static NotFound(message?: string): HttpError; static Conflict(message?: string, details?: HttpErrorDetails): HttpError; static InternalServerError(message?: string): HttpError; }