import { FilesError } from "../errors.js"; import type { WireError, WireErrorCode, WireErrorReason, WireFilesError } from "../files-router/protocol.js"; /** * A failure the router itself raises (authorization, validation, origin) — as * opposed to a `FilesError` bubbling up from a `Files` call. Carries a wire code * and optional `reason` directly. */ export declare class RouterError extends Error { readonly code: WireErrorCode; readonly reason?: WireErrorReason; constructor(code: WireErrorCode, message: string, reason?: WireErrorReason); } export declare const httpStatus: (code: WireErrorCode) => number; /** Serialize a `FilesError` to the wire shape — the safe subset, no `cause`. */ export declare const serializeFilesError: (error: FilesError) => WireFilesError; /** Map any thrown value to a wire error envelope + HTTP status. */ export declare const toErrorResult: (err: unknown) => { status: number; body: WireError; }; //# sourceMappingURL=envelope.d.ts.map