export declare function downloadFileFromUrl(url: string, filename: string, opts?: { credentials?: RequestCredentials; }): Promise<{ bytes: number; }>; export interface ShareableFile { url: string; filename: string; mimeType?: string; } export type ShareOrDownloadResult = { delivered: "share"; count: number; } | { delivered: "download"; count: number; }; /** A genuine share failure throws. */ export type ShareFilesResult = "shared" | "cancelled" | "unsupported"; /** * Probed with a dummy File, so a menu can decide to offer Share before fetching. The share paths * re-check the real files. */ export declare function canShareFiles(): boolean; /** * Run before the gesture (the iOS note above). `null` when Web Share is unavailable or the set is * not shareable; throws if a fetch fails. */ export declare function prepareShareFiles(files: ShareableFile[], opts?: { credentials?: RequestCredentials; }): Promise; /** Call synchronously from the gesture so iOS keeps activation. A real failure throws. */ export declare function shareFiles(fileObjs: File[], opts?: { title?: string; text?: string; }): Promise; /** For fast URLs (presigned R2); slow ones use {@link prepareShareFiles} + {@link shareFiles}. */ export declare function shareOrDownloadFiles(files: ShareableFile[], opts?: { title?: string; text?: string; credentials?: RequestCredentials; }): Promise;