/* auto-generated by NAPI-RS */ /* eslint-disable */ export declare class DocStoragePool { constructor() /** Initialize the database and run migrations. */ connect(universalId: string, path: string): Promise disconnect(universalId: string): Promise setSpaceId(universalId: string, spaceId: string): Promise pushUpdate(universalId: string, docId: string, update: Uint8Array): Promise getDocSnapshot(universalId: string, docId: string): Promise setDocSnapshot(universalId: string, snapshot: DocRecord): Promise getDocUpdates(universalId: string, docId: string): Promise> markUpdatesMerged(universalId: string, docId: string, updates: Array): Promise deleteDoc(universalId: string, docId: string): Promise getDocClocks(universalId: string, after?: Date | undefined | null): Promise> getDocClock(universalId: string, docId: string): Promise getBlob(universalId: string, key: string): Promise setBlob(universalId: string, blob: SetBlob): Promise deleteBlob(universalId: string, key: string, permanently: boolean): Promise releaseBlobs(universalId: string): Promise listBlobs(universalId: string): Promise> getPeerRemoteClocks(universalId: string, peer: string): Promise> getPeerRemoteClock(universalId: string, peer: string, docId: string): Promise setPeerRemoteClock(universalId: string, peer: string, docId: string, clock: Date): Promise getPeerPulledRemoteClocks(universalId: string, peer: string): Promise> getPeerPulledRemoteClock(universalId: string, peer: string, docId: string): Promise setPeerPulledRemoteClock(universalId: string, peer: string, docId: string, clock: Date): Promise getPeerPushedClocks(universalId: string, peer: string): Promise> getPeerPushedClock(universalId: string, peer: string, docId: string): Promise setPeerPushedClock(universalId: string, peer: string, docId: string, clock: Date): Promise clearClocks(universalId: string): Promise } export declare class SqliteConnection { constructor(path: string) connect(): Promise addBlob(key: string, blob: Uint8Array): Promise getBlob(key: string): Promise deleteBlob(key: string): Promise getBlobKeys(): Promise> getUpdates(docId?: string | undefined | null): Promise> deleteUpdates(docId?: string | undefined | null): Promise getUpdatesCount(docId?: string | undefined | null): Promise getAllUpdates(): Promise> insertUpdates(updates: Array): Promise replaceUpdates(docId: string | undefined | null, updates: Array): Promise getServerClock(key: string): Promise setServerClock(key: string, data: Uint8Array): Promise getServerClockKeys(): Promise> clearServerClock(): Promise delServerClock(key: string): Promise getSyncMetadata(key: string): Promise setSyncMetadata(key: string, data: Uint8Array): Promise getSyncMetadataKeys(): Promise> clearSyncMetadata(): Promise delSyncMetadata(key: string): Promise initVersion(): Promise setVersion(version: number): Promise getMaxVersion(): Promise close(): Promise get isClose(): boolean static validate(path: string): Promise migrateAddDocId(): Promise /** * Flush the WAL file to the database file. * See https://www.sqlite.org/pragma.html#pragma_wal_checkpoint:~:text=PRAGMA%20schema.wal_checkpoint%3B */ checkpoint(): Promise } export interface Blob { key: string data: Uint8Array mime: string size: number createdAt: Date } export interface BlobRow { key: string data: Buffer timestamp: Date } export interface DocClock { docId: string timestamp: Date } export interface DocRecord { docId: string bin: Uint8Array timestamp: Date } export interface DocUpdate { docId: string timestamp: Date bin: Uint8Array } export interface InsertRow { docId?: string data: Uint8Array } export interface ListedBlob { key: string size: number mime: string createdAt: Date } export declare function mintChallengeResponse(resource: string, bits?: number | undefined | null): Promise export interface SetBlob { key: string data: Uint8Array mime: string } export interface UpdateRow { id: number timestamp: Date data: Buffer docId?: string } export declare enum ValidationResult { MissingTables = 0, MissingDocIdColumn = 1, MissingVersionColumn = 2, GeneralError = 3, Valid = 4 } export declare function verifyChallengeResponse(response: string, bits: number, resource: string): Promise