/** * Download File Service * Downloads a file from storage by ID */ import type { DownloadFileRequest, ServiceOptions } from '@plyaz/types/api'; import type { EndpointsList } from '@/api/endpoints'; import type { FetchResponse } from 'fetchff'; /** * Download a file from storage * Uses endpoint: GET /files/:id/download * * @param request - Request with file ID * @param options - Optional service options (client override, config overrides) * @returns Promise * * @example * ```typescript * // Download a file by ID * const result = await downloadFile({ id: '550e8400-e29b-41d4-a716-446655440000' }); * * // The result.buffer is base64 encoded * const blob = new Blob([ * Uint8Array.from(atob(result.buffer), c => c.charCodeAt(0)) * ], { type: result.mimeType }); * * // Create download link * const url = URL.createObjectURL(blob); * const a = document.createElement('a'); * a.href = url; * a.download = result.filename || 'download'; * a.click(); * ``` * * @throws {ApiPackageError} When the file is not found or download fails */ export declare function downloadFile(request: DownloadFileRequest, options?: ServiceOptions): Promise; //# sourceMappingURL=downloadFile.d.ts.map