import { type LocalUploadAttachment } from 'stream-chat'; export type DownloadableAttachment = { asset_url?: string; image_url?: string; localMetadata?: LocalUploadAttachment['localMetadata']; title?: string; }; export declare const isDownloadableAttachment: (attachment: unknown) => attachment is DownloadableAttachment; /** * Downloads an attachment from its local file when it has one, otherwise from its URL. A remote * URL is fetched into a blob first, because sequential direct clicks on cross-origin URLs can * yield a single file in Chromium and blob URLs keep the `a.download` name more reliably. When * the fetch fails (e.g. CORS), the URL is downloaded directly. * * @param attachment - Attachment to download. Does nothing without a local file or URL. * @param options.openRemoteInNewTab - Open a directly downloaded remote URL in a new tab. * Defaults to true. * @param options.preferRemoteFetch - Fetch a remote URL as a blob before downloading it. * Defaults to true. */ export declare const downloadAttachment: (attachment: DownloadableAttachment, options?: { openRemoteInNewTab?: boolean; preferRemoteFetch?: boolean; }) => Promise; export declare const downloadAllAttachments: (attachments: DownloadableAttachment[]) => Promise; //# sourceMappingURL=downloadUtils.d.ts.map