import { type MutationReceipt, type MutationsApi } from './mutations';
import type { SyncularSqlClient, SyncularTableConfigMap, SyncularUnsafeSqlClient } from './types';
type MutationScope = 'mutations' | 'leasedMutations';
export type SyncularCommandHistoryErrorCode = 'sync.command_history_empty' | 'sync.command_history_conflict' | 'sync.command_history_storage_unavailable' | 'sync.command_history_table_unsupported' | 'sync.command_history_unsafe_field';
export declare class SyncularCommandHistoryError extends Error {
    readonly code: SyncularCommandHistoryErrorCode;
    readonly commandId?: string;
    constructor(code: SyncularCommandHistoryErrorCode, message: string, options?: {
        commandId?: string;
    });
}
export interface SyncularCommandHistoryReceipt extends MutationReceipt {
    commandId: string;
}
export interface SyncularCommandHistory {
    canUndo(): Promise<boolean>;
    canRedo(): Promise<boolean>;
    undoLast(): Promise<SyncularCommandHistoryReceipt>;
    redoLast(): Promise<SyncularCommandHistoryReceipt>;
}
export interface SyncularCommandHistoryController<DB> {
    history: SyncularCommandHistory;
    wrapMutations(mutations: MutationsApi<DB, undefined>, scope: MutationScope): MutationsApi<DB, undefined>;
}
export interface CreateSyncularCommandHistoryOptions<DB> {
    client: SyncularSqlClient & Partial<SyncularUnsafeSqlClient>;
    tableConfig: SyncularTableConfigMap;
    mutations: MutationsApi<DB, undefined>;
    leasedMutations: MutationsApi<DB, undefined>;
    nowMs?: () => number;
    idFactory?: () => string;
}
export declare function createSyncularCommandHistory<DB>(options: CreateSyncularCommandHistoryOptions<DB>): SyncularCommandHistoryController<DB>;
export {};
//# sourceMappingURL=command-history.d.ts.map