import { EditorState, NodeTree, useEditorReturnType } from '@craftjs/core'; import { Step } from '../../../ai'; export type EditorQuery = useEditorReturnType['query']; /** The internal actions CraftJS hands to `actions.setState`, bound to the draft. */ export type SetStateActions = Parameters[0]>[1]; /** * Builds a CraftJS `NodeTree` for every `add` step, keyed by its `rootId`. Each node keeps its planned id and * parent. Call it outside `actions.setState`: `query` must read the page as it is before the batch. The trees * are single-use: executing them hands their nodes to the store. */ export declare function buildTrees(query: EditorQuery, steps: Step[]): Map; /** * Runs planned steps on the CraftJS draft; call it inside one `actions.setState` so Apply is one undo entry. * It throws on a step it cannot run, and CraftJS then drops every change of the batch. The resulting tree * matches `applySteps` from `/ai` on the same steps. */ export declare function executeSteps(state: EditorState, actions: SetStateActions, steps: Step[], trees: Map): void;