import { FileData } from '@verdant-web/common'; import { Context } from '../../../internal.js'; import { AbstractTransaction, PersistedFileData, PersistenceFileDb } from '../../interfaces.js'; import { IdbService } from '../IdbService.js'; /** * When stored in IDB, replace the file blob with an array buffer * since it's more compatible, and replace remote boolean with * a string since IDB doesn't support boolean indexes. */ export interface StoredFileData extends Omit { remote: 'true' | 'false'; buffer?: ArrayBuffer; deletedAt: number | null; timestamp?: string; } export declare class IdbPersistenceFileDb extends IdbService implements PersistenceFileDb { add: (file: FileData) => Promise; markUploaded: (id: string) => Promise; get: (fileId: string) => Promise; delete: (fileId: string) => Promise; markPendingDelete: (fileId: string) => Promise; listUnsynced: () => Promise; resetSyncedStatusSince: (since: string | null) => Promise; iterateOverPendingDelete: (iterator: (file: PersistedFileData, store: IDBObjectStore) => void) => Promise; getAll: (options?: { transaction?: AbstractTransaction; }) => Promise; stats: () => Promise<{ size: { count: number; size: number; }; }>; loadFileContents: (file: FileData, ctx: Context) => Promise; private hydrateFileData; private getFileRaw; } export declare function arrayBufferToBlob(buffer: ArrayBuffer, type: string, name?: string): File;