import { type Operation } from 'ot-json0';
import { type Element } from '@makeswift/controls';
import { type Action, type UnknownAction } from '../actions';
import { type Document } from './read-only-documents';
import { type DescriptorsByComponentType } from './prop-controllers';
export type ElementTree = {
    elements: Map<string, Element>;
    elementIds: Map<string, string>;
};
export type State = Map<string, ElementTree>;
export declare function getInitialState(documents?: Map<string, Document>, descriptors?: DescriptorsByComponentType): State;
export declare function getElements(state: State, documentKey: string): Map<string, Element>;
export declare function getElementIds(state: State, documentKey: string): Map<string, string>;
export declare function getElement(state: State, documentKey: string, elementKey: string): Element | null;
export declare function getElementId(state: State, documentKey: string, elementKey: string): string | null;
export declare function reducer(state: State | undefined, action: Action | UnknownAction): State;
export declare function traverseElementTree(element: Element, descriptors: DescriptorsByComponentType): Generator<Element>;
export declare function buildElementTree(rootElement: Element, descriptors: DescriptorsByComponentType): ElementTree;
type OperationPath = Operation[number]['p'];
type ElementOperationPath = {
    elementPath: OperationPath;
    propName: string | null;
};
export declare function getChangedElementsPaths(path: OperationPath): [ElementOperationPath, ...ElementOperationPath[]];
export {};
//# sourceMappingURL=element-trees.d.ts.map