/**
 * Frontier — tracks the last-seen patch SHA per writer.
 *
 * A Frontier is the convergence boundary: it tells you which
 * patches from each writer have been incorporated into the
 * materialized state.
 *
 * @module domain/services/Frontier
 */
import type CodecPort from '../../ports/CodecPort.ts';
declare class Frontier {
    private readonly _entries;
    constructor(entries?: Iterable<[string, string]>);
    /** Updates the frontier with a new writer→patchSha mapping. */
    set(writerId: string, patchSha: string): void;
    /** Gets the last-seen patch SHA for a writer. */
    get(writerId: string): string | undefined;
    /** Whether the frontier contains an entry for this writer. */
    has(writerId: string): boolean;
    /** Number of writers in the frontier. */
    get size(): number;
    /** Sorted list of writer IDs. */
    writers(): string[];
    /** Iterate over [writerId, patchSha] entries. */
    entries(): IterableIterator<[string, string]>;
    /** Iterate over writer IDs. */
    keys(): IterableIterator<string>;
    /** Creates a shallow copy. */
    clone(): Frontier;
    /**
     * Deterministic fingerprint for snapshot isolation checks.
     * Two frontiers produce the same fingerprint iff they have
     * identical writer→SHA mappings.
     */
    fingerprint(): string;
    /**
     * Merges another frontier into this one.
     * Entries from `other` overwrite entries in `this`.
     * Returns a new Frontier (does not mutate).
     */
    merge(other: Frontier): Frontier;
    /**
     * Serializes to canonical CBOR bytes.
     * Keys are sorted for determinism.
     *
     * NOTE: CBOR encoding in domain code is a known boundary violation.
     * Kept here because frontier serialization is tightly coupled to
     * CheckpointService. Will move to adapter when CheckpointService
     * converts (Wave 4).
     */
    serialize(codec?: CodecPort): Uint8Array;
    /**
     * Deserializes from CBOR bytes.
     * Same boundary violation note as serialize().
     */
    static deserialize(buffer: Uint8Array, codec?: CodecPort): Frontier;
}
declare function createFrontier(): Map<string, string>;
declare function updateFrontier(frontier: Map<string, string>, writerId: string, patchSha: string): void;
declare function getFrontierEntry(frontier: Map<string, string>, writerId: string): string | undefined;
declare function getWriters(frontier: Map<string, string>): string[];
declare function serializeFrontier(frontier: Map<string, string>, opts?: {
    codec?: CodecPort;
}): Uint8Array;
declare function deserializeFrontier(buffer: Uint8Array, opts?: {
    codec?: CodecPort;
}): Map<string, string>;
declare function cloneFrontier(frontier: Map<string, string>): Map<string, string>;
declare function frontierFingerprint(frontier: Map<string, string>): string;
declare function mergeFrontiers(a: Map<string, string>, b: Map<string, string>): Map<string, string>;
export { Frontier, createFrontier, updateFrontier, getFrontierEntry, getWriters, serializeFrontier, deserializeFrontier, cloneFrontier, frontierFingerprint, mergeFrontiers, };
