export function uploadFile(file: File, options: UploadFileOptions): Promise; export function upload(options: UploadOptions & { clearOnUpload?: boolean; }): (node: HTMLInputElement) => void; export function dropzone(options: UploadOptions): (node: HTMLElement) => void; /** * Result of a successful upload. `hash` is only present when the * upload went through the content-addressed path (an `existsUrl` was * provided). */ export type UploadResult = { url: string; file: File; hash?: string; }; /** * Options for {@link uploadFile} — the imperative primitive. */ export type UploadFileOptions = { endpoint: string; existsUrl?: (hash: string, file: File) => string; field?: string; parseResponse?: (text: string, xhr: XMLHttpRequest) => string; onProgress?: (info: { file: File; loaded: number; total: number; }) => void; signal?: AbortSignal; }; /** * Options shared by the {@link upload} and {@link dropzone} ref * factories. Extends {@link UploadFileOptions} with policy (`accept`, * `maxSize`) and lifecycle callbacks fired by the ref factories — * `uploadFile` itself is policy-free. */ export type UploadOptions = Omit & { accept?: string; maxSize?: number; onUpload: (results: UploadResult[]) => void; onFile?: (result: UploadResult) => void; onError?: (error: Error, file: File) => void; onReject?: (file: File, reason: "type" | "size") => void; }; //# sourceMappingURL=upload.d.ts.map