import type { AggregateProgress, FileUploadState, FilesClient, FilesClientConfig } from "../client/index.js"; import { FilesError } from "../internal/errors.js"; export interface UseFilesOptions extends FilesClientConfig { /** External signal merged into every call this hook makes. */ signal?: AbortSignal; } /** `TData`: what the gateway's `onUploadComplete` returns — see `InferUploadData`. */ export interface UseFilesResult extends FilesClient { /** `true` while any `upload()` started by this hook is in flight. */ isUploading: boolean; /** * One entry per file this hook has uploaded — accumulated across every * `upload()` call (keyless, keyed, and each item of a bulk `upload([...])`, * concurrent or sequential) until `reset()` clears the finished ones. An * entry keeps its position for the file's whole upload and is replaced by a * fresh snapshot on each change; its `status` always ends `"success"`, * `"error"` (with `error` set), or `"aborted"`. */ uploads: readonly FileUploadState[]; /** Aggregate progress over the current `uploads` entries. */ progress: AggregateProgress; /** The last error from any verb (including errors thrown while iterating `listAll`/`search`). */ error: FilesError | undefined; /** * Clear the ambient error and the finished `uploads` entries (in-flight ones * stay, as does `isUploading`), and re-arm after an `abort`. */ reset: () => void; /** Abort every in-flight call this hook started; `cause` becomes the abort reason. */ abort: (cause?: unknown) => void; } export declare const useFiles: (opts?: UseFilesOptions) => UseFilesResult; //# sourceMappingURL=use-files.d.ts.map