declare module '@rikishi/watermelondb/adapters/type' { import { AppSchema, Model, Query, RawRecord, RecordId, TableName } from '@rikishi/watermelondb' export type CachedFindResult = RecordId | (RawRecord | void) export type CachedQueryResult = Array export type BatchOperation = | ['create', Model] | ['update', Model] | ['markAsDeleted', Model] | ['destroyPermanently', Model] export interface DatabaseAdapter { schema: AppSchema // Fetches given (one) record or null. Should not send raw object if already cached in JS find(table: TableName, id: RecordId): Promise // Fetches matching records. Should not send raw object if already cached in JS query(query: Query): Promise // Counts matching records count(query: Query): Promise // Executes multiple prepared operations batch(operations: BatchOperation[]): Promise // Return marked as deleted records getDeletedRecords(tableName: TableName): Promise // Destroy deleted records from sync destroyDeletedRecords(tableName: TableName, recordIds: RecordId[]): Promise // Destroys the whole database, its schema, indexes, everything. unsafeResetDatabase(): Promise // Fetches string value from local storage getLocal(key: string): Promise // Sets string value to a local storage key setLocal(key: string, value: string): Promise // Removes key from local storage removeLocal(key: string): Promise // Do not use — only for testing purposes unsafeClearCachedRecords(): Promise } }