import type { IReactionDisposer, IReactionOptions, IReactionPublic } from 'mobx';
import type { Component, ComponentInstance, Designer, LocateEvent, NodeInstance, Snippet } from '../designer';
import type { Node } from '../document';
import type { Project } from '../project';
import type { SimulatorRenderer } from './simulator-renderer';
import { Viewport } from './viewport';
export interface DropContainer {
    container: Node;
    instance: ComponentInstance;
}
export type DesignMode = 'design' | 'preview' | 'live';
export type Device = 'mobile' | 'iphone' | 'pc' | string;
export interface SimulatorProps {
    designMode?: DesignMode;
    device?: Device;
    deviceClassName?: string;
    requestHandlersMap?: any;
    [key: string]: any;
}
export interface DeviceStyleProps {
    canvas?: object;
    viewport?: object;
    content?: object;
}
export declare class Simulator {
    readonly emitter: import("..").EventBus;
    isSimulator: boolean;
    readonly project: Project;
    readonly designer: Designer;
    readonly viewport: Viewport;
    iframe?: HTMLElement;
    autoRender: boolean;
    get editor(): import("..").Editor;
    get device(): string;
    get requestHandlersMap(): any;
    get thisRequiredInJSE(): boolean;
    get enableStrictNotFoundMode(): any;
    get notFoundComponent(): any;
    get faultComponent(): any;
    get designMode(): DesignMode;
    get deviceStyle(): DeviceStyleProps | undefined;
    get componentsMap(): {
        [key: string]: any;
    };
    accessor _props: SimulatorProps;
    private accessor _contentWindow;
    get contentWindow(): Window | undefined;
    private accessor _contentDocument;
    get contentDocument(): Document | undefined;
    private accessor _components;
    /**
     * material to component map
     */
    get components(): Record<string, any>;
    private accessor instancesMap;
    private _sensorAvailable;
    get sensorAvailable(): boolean;
    private _renderer?;
    get renderer(): SimulatorRenderer | undefined;
    private sensing;
    get currentDocument(): import("..").Document | undefined;
    constructor(designer: Designer);
    setProps(props: SimulatorProps): void;
    set(key: string, value: any): void;
    get(key: string): any;
    connect(renderer: SimulatorRenderer, effect: (reaction: IReactionPublic) => void, options?: IReactionOptions<unknown, boolean>): IReactionDisposer;
    reaction(expression: (reaction: IReactionPublic) => unknown, effect: (value: unknown, prev: unknown, reaction: IReactionPublic) => void, opts?: IReactionOptions<unknown, boolean>): IReactionDisposer;
    autorun(effect: (reaction: IReactionPublic) => void, options?: IReactionOptions<unknown, boolean>): IReactionDisposer;
    purge(): void;
    /**
     * force to rerender the viewport
     */
    rerender(): void;
    mountContentFrame(iframe: HTMLIFrameElement | HTMLElement | null): void;
    getComponent(componentName: string): any;
    postEvent(eventName: string, ...data: any[]): void;
    linkSnippet(ref: HTMLElement, snippet: Snippet): () => void;
    setupEvents(): void;
    setupDragAndClick(): void;
    setupDetecting(): void;
    buildComponentMap(components: Record<string, Component>): void;
    addComponent(name: string, component: Component, override?: boolean): void;
    setInstance(docId: string, id: string, instances: ComponentInstance[] | null): void;
    getInstance(docId: string, id: string): any;
    getComponentInstances(node: Node, context?: NodeInstance<ComponentInstance, Node>): ComponentInstance | null;
    getClosestNodeInstance(from: ComponentInstance, specId?: string): NodeInstance<ComponentInstance> | null;
    computeRect(node: Node): DOMRect | null | undefined;
    computeComponentInstanceRect(instance: ComponentInstance, selector?: string): DOMRect | undefined;
    getNodeInstanceFromElement(target: Element | null): NodeInstance<ComponentInstance, Node> | null;
    /**
     * fix event's prop, canvasX、canvasY and target
     */
    fixEvent(e: LocateEvent): LocateEvent;
    /**
     * check the rect whether is in the viewport
     */
    isEnter(e: LocateEvent): boolean;
    deactiveSensor(): void;
    locate(e: LocateEvent): any;
    /**
     * find the suitable drop container
     */
    getDropContainer(e: LocateEvent): DropContainer | null;
    handleAccept({ container }: DropContainer, e: LocateEvent): boolean;
}
export declare const isSimulator: (obj: any) => obj is Simulator;
