import { type EventId } from '../../utils/EventId.ts';
import type { CheckpointBasisFact } from './CheckpointBasisFact.ts';
export type FactWithEvent = {
    readonly fact: CheckpointBasisFact;
    readonly eventId: EventId;
};
export type FactStreamCursor = {
    readonly writerId: string;
    readonly iterator: AsyncIterator<FactWithEvent>;
    readonly current: FactWithEvent;
};
export declare function compareFactEvents(left: FactWithEvent, right: FactWithEvent): number;
export declare function sortedOperationFacts(facts: readonly FactWithEvent[]): readonly FactWithEvent[];
export declare function readNextFactCursor(writerId: string, iterator: AsyncIterator<FactWithEvent>): Promise<FactStreamCursor | null>;
export declare function closeFactCursors(cursors: readonly FactStreamCursor[]): Promise<void>;
export declare function selectFactCursorIndex(cursors: readonly FactStreamCursor[]): number;
