import { type WarpState } from '../JoinReducer.ts';
import type Patch from '../../types/Patch.ts';
import type { TickReceipt } from '../../types/TickReceipt.ts';
import type { StrandDescriptor } from './strandTypes.ts';
type ParentBasisMode = 'pinned' | 'live';
type WarpRuntime = {
    _loadPatchChainFromSha(sha: string): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    getFrontier?: () => Promise<Map<string, string>>;
};
export default class StrandMaterializer {
    private readonly _graph;
    /**
     * Create a materialization boundary over strand patch collection and replay.
     */
    constructor({ graph }: {
        graph: WarpRuntime;
    });
    /**
     * Collect all base-observation patches from the pinned frontier writers.
     */
    collectBasePatches(descriptor: StrandDescriptor): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    /**
     * Collect parent-basis patches from live truth when the caller opts in.
     */
    collectParentBasisPatches(descriptor: StrandDescriptor, options: {
        parentBasis: ParentBasisMode;
    }): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    private _collectParentBasisPatches;
    /**
     * Collect patches from the strand's own writable overlay chain.
     */
    collectOverlayPatches(descriptor: StrandDescriptor): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    /**
     * Collect patches from all braided read-only overlay chains.
     */
    collectBraidedOverlayPatches(descriptor: StrandDescriptor): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    /**
     * Merge base, braid, and overlay patches into a deduplicated list, optionally bounded by ceiling.
     */
    collectPatchEntries(descriptor: StrandDescriptor, { ceiling, parentBasis }: {
        ceiling: number | null;
        parentBasis?: ParentBasisMode;
    }): Promise<Array<{
        patch: Patch;
        sha: string;
    }>>;
    /**
     * Replay all strand patches through the CRDT reducer to produce materialized state.
     */
    materializeDescriptor(descriptor: StrandDescriptor, { collectReceipts, ceiling, parentBasis, }: {
        collectReceipts: boolean;
        ceiling: number | null;
        parentBasis?: ParentBasisMode;
    }): Promise<{
        state: WarpState;
        receipts: TickReceipt[];
        allPatches: Array<{
            patch: Patch;
            sha: string;
        }>;
    }>;
    private _parentBasisFrontier;
    private _sortedFrontierTipShas;
    private _pushVisibleBasePatches;
    private _braidedOverlayHeadShas;
    private _reduceCollectedPatches;
}
export {};
