import { WriteQueue } from './write-queue';
import { CRDT } from './crdt';
import type { DocUpdate, ClockHead, Doc } from './types';
export declare function database(name: string): Database;
export declare class Database {
    static databases: Map<string, Database>;
    name: string;
    config: object;
    _listeners: Set<ListenerFn>;
    _crdt: CRDT;
    _writeQueue: WriteQueue;
    constructor(name: string, config?: {
        blocks: null;
    });
    get(id: string): Promise<Doc>;
    put(doc: Doc): Promise<DbResponse>;
    del(id: string): Promise<DbResponse>;
    changes(since: ClockHead): Promise<ChangesResponse>;
    subscribe(listener: ListenerFn): () => void;
    _notify(updates: DocUpdate[]): Promise<void>;
}
type ChangesResponse = {
    clock: ClockHead;
    rows: {
        key: string;
        value: Doc;
    }[];
};
type DbResponse = {
    id: string;
    clock: ClockHead;
};
type ListenerFn = (docs: Doc[]) => Promise<void> | void;
export {};
