import type { ComponentsMap, Designer, DropLocation } from '../designer';
import type { Project } from '../project';
import type { Simulator } from '../simulator';
import type { NodeSchema, RootSchema } from '../types';
import { TRANSFORM_STAGE } from '../types';
import { History } from './history';
import { Node } from './node/node';
export declare enum DOCUMENT_EVENT {
    ADD = "document:add",
    REMOVE = "document:remove",
    OPEN_CHANGE = "document:open.change",
    OPEN = "document:open"
}
export declare class Document {
    readonly isDocument = true;
    private emitter;
    id: string;
    /** document is open or not */
    accessor _opened: boolean;
    /** document is blank or not */
    private _blank;
    /** document root node */
    rootNode: Node | null;
    get root(): Node<NodeSchema> | null;
    getRoot(): Node<NodeSchema> | null;
    private _nodesMap;
    get nodesMap(): Map<string, Node<NodeSchema>>;
    get simulator(): Simulator | null;
    /** 对应 document 的 path */
    get fileName(): string;
    set fileName(fileName: string);
    private accessor nodes;
    get opened(): boolean;
    isBlank(): boolean;
    readonly history: History;
    getHistory(): History<RootSchema>;
    readonly project: Project;
    readonly designer: Designer;
    private accessor _dropLocation;
    set dropLocation(loc: DropLocation | null);
    get dropLocation(): DropLocation | null;
    get schema(): RootSchema;
    constructor(project: Project, schema?: RootSchema);
    import(schema?: RootSchema, checkId?: boolean): void;
    export(stage?: TRANSFORM_STAGE): RootSchema;
    remove(): void;
    purge(): void;
    createNode(schema: NodeSchema, checkId?: boolean): Node<NodeSchema>;
    getNode(id: string): Node<NodeSchema> | null;
    getNodeCount(): number;
    hasNode(id: string): boolean;
    removeNode(idOrNode: string | Node): void;
    private internalRemoveNode;
    unlinkNode(node: Node): void;
    migrateNode(node: Node, newParent: Node): void;
    batchRemoveNode(idOrNodeList: (string | Node)[]): void;
    insertNode(parent: Node, thing: Node | NodeSchema, at?: number, copy?: boolean): Node<NodeSchema> | null;
    /**
     * insert multiple nodes
     */
    insertNodes(parent: Node, nodes: Node[] | NodeSchema[], at?: number, copy?: boolean): Node<NodeSchema>[];
    open(): this;
    close(): void;
    /**
     * use open a document and suspense other documents
     */
    private setOpened;
    suspense(): void;
    activate(): void;
    /**
     * check if there is unsaved change for document
     */
    isModified(): boolean;
    /**
     * get components map of all the nodes in this document
     * @param extraComps - extra components that will be added to the components map, use for custom components
     */
    getComponentsMap(extraComps?: string[]): ComponentsMap;
    getComponent(componentName: string): any;
    getComponentMeta(componentName: string): import("..").ComponentMeta;
    toData(extraComps?: string[]): {
        componentsMap: ComponentsMap;
        componentsTree: RootSchema[];
    };
    onReady(listener: () => void): () => void;
    onNodeAdd(listener: (node: Node) => void): () => void;
    onNodeRemove(listener: (id: string) => void): () => void;
}
export declare function isDocument(obj: any): obj is Document;
