import type { Upload, DocumentQuery, DbOperation } from './types.ts'; /** * Input for file upload - can be either a File from FormData or a Buffer with filename */ type UploadInput = File | { data: Buffer; filename: string; }; /** * Adds an upload to a document, handling both database and file system operations. * * This function: * 1. Generates a unique storage filename with timestamp and random bytes * 2. If filename collides with existing upload, marks that upload as hidden and renames it * 3. Creates the upload record in the database (with transaction) * 4. Writes the file to disk * * @param client Database client * @param query Document query (supports path string, id number, OptimisticDocument, Route, etc.) * @param uploadsPath Path to the uploads directory * @param input Either a File object from FormData or {data: Buffer, filename: string} * @returns The Upload object with additional filePath property * @throws Error if document doesn't exist or if there's a constraint violation */ export declare const addUpload: DbOperation<[DocumentQuery, string, UploadInput], Upload & { filePath: string; }>; export {}; //# sourceMappingURL=addUpload.d.ts.map