import type { Designer } from '../designer';
import type { Simulator } from '../simulator';
import type { ProjectSchema, RootSchema } from '../types';
import { Document } from '../document';
import { TRANSFORM_STAGE } from '../types';
export declare enum PROJECT_EVENT {
    RENDERER_READY = "renderer:ready",
    SIMULATOR_READY = "simulator:ready"
}
export declare class Project {
    readonly designer: Designer;
    private emitter;
    private data;
    accessor documents: Document[];
    private documentsMap;
    get currentDocument(): Document | undefined;
    private accessor _config;
    get config(): Record<string, any> | undefined;
    set config(value: Record<string, any>);
    private _simulator?;
    get simulator(): Simulator | null;
    constructor(designer: Designer, schema?: ProjectSchema);
    import(schema: ProjectSchema): void;
    export(stage?: TRANSFORM_STAGE): ProjectSchema;
    private getComponentsMap;
    /**
     * load project schema
     * @param schema project schema
     * @param autoOpen auto open document, if type is string, will open document by id, if type is boolean, will open first document
     */
    load(schema?: ProjectSchema, autoOpen?: boolean | string): void;
    unload(): void;
    createDocument(schema?: RootSchema): Document;
    removeDocument(idOrDoc: string | Document): void;
    getDocument(id: string): Document | undefined;
    /**
     * open or create a document
     */
    open(idOrDoc?: string | Document | RootSchema): Document | null;
    /**
     * suspense other documents
     * @param curDoc current active document
     */
    checkExclusive(curDoc: Document): void;
    closeOthers(opened: Document): void;
    /**
     * set extra data, available for plugins
     */
    set<T extends keyof ProjectSchema>(key: T, value: ProjectSchema[T]): void;
    set(key: string, value: unknown): void;
    /**
     * get extra data, available for plugins
     */
    get<T extends keyof ProjectSchema>(key: T): ProjectSchema[T];
    get<T>(key: string): T;
    get(key: string): unknown;
    private isRendererReady;
    setRendererReady(renderer: any): void;
    mountSimulator(simulator: Simulator): void;
    onSimulatorReady(listener: (simulator: Simulator) => void): () => void;
    /**
     * use to wait for renderer ready and then do initial work
     */
    onRendererReady(listener: () => void): () => void;
    onDocumentAdd(listener: (document: Document) => void): () => void;
    onDocumentRemove(listener: (id: string) => void): () => void;
    onCurrentDocumentChange(listener: (document: Document) => void): () => void;
}
