export declare function actionErrorStatus(error: unknown): number | undefined; export declare function actionErrorCode(error: unknown): string | undefined; /** The server's Retry-After, already capped by the action client. */ export declare function actionErrorRetryAfterMs(error: unknown): number | undefined; /** * True when re-sending the same request cannot succeed: a client error other * than the timeout/rate-limit statuses, or a typed code in the non-retryable * set. A rate limit that names its own Retry-After is a cooldown, not terminal. */ export declare function isTerminalActionError(error: unknown): boolean; /** * True when polling should stop. Narrower than `isTerminalActionError`: a * plain 404 keeps polling, because a resource still being created can read as * not found for a tick; only a typed `not_found` says it is gone. */ export declare function endsActionPolling(error: unknown): boolean; /** Thrown instead of a network call while a query's circuit is open. */ export declare class ActionCircuitOpenError extends Error { readonly circuitOpen = true; status?: number; errorCode?: string; actionMessage?: string; details?: unknown; retryAfterMs?: number; constructor(last: unknown); } export declare function isActionCircuitOpenError(error: unknown): error is ActionCircuitOpenError; export interface ActionCircuitTrip { /** The circuit went from closed to open on this failure. */ tripped: boolean; failures: number; cooldownMs: number; } /** * Record one failed fetch cycle (retries exhausted or not retryable). Only a * refusal the server meant counts; a transient failure leaves the circuit as * it was. */ export declare function recordActionFailure(key: string, error: unknown, now?: number): ActionCircuitTrip; export declare function resetActionFailureCircuit(key: string): void; export declare function resetActionFailureCircuits(): void; /** Milliseconds until automatic refetching may resume; 0 when closed. */ export declare function actionCircuitRemainingMs(key: string | undefined, now?: number): number; /** * Rejects without a request while the circuit is open. A fetch within a few * seconds of a click or keypress is the user retrying on purpose, so it goes * through; timers and sync invalidations have no gesture and stay paused. */ export declare function assertActionCircuitClosed(key: string, now?: number): void;