import { MutationStep, AssertStep, TextAddress } from '@superdoc/document-api'; import { Editor } from '../../core/Editor.js'; import { CompiledTarget } from './executor-registry.types.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; } /** * 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; /** Operations exempt from matrix lookup (non-mutating). */ export declare const MATRIX_EXEMPT_OPS: Set; export declare function compilePlan(editor: Editor, steps: MutationStep[]): CompiledPlan; export {}; //# sourceMappingURL=compiler.d.ts.map