import type * as Arr from "../../Array.ts"; import * as Order from "../../Order.ts"; import type { Entry } from "../EventJournal.ts"; /** Orders entry ids by their raw UUID bytes. */ export declare const entryIdOrder: Order.Order>; /** * Records that `entry` was written by a compactor for `source`, as its * `index`th output for that source. Untagged entries are their own anchor. */ export declare const setAnchor: (entry: Entry, source: Entry, index: number) => void; /** * Pairs a batch of incoming entries with the stored entries that conflict with * them: same event and primary key, and an id strictly greater than the * incoming entry's anchor. * * The batch is sorted by anchor id, then by write order, so it is applied in * the same order on every replica and a compaction output takes its source's * place and precedence. Add the stored entries that may conflict, then call * `toBatch` to sort and filter them. */ export declare class ConflictIndex { /** The incoming entries in anchor order. */ readonly batch: ReadonlyArray; /** The anchor of the first incoming entry. Only stored entries with a greater id can conflict. */ readonly oldest: Entry; /** Creation time of `oldest`, for coarse filters. */ readonly oldestMillis: number; private readonly stored; constructor(batch: Arr.NonEmptyReadonlyArray); get events(): Array; /** The `(event, primaryKey)` groups in the batch. */ groups(): Iterable; add(entry: Entry): void; toBatch(): Array<{ readonly entry: Entry; readonly conflicts: ReadonlyArray; }>; } /** An event and primary key in the batch, with the stored entries added for it. */ export interface ConflictGroup { readonly event: string; readonly primaryKey: string; /** The lowest anchor among the group's incoming entries. Only stored entries with a greater id can conflict. */ readonly oldest: Entry; readonly entries: Array; } //# sourceMappingURL=conflicts.d.ts.map