/** Serialized mates-fullstack redirect payload. */ export interface WireRedirect { __type: "Redirect"; url: string; status?: number; } export type WireErrorHandler = (data: unknown) => Error | null; export type WireRedirectHandler = (url: string, options?: { replace?: boolean; }) => void; /** Register a handler for serialized server errors (e.g. mates-fullstack). */ export declare function setFetchWireErrorHandler(handler: WireErrorHandler | null): void; export declare function getFetchWireErrorHandler(): WireErrorHandler | null; /** * Register SPA navigation for serialized `{ __type: "Redirect" }` responses. * Wire `navigateTo` from `useUtils()` here so RPC redirects update the router. */ export declare function setFetchWireRedirectHandler(handler: WireRedirectHandler | null): void; export declare function getFetchWireRedirectHandler(): WireRedirectHandler | null; export declare function isWireRedirect(data: unknown): data is WireRedirect; export declare function isExternalUrl(url: string): boolean; /** * Navigate after a serialized redirect. * External URLs use `location.href`. Internal URLs call the registered * redirect handler (typically `navigateTo`) or fall back to history + popstate. */ export declare function handleWireRedirect(url: string, options?: { replace?: boolean; }): void; export declare class FetchHttpError extends Error { readonly status: number; readonly code: string; readonly data: Record; constructor(message: string, status: number, code: string, data?: Record); } export declare function throwFetchHttpError(status: number, data: Record | null, statusText?: string): never; //# sourceMappingURL=wireError.d.ts.map