import type { OffsetResumableDriver, ResumableUploadSession, UploadResult } from "../index.js"; import { FilesError } from "./errors.js"; /** * Classify a failed session response with the standard status buckets * `makeErrorMapper` uses — 404/410 → `NotFound` (an unknown or expired session * URI: GCS answers 404, Drive 410), 401/403 → `Unauthorized`, 409/412 → * `Conflict`, anything else → `Provider`. The classified 4xx answers are * deterministic for this session — re-sending the same chunk can only fail the * same way — so they're flagged `permanent`; only a `Provider` failure (5xx, * 408, 429, …) stays retryable. Shared with the hand-rolled offset drivers * (Supabase TUS, Cloudinary chunked uploads); `detail` appends the response * body where a provider explains the failure there. */ export declare const statusError: (status: number, message: string, detail?: string) => FilesError; /** * Check the answer to a session-cancel `DELETE`. The session is gone — the * cancel succeeded — on any 2xx, on 404/410 (already completed, expired, or * discarded), and on GCS's documented `499 Client Closed Request`, its success * reply to cancelling a resumable upload. Anything else means the provider * refused or failed the cancel and the session may still be live, so it * throws through {@link statusError}: a 401/403 is `Unauthorized`, a 5xx a * retryable `Provider` error. Shared with the hand-rolled offset drivers that * cancel their own session URL. */ export declare const assertSessionDiscarded: (res: Response, message: string) => void; export declare const createOffsetHttpDriver: (params: { partSize: number; /** Open the provider session; return the token plus the URL to PUT chunks to. */ open: (meta: { total: number; contentType: string; }) => Promise<{ session: ResumableUploadSession; uri: string; }>; /** Validate a resume token and return its session URL. Throws on a mismatch. */ resume: (session: ResumableUploadSession) => string; /** Parse a `200`/`201` completion response into an {@link UploadResult}. */ parseResult: (res: Response) => Promise; wrapErr: (cause: unknown) => FilesError; }) => OffsetResumableDriver; //# sourceMappingURL=resumable-offset-http.d.ts.map