/**
 * ReceiptBuilder — computes per-op outcome results used to populate
 * TickReceipts. Each method returns an `OpOutcomeResult` subclass
 * (OpApplied / OpSuperseded / OpRedundant).
 *
 * The reducer's `applyWithReceipt` path calls these before mutation.
 * The methods are pure — they read state but do not mutate it.
 *
 * The class exposes only static methods, so there is no instance state
 * or constructor-time freeze contract to satisfy here.
 *
 * @module domain/services/ReceiptBuilder
 */
import type ORSet from '../crdt/ORSet.ts';
import { type Dot } from '../crdt/Dot.ts';
import { type EventId } from '../utils/EventId.ts';
import type WarpState from './state/WarpState.ts';
import type OpOutcomeResult from '../types/ops/OpOutcomeResult.ts';
import OpApplied from '../types/ops/OpApplied.ts';
import OpRedundant from '../types/ops/OpRedundant.ts';
export default class ReceiptBuilder {
    /**
     * Valid receipt op types (the set accepted by TickReceipt). Exposed
     * so receipt construction can reject unrecognized op entries at the
     * reducer boundary instead of silently dropping them.
     */
    static readonly VALID_RECEIPT_OPS: ReadonlySet<string>;
    /**
     * NodeAdd receipt outcome. Redundant iff the exact (node, dot)
     * already exists in the ORSet entries (idempotent re-delivery).
     */
    static nodeAddOutcome(orset: ORSet, op: {
        readonly node: string;
        readonly dot: Dot;
    }): OpApplied | OpRedundant;
    /**
     * NodeRemove receipt outcome. Applied iff at least one observed dot
     * actually removes a live entry; otherwise redundant.
     */
    static nodeRemoveOutcome(orset: ORSet, op: {
        readonly node?: string;
        readonly observedDots: Iterable<string>;
    }): OpApplied | OpRedundant;
    /**
     * EdgeAdd receipt outcome. Redundant iff the exact (edgeKey, dot)
     * already exists.
     */
    static edgeAddOutcome(orset: ORSet, op: {
        readonly dot: Dot;
    }, edgeKey: string): OpApplied | OpRedundant;
    /**
     * EdgeRemove receipt outcome. Target is the encoded edge key when
     * (from, to, label) are all present, otherwise `'*'` for
     * wildcard/unresolved targets.
     */
    static edgeRemoveOutcome(orset: ORSet, op: {
        readonly from?: string;
        readonly to?: string;
        readonly label?: string;
        readonly observedDots: Iterable<string>;
    }): OpApplied | OpRedundant;
    /**
     * Computes the target key for an edge-remove outcome: the encoded edge
     * key when (from, to, label) are all present and non-empty, else `'*'`.
     */
    static _edgeRemoveTargetKey(op: {
        readonly from?: string;
        readonly to?: string;
        readonly label?: string;
    }): string;
    /**
     * Generic property outcome given a pre-encoded key. Uses LWW
     * semantics: applied if new, superseded if an older EventId loses,
     * redundant on exact EventId match.
     */
    static propOutcomeForKey(state: WarpState, key: string, eventId: EventId): OpOutcomeResult;
    /** NodePropSet / legacy PropSet receipt outcome. */
    static propSetOutcome(state: WarpState, op: {
        readonly node: string;
        readonly key: string;
    }, eventId: EventId): OpOutcomeResult;
    /** EdgePropSet receipt outcome. */
    static edgePropSetOutcome(state: WarpState, op: {
        readonly from: string;
        readonly to: string;
        readonly label: string;
        readonly key: string;
    }, eventId: EventId): OpOutcomeResult;
}
