import { Database, Table } from './database'; import { Record } from './record'; import { Connection } from './engine'; import { Document } from './types'; export declare enum FlushMethod { INSERT = 0, UPDATE = 1, DELETE = 2 } export declare class FlushState { method: FlushMethod; dirty: Set; deleted: boolean; merged: Record | null; selected?: boolean; clone(): FlushState; json(): { method: string; dirty: string[]; deleted: boolean; merged: string | null; selected: boolean | undefined; }; } export declare function flushRecord(connection: Connection, record: Record): Promise; export declare function flushDatabaseB(connection: Connection, db: Database, allowPartial: boolean): Promise; export interface FlushOptions { afterBegin?: (c: Connection) => Promise; beforeCommit?: (c: Connection) => Promise; replaceRecordsIn?: string[]; allowPartial?: boolean; } export declare function flushDatabase(connection: Connection, db: Database, options?: FlushOptions): Promise; export declare function dumpDirtyRecords(db: Database, all?: boolean): void; /** * Inserts a list of records sharing the same set of dirty fields */ export declare function _insertRecords(connection: Connection, table: Table, names: string[], records: Record[]): Promise; export declare function replaceRecord(connection: Connection, table: Table, doc: Document): Promise;