import { MutationStep, AssertStep, TextAddress } from '../../../../../../document-api/src/index.js';
import { Editor } from '../../core/Editor.js';
import { CompiledTarget } from './executor-registry.types.js';
import { TextOffsetModel } from '../helpers/text-offset-resolver.js';
export interface CompiledStep {
    step: MutationStep;
    targets: CompiledTarget[];
}
export interface CompiledPlan {
    mutationSteps: CompiledStep[];
    assertSteps: AssertStep[];
    /** Document revision captured at compile start — used by executor to detect drift. */
    compiledRevision: string;
}
export interface CompilePlanOptions {
    /**
     * Text model used only for `where.by = "select"` text selectors.
     *
     * Public discovery refs and explicit SelectionTargets stay visible-offset
     * based. Tracked authoring selectors can opt into raw/review text so they
     * can address unresolved deletion text without changing public read APIs.
     */
    selectTextModel?: TextOffsetModel;
}
/**
 * Coalesces text ranges from a single logical match into one contiguous range.
 * All ranges must belong to the same block.
 */
export declare function normalizeMatchRanges(stepId: string, ranges: TextAddress[]): {
    blockId: string;
    from: number;
    to: number;
};
type SingleBlockSpan = {
    kind: 'single-block';
    blockId: string;
    from: number;
    to: number;
};
type CrossBlockSpan = {
    kind: 'cross-block';
    segments: Array<{
        blockId: string;
        from: number;
        to: number;
    }>;
};
type NormalizedSpan = SingleBlockSpan | CrossBlockSpan;
/**
 * Normalizes an array of text ranges from a single logical match into either
 * a contiguous single-block range or ordered cross-block segments.
 *
 * Validation rules:
 * - Per-range bounds must be valid (non-negative, start <= end).
 * - Within each block, ranges must be contiguous (no gaps).
 */
export declare function normalizeMatchSpan(stepId: string, ranges: TextAddress[]): NormalizedSpan;
type InteractionVerdict = 'allow' | 'reject';
/**
 * Canonical step interaction matrix. This is the single source of truth for
 * overlap verdicts when two steps target non-disjoint ranges.
 *
 * Key format: `${opA}::${opB}::${overlapClass}`
 * - Order is significant: (A, B) means A appears before B in plan order.
 * - Unlisted pairs are rejected by default (allowlist model).
 */
export declare const STEP_INTERACTION_MATRIX: ReadonlyMap<string, InteractionVerdict>;
/** Operations exempt from matrix lookup (non-mutating). */
export declare const MATRIX_EXEMPT_OPS: Set<string>;
export declare function compilePlan(editor: Editor, steps: MutationStep[], options?: CompilePlanOptions): CompiledPlan;
export {};
//# sourceMappingURL=compiler.d.ts.map