import { Group } from "spritejs";
import { IBatchMainMessage, ICameraOpt, ILayerOptionType, IMainMessage, IOffscreenCanvasOptionType, IWorkerMessage } from "../types";
import { VNodeManager } from "../vNodeManager";
import type { MasterControlForWorker } from '../mainEngine';
import type { AppViewDisplayerManager, MainViewDisplayerManager } from "../../plugin/baseViewContainerManager";
import { EDataType } from "../enum";
import { SubTopThread } from "./subTopThread";
import { SubLocalThread } from "./subLocalThread";
import { SubServiceThread } from "./subServiceThread";
export type ICanvasOptionType = IOffscreenCanvasOptionType;
export interface IMainThreadInitOption {
    container: HTMLDivElement;
    canvasOpt: ICanvasOptionType;
    layerOpt: ILayerOptionType;
    master: MasterControlForWorker;
    displayer: MainViewDisplayerManager | AppViewDisplayerManager;
    post(sp: Omit<IBatchMainMessage, 'render'>): void;
}
export interface ISubThreadInitOption {
    thread: MainThreadEngineImpl;
    vNodes: VNodeManager;
}
export interface ISubWorkerInitOption {
    thread: MainThreadEngine;
    viewId: string;
    vNodes: VNodeManager;
    topLayer: Group;
    localLayer: Group;
    serviceLayer: Group;
    fullLayer: Group;
}
export interface MainThreadEngine {
    readonly viewId: string;
    readonly fullLayer: Group;
    readonly topLayer: Group;
    readonly localLayer: Group;
    readonly serviceLayer: Group;
    readonly vNodes: VNodeManager;
    readonly master: MasterControlForWorker;
    setCameraOpt(cameraOpt: ICameraOpt): void;
    on(msg: IWorkerMessage): Promise<void>;
    post(sp: IMainMessage): void;
    destroy(): void;
}
export declare class MainThreadEngineImpl implements MainThreadEngine {
    viewId: string;
    fullLayer: Group;
    topLayer: Group;
    localLayer: Group;
    serviceLayer: Group;
    snapshotFullLayer?: Group;
    vNodes: VNodeManager;
    master: MasterControlForWorker;
    opt: IMainThreadInitOption;
    private cameraOpt?;
    private scene;
    localWork: SubLocalThread;
    serviceWork: SubServiceThread;
    topWork: SubTopThread;
    private taskUpdateCameraId?;
    private debounceUpdateCameraId?;
    private debounceUpdateCache;
    private mainThreadPostId?;
    private combinePostMsg;
    private methodBuilder;
    private cacheImages;
    private imageResolveMap;
    constructor(viewId: string, opt: IMainThreadInitOption);
    getCachedImages(imageSrc: string): ImageBitmap | undefined;
    getCachedImagesByWorkId(workId: string): ImageBitmap | undefined;
    deleteCachedImagesByWorkId(workId: string): void;
    clearCacheImages(): void;
    clearImageResolveMap(): void;
    post(msg: Omit<IBatchMainMessage, 'render'>): void;
    updateDpr(dpr: number): void;
    on(msg: IWorkerMessage): Promise<void>;
    private getIconSize;
    loadImageBitMap(msg: Pick<IWorkerMessage, 'toolsType' | 'opt' | 'workId'>): Promise<ImageBitmap | undefined>;
    private removeNode;
    consumeFull(type: EDataType, data: IWorkerMessage): Promise<void>;
    setCameraOpt(cameraOpt: ICameraOpt): void;
    private runBatchPostData;
    private combinePostData;
    combinePost(): void;
    clearAll(): void;
    private consumeDrawAll;
    private consumeDraw;
    private updateCamera;
    private getSceneRect;
    private createScene;
    private createLayer;
    private updateScene;
    private updateLayer;
    destroy(): void;
}
