import type { JsonStepsEnvelope } from '../validator/schemas/json-steps';
export type JsonStepNode = JsonStepsEnvelope['steps'][number];
export type EditOp = {
    op: 'replace';
    step_id?: string;
    index?: number;
    step: JsonStepNode;
} | {
    op: 'insert_after';
    step_id?: string;
    index?: number;
    step: JsonStepNode;
} | {
    op: 'insert_before';
    step_id?: string;
    index?: number;
    step: JsonStepNode;
} | {
    op: 'delete';
    step_id?: string;
    index?: number;
} | {
    op: 'move';
    from_step_id?: string;
    from?: number;
    to_step_id?: string;
    to?: number;
};
export interface EditError {
    op_index: number;
    op: string;
    reason: 'step_id_not_found' | 'index_out_of_range' | 'missing_anchor' | 'ambiguous_anchor' | 'invalid_step' | 'conflicting_target' | 'unknown_op' | 'find_unknown_capture';
    detail: string;
}
export interface ApplyEditsResult {
    steps: JsonStepNode[];
    errors: EditError[];
}
export declare function getJsonStepId(step: JsonStepNode): string | undefined;
export declare function getJsonStepGroupChildren(step: JsonStepNode): JsonStepNode[] | undefined;
export declare function applyEdits(currentSteps: readonly JsonStepNode[], ops: readonly EditOp[]): ApplyEditsResult;
export interface FindEditPolicyResult {
    ops: EditOp[];
    errors: EditError[];
}
export interface FindEditPolicyOptions {
    knownFindUuids?: ReadonlySet<string>;
    resolveSelector?: (uuid: string) => Record<string, unknown> | undefined;
}
export declare function enforceFindEditPolicy(currentSteps: readonly JsonStepNode[], ops: readonly EditOp[], options?: FindEditPolicyOptions): FindEditPolicyResult;
//# sourceMappingURL=applyEdits.d.ts.map