export type DownloadStatus = 'idle' | 'loading' | 'done' | 'error'; export type DownloadResult = void | Blob | File | string | ArrayBuffer | Response; interface DownloadButtonProps { /** Direct URL (uses native `` when no async handler). */ href?: string; /** Suggested filename for downloads. */ filename?: string; label?: string; loadingLabel?: string; doneLabel?: string; errorLabel?: string; size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; variant?: 'primary' | 'secondary' | 'ghost' | 'outline' | 'destructive'; disabled?: boolean; /** Controlled loading (also set automatically in async mode). */ loading?: boolean; /** Bindable status for external UI. */ status?: DownloadStatus; fullWidth?: boolean; showIcon?: boolean; iconOnly?: boolean; /** How long to show the success state (ms). 0 = keep done. */ doneDuration?: number; /** Optional MIME when downloading ArrayBuffer / constructing Blob. */ mimeType?: string; /** Open `href` in a new tab instead of downloading. */ openInNewTab?: boolean; class?: string; /** * Async / programmatic download. May return: * - `void` (you handle the download yourself) * - `Blob` | `File` | `ArrayBuffer` | data URL / object URL string * - `Response` (body is consumed as blob) * - `Promise` of any of the above */ ondownload?: () => DownloadResult | Promise; /** Fired when a download finishes successfully. */ onsuccess?: (filename?: string) => void; /** Fired when async download fails. */ onerror?: (error: unknown) => void; /** Legacy click hook (still called for link mode). */ onclick?: () => void; } declare const DownloadButton: import("svelte").Component; type DownloadButton = ReturnType; export default DownloadButton;