/** * useFileDownload Hook * * Hook for downloading files with progress tracking and browser download triggering. * Progress is tracked globally via store (updated by streams). * Errors propagate through global error handling (error boundaries, global error store). * * @returns {CoreFileDownloadResult} Object containing: * - `download` - Download a file by ID, returns Blob or null * - `isDownloading` - Whether any download is in progress * - `currentFileId` - ID of file currently downloading (or null) * - `progress` - Overall download progress (0-100) * - `cancel` - Cancel all active downloads * * @example Basic usage * ```typescript * const { download, isDownloading, progress, cancel } = useFileDownload(); * * const handleDownload = async () => { * const blob = await download('file-123'); * if (blob) console.log('Downloaded', blob.size, 'bytes'); * }; * * return ( * * ); * ``` * * @example With custom filename * ```typescript * await download('file-123', { filename: 'custom-name.pdf' }); * ``` */ import { type CoreFileDownloadResult } from '@plyaz/types/core'; /** * Hook for downloading files with progress tracking. * * Features: * - Tracks download progress in real-time via store (updated by streams) * - Auto-triggers browser download on completion * - Supports custom filenames * - Provides cancel functionality via @plyaz/api * - Errors propagate to global error handling * * @returns Download function and state */ export declare function useFileDownload(): CoreFileDownloadResult; //# sourceMappingURL=useFileDownload.d.ts.map