import { IterableEventQueue } from './IterableEventQueue.ts';
import type { Id } from './ResourceInterface.ts';
/**
 * This module/function is responsible for the main work of tracking subscriptions and listening for new transactions
 * that have occurred on any thread, and then reading through the transaction log to notify listeners. This is
 * responsible for cleanup of subscriptions as well.
 * @param table
 * @param key
 * @param listener
 * @param startTime
 * @param options
 */
export declare function addSubscription(table: any, key: any, listener?: (key: any) => any, startTime?: number, options?: any): Subscription;
/**
 * This is the class that is returned from subscribe calls and provide the interface to set a callback, end the
 * subscription and get the initial state.
 */
declare class Subscription extends IterableEventQueue {
    listener: (recordId: Id, auditEntry: any, localTime: number, beginTxn: boolean) => void;
    subscriptions: [];
    startTime?: number;
    includeDescendants?: boolean;
    supportsTransactions?: boolean;
    onlyChildren?: boolean;
    constructor(listener: any);
    end(): void;
    toJSON(): {
        name: string;
    };
}
/**
 * Interface with database to listen for commits and traverse the audit log only on the same thread.
 * @param primaryStore
 * @param auditStore
 */
export declare function listenToCommits(primaryStore: any, auditStore: any): void;
export declare function whenNextTransaction(auditStore: any): any;
export {};
