import { M2CError } from '@m2c/core'; /** * Thrown by {@link M2CClient.createAuction} when the API returns a non-2xx * status or the request fails at the network layer. `status` is the HTTP code * (0 when no HTTP response was received - network failure or timeout) and * `code` is a stable machine-readable tag (see below); `body` is the parsed * error payload when available. */ export declare class M2CApiError extends M2CError { readonly status: number; readonly code: ApiErrorCode; readonly body?: unknown; /** Present on 429/503 responses when the server set a Retry-After header. */ readonly retryAfterSeconds?: number; constructor(status: number, code: ApiErrorCode, message: string, body?: unknown, retryAfterSeconds?: number); /** * True for transient failures where a retry MAY succeed: any 5xx, 429, and * network/timeout failures, plus an auction still in progress. Reuse the * same idempotency key AND request body when retrying. This flag describes * the failure, not whether the caller supplied replay protection. */ get retryable(): boolean; } /** * Stable error tags derived from documented auction codes or HTTP status, * so callers can branch without string-matching messages. `no_winner` is an auction * outcome, not a fault; routes other than the auction surface 404 as `not_found` * (e.g. a refund for a conversion that doesn't exist or isn't yours) so a caller * branching on the code can't mistake it for a no-vendor auction. 502, 503, * and 504 are the same transient unavailability class. */ export type ApiErrorCode = 'auction_in_progress' | 'idempotency_mismatch' | 'no_eligible_vendors' | 'no_bids' | 'no_valid_bids' | 'bad_request' | 'unauthorized' | 'forbidden' | 'no_winner' | 'not_found' | 'conflict' | 'unprocessable' | 'rate_limited' | 'server_error' | 'unavailable' | 'unknown'; /** Only accept documented auction codes with their matching HTTP status. */ export declare function auctionErrorCode(status: number, body: unknown): ApiErrorCode; export declare function apiErrorCodeForStatus(status: number): ApiErrorCode;