import type EventEmitter2 from "eventemitter2";
import { BaseCollectorReducerAction, DiffOneData } from "../collector";
import { BaseApplianceManager } from "../plugin/baseApplianceManager";
import { BaseNodeMapItem, IActiveToolsDataType, IActiveWorkDataType, ICameraOpt, IMainMessage, IRectType, IUpdateNodeOpt, IWorkerMessage, IqueryTask, IworkId, ViewWorkerOptions } from "./types";
import { BaseSubWorkModuleProps } from "../plugin/types";
import type { ISVGMarkmapInformation, ISVGUrlInformation, IconifyInformation, ImageInformation, MarkmapId, _SetTrue } from "../plugin/types";
import { MethodBuilderMain } from "./msgEvent";
import { EventWorkState } from "./enum";
import { BaseShapeOptions } from "./tools";
import { AppViewDisplayerManager, MainViewDisplayerManager } from "../plugin/baseViewContainerManager";
export declare abstract class MasterController {
    /** 异步同步时间间隔 */
    abstract readonly maxLastSyncTime: number;
    /** 合并绘制时间间隔 */
    abstract readonly combineUnitTime: number;
    /** 最大合并橡皮擦处理时间 */
    abstract readonly maxCombineEraserTime: number;
    /** 平滑同步 */
    abstract readonly smoothSync: boolean;
    /** 插件管理器 */
    abstract readonly control: BaseApplianceManager;
    abstract readonly internalMsgEmitter: EventEmitter2;
    abstract readonly publicMsgEmitter: EventEmitter2;
    /** worker线程管理器 */
    /** 本地原始点数据批任务数据池 */
    protected abstract localPointsBatchData: Map<IworkId, {
        state: EventWorkState;
        points: number[];
        rawPoints: number[];
        isFullWork: boolean;
        viewId: string;
    }>;
    /** 事件任务处理批量池 */
    abstract taskBatchData: Set<IWorkerMessage>;
    /** 主线程和工作线程通信机 */
    protected abstract fullWorker: Worker;
    /** 子线程和工作线程通信机 */
    protected abstract subWorker?: Worker;
    /** 当前选中的工具配置数据 */
    abstract currentToolsData?: IActiveToolsDataType;
    /** 当前工作任务数据 */
    protected abstract currentLocalWorkData: IActiveWorkDataType;
    get now(): number;
    get newWorkId(): string;
    /** 设置当前选中的工具配置数据 */
    setCurrentToolsData(currentToolsData: IActiveToolsDataType): void;
    getCurrentToolsData(): IActiveToolsDataType | undefined;
    /** 设置当前绘制任务数据 */
    protected setCurrentLocalWorkData(currentLocalWorkData: IActiveWorkDataType): void;
    /** 获取当前激活的工作任务id */
    protected getWorkId(): IworkId | undefined;
    /** 获取当前work的工作状态 */
    get workState(): EventWorkState;
    /** 用于接收服务端同步的数据 */
    abstract onServiceDerive(key: string, data: DiffOneData<BaseCollectorReducerAction | undefined>): void;
    /** 消费批处理池数据 */
    abstract consume(): void;
    /** 运行异步动画逻辑 */
    abstract runAnimation(): void;
    /** 禁止写入 */
    abstract unWritable(): void;
    /** 可以使用 */
    abstract abled(): void;
    /** 当前状态是否可以写入 */
    abstract isAbled(): boolean;
    /** 销毁 */
    abstract destroy(): void;
    /** 服务端拉取数据初始化 */
    abstract pullServiceData(viewId: string, scenePath: string, options: {
        isAsync?: boolean;
        useAnimation?: boolean;
    }): void;
    /** 主线程和工作线程通信,推送 */
    abstract post(msg: Set<IWorkerMessage>): void;
    /** 主线程和工作线程通信,接收 */
    abstract on(): void;
    /** 更新已有node配置 */
    abstract updateNode(workId: IworkId, updateNodeOpt: IUpdateNodeOpt, viewId: string, scenePath: string): void;
    /** 清空指定的view场景路径下的所有数据 */
    abstract clearViewScenePath(viewId: string, justLocal?: boolean, isFiter?: boolean): Promise<void>;
    /** 更新指定view场景路径下的相机参数 */
    abstract updateCamera(viewId: string, cameraOpt: ICameraOpt): void;
    /**  创建一个新的viewWorker */
    abstract createViewWorker(viewId: string, options: ViewWorkerOptions, displayer: MainViewDisplayerManager | AppViewDisplayerManager): void;
    /** 本地发送cursor事件 */
    abstract sendCursorEvent(point: [number | undefined, number | undefined], viewId: string): void;
    /** 获取某个场景路径下的包围盒 */
    abstract getBoundingRect(scenePath: string): Promise<IRectType> | undefined;
    abstract getSnapshot(scenePath: string, width?: number, height?: number, camera?: Pick<ICameraOpt, "centerX" | "centerY" | "scale">): Promise<Array<ImageBitmap | HTMLImageElement | null>> | undefined;
    /** 根据查询条件查询事件任务处理批量池中任务 */
    abstract queryTaskBatchData(query: IqueryTask): IWorkerMessage[];
    abstract insertImage(viewId: string, imageInfo: ImageInformation): void;
    abstract insertIconify(viewId: string, iconifyInfo: IconifyInformation & {
        strokeColor?: string;
    }): void;
    abstract lockImage(viewId: string, uuid: string, locked: boolean): void;
    abstract completeImageUpload(viewId: string, uuid: string, src: string): void;
    abstract getImagesInformation(scenePath: string): ImageInformation[];
    /** 移除正在绘制的流程 */
    abstract removeDrawingWork(viewId: string): void;
    /** 修正绘制异常任务 */
    abstract checkDrawingWork(viewId: string): void;
}
export declare class MasterControlForWorker extends MasterController {
    /** 异步同步时间间隔 */
    readonly maxLastSyncTime: number;
    /** 合并绘制时间间隔 */
    readonly combineUnitTime: number;
    /** 最大合并橡皮擦处理时间 */
    readonly maxCombineEraserTime: number;
    /** 平滑同步 */
    readonly smoothSync: boolean;
    isActive: boolean;
    currentToolsData?: IActiveToolsDataType;
    protected currentLocalWorkData: IActiveWorkDataType;
    control: BaseApplianceManager;
    internalMsgEmitter: EventEmitter2;
    publicMsgEmitter: EventEmitter2;
    taskBatchData: Set<IWorkerMessage>;
    protected fullWorker: Worker;
    protected subWorker?: Worker;
    private fullWorkerUrl;
    private subWorkerUrl;
    methodBuilder?: MethodBuilderMain;
    private zIndexNodeMethod?;
    /** master\fullwoker\subworker 三者高频绘制时队列化参数 */
    private subWorkerDrawCount;
    private fullWorkerDrawCount;
    private maxDrawCount;
    private _consumeCount;
    private _postCount;
    private reRenders;
    private localWorkViewId?;
    protected localPointsBatchData: Map<IworkId, {
        state: EventWorkState;
        points: number[];
        rawPoints: number[];
        /** 完整的绘制 */
        isFullWork: boolean;
        viewId: string;
        opt?: BaseShapeOptions;
    }>;
    /** end */
    /** 是否任务队列化参数 */
    private tasksqueue;
    private useTasksqueue;
    private useTasksClockId?;
    private mainTasksqueueCount?;
    private workerTasksqueueCount?;
    /** end */
    private snapshotMap;
    private boundingRectMap;
    private clearAllResolveMap;
    private delayWorkStateToDoneResolve?;
    private animationId;
    private tmpImageConfigMap;
    private mainThread?;
    private backgroundThreadManager?;
    private willSelectorWorkId?;
    private isLockSentEventCursor;
    private getVNodeInfoResolveMap;
    private setFontFacesResolve;
    private isLocalWorkActive;
    /** IndexedDB工具类实例 */
    private readonly indexDBUtils;
    private markmapIdResolveMap;
    constructor(props: BaseSubWorkModuleProps);
    get isBezier(): boolean;
    get Logger(): import("..").Logger;
    destroy(): void;
    private get consumeCount();
    private set consumeCount(value);
    private get postCount();
    private set postCount(value);
    private get viewContainerManager();
    private get collector();
    private get isRunSubWork();
    private get isCanDrawWork();
    private get isUseZIndex();
    private get isCanRecordUndoRedo();
    private get isCanSentCursor();
    private get isPostCountType();
    private get isCanPostDraw();
    private get isCanStartEventConsum();
    init(): Promise<void>;
    private useBackgroundThread;
    private useMainThread;
    on(): Promise<void>;
    /**
     * 清理字体缓存数据库
     */
    clearFontCache(): Promise<boolean>;
    /**
     * 获取字体缓存状态
     */
    getFontCacheStatus(): Promise<{
        count: number;
        totalSize: number;
    }>;
    loadFontInMainThread(url: string): Promise<ArrayBuffer | undefined>;
    private validateFontData;
    clearReRenders(num?: number): void;
    get isBusy(): boolean;
    getLockSentEventCursor(): boolean;
    setLockSentEventCursor(bol: boolean): void;
    getTasksqueueState(): EventWorkState.Doing | EventWorkState.Done;
    setMaxDrawCount(num: number): void;
    getFullWorkDrawCount(): number;
    getMaxDrawCount(): number;
    setSubWorkerDrawCount(num: number): void;
    setConsumeCount(num: number): void;
    getConsumeCount(): number;
    setWorkerTasksqueueCount(num: number): void;
    collectorSyncData(sp: IMainMessage[]): void;
    foceUndoTickerEnd(id: number, viewId: string): void;
    private collectorAsyncData;
    private onLocalEventEnd;
    private onLocalEventDoing;
    private onLocalEventStart;
    private setLocalPointIsFullWork;
    private pushLocalPoint;
    private deleteLocalPoint;
    private getLocalPointInfo;
    getLocalPointsInfo(): Map<IworkId, {
        state: EventWorkState;
        points: number[];
        rawPoints: number[];
        /** 完整的绘制 */
        isFullWork: boolean;
        viewId: string;
        opt?: BaseShapeOptions;
    }>;
    private shouldUseAutoShape;
    private toAutoShapePoints;
    private logAutoShapeResult;
    private emitAutoShapeResult;
    private createAutoShapeTask;
    private mapAutoShapeFallback;
    private correctStorage;
    originalEventLintener(workState: EventWorkState, point: [number, number], viewId: string): Promise<void>;
    getLocalWorkViewId(): string | undefined;
    setLocalWorkViewId(viewId?: string): void;
    setCurrentToolsData(currentToolsData: IActiveToolsDataType): void;
    private prepareOnceWork;
    createViewWorker(viewId: string, options: ViewWorkerOptions, displayer: MainViewDisplayerManager | AppViewDisplayerManager): void;
    destroyViewWorker(viewId: string, isLocal?: boolean): void;
    onServiceDerive(key: string, data: DiffOneData<BaseCollectorReducerAction | undefined>): void;
    pullServiceData(viewId: string, scenePath: string, options?: {
        isAsync?: boolean;
        useAnimation?: boolean;
    }): void;
    runAnimation(): void;
    consume(): void;
    unWritable(): void;
    abled(): void;
    isAbled(): boolean;
    postMainThread(msg: Set<IWorkerMessage>): void;
    postWebWorker(msg: Set<IWorkerMessage>): void;
    post(msg: Set<IWorkerMessage>): void;
    updateNode(workId: IworkId, updateNodeOpt: IUpdateNodeOpt, viewId: string, scenePath: string): void;
    destroyTaskQueue(): void;
    updateDpr(viewId: string, dpr: number): void;
    updateCamera(viewId: string, cameraOpt: ICameraOpt): void;
    private updateCameraDone;
    private consumeQueue;
    clearViewScenePath(viewId: string, justLocal?: boolean | undefined, isFiter?: boolean): Promise<void>;
    private internalMsgEmitterListener;
    private setZIndex;
    checkDrawingWork(vId: string): void;
    removeDrawingWork(vId: string): void;
    removeNodes(viewId: string, removeIds: string[]): void;
    hoverCursor(point: [number, number], viewId: string): void;
    blurCursor(viewId: string): void;
    sendCursorEvent(p: [number | undefined, number | undefined], viewId: string): void;
    getBoundingRect(scenePath: string): Promise<IRectType> | undefined;
    getSnapshot(scenePath: string, width?: number, height?: number, camera?: Pick<ICameraOpt, "centerX" | "centerY" | "scale">): Promise<(ImageBitmap | HTMLImageElement | null)[]> | undefined;
    queryTaskBatchData(query: IqueryTask): IWorkerMessage[];
    insertIconify(viewId: string, iconifyInfo: IconifyInformation & {
        strokeColor?: string;
    }): void;
    insertBackgroundSVG(viewId: string, svgInfo: ISVGUrlInformation): void;
    insertBackgroundMarkMap(viewId: string, svgInfo: ISVGMarkmapInformation): Promise<MarkmapId | undefined>;
    updateBackgroundMarkMap(viewId: string, markmapId: string, svgInfo: ISVGMarkmapInformation): Promise<void>;
    insertImage(viewId: string, imageInfo: ImageInformation): void;
    lockImage(viewId: string, uuid: string, locked: boolean): void;
    completeImageUpload(viewId: string, uuid: string, src: string): void;
    getImagesInformation(scenePath: string): ImageInformation[];
    setShapeSelectorByWorkId(workId: string, viewId: string): void;
    blurSelector(viewId: string, scenePath: string, workId?: string): void;
    consoleWorkerInfo(): void;
    sendClearUids(viewId: string, clearUids?: _SetTrue): void;
    getVNodeInfo(uuid: string, viewId: string, workIds: string[]): Promise<{
        uuid: string;
        vInfo?: BaseNodeMapItem[];
    } | undefined>;
}
