import { AutoRequestMessage } from '../types/auto';
import { AppType, DebugAccountInfo } from '../types/commonData';
import { ModuleDesc, ModuleName, ModuleEventMap, ModuleCmdMap, CmdFun } from '../types/protocol';
import { StartOptions, CompilePathType } from '../types/simulator';
export declare enum EventEnum {
    sendMessage = "Simulator.sendMessage",
    close = "Simulator.close"
}
export interface EventMap extends ModuleEventMap<EventEnum> {
    [EventEnum.sendMessage]: {
        type: '';
        params: object;
    };
    [EventEnum.close]: {
        type: '';
        params: null;
    };
}
export declare enum CmdEnum {
    start = "Simulator.start",
    receiveMsg = "Simulator.receiveMsg",
    getServerInfo = "Simulator.getPorts",
    setTrack = "Simulator.setTrack",
    execAutoAPI = "Simulator.execAutoAPI",
    switchProject = "Simulator.switchProject",
    checkProject = "Simulator.checkProject",
    initCompilePath = "Simulator.initCompilePath",
    createBridge = "Simulator.createBridge",
    wsClientCreated = "Simulator.wsClientCreated",
    startCompile = "Simulator.startCompile",
    getDebugInfo = "Simulator.getDebugInfo",
    initDebugInfo = "Simulator.initDebugInfo"
}
type CmdStart = (m: ModuleName.simulator, cmd: CmdEnum.start, options: Pick<StartOptions, Exclude<keyof StartOptions, 'appType'>>) => Promise<string>;
export type PortInfo = {
    simulatorPort: number;
    socketPort: number;
    staticPort: number;
    host: string;
};
type CmdGetPorts = (m: ModuleName.simulator, cmd: CmdEnum.getServerInfo, compilePath: string) => Promise<PortInfo>;
type CmdReceiveMsg = (m: ModuleName.simulator, cmd: CmdEnum.receiveMsg, message: {
    method: string;
    data: any;
}) => void;
type CmdSetTrack = (m: ModuleName.simulator, cmd: CmdEnum.setTrack, opt: {
    track: (...params: any[]) => void;
}) => void;
type CmdExecAutoAPI = (m: ModuleName.simulator, cmd: CmdEnum.execAutoAPI, opt: AutoRequestMessage) => void;
type CmdSwitchProject = (m: ModuleName.simulator, cmd: CmdEnum.switchProject, compilePath: string) => Promise<void>;
type CmdCheckProject = (m: ModuleName.simulator, cmd: CmdEnum.checkProject, compilePath: string, appType?: AppType) => Promise<void>;
type CmdInitCompilePath = (m: ModuleName.simulator, cmd: CmdEnum.initCompilePath, options: Pick<StartOptions, Exclude<keyof StartOptions, 'appType'>>) => Promise<{
    staticPort: number;
    compileType: CompilePathType | void;
}>;
type CmdCompileProject = (m: ModuleName.simulator, cmd: CmdEnum.createBridge, opt: {
    compileType: CompilePathType;
    bridge: any;
    compilePath?: string;
    from: 'simulator' | 'devtools';
    remoteDebugUrl?: string;
}) => Promise<void>;
type CmdWSClientCreated = (m: ModuleName.simulator, cmd: CmdEnum.wsClientCreated, opt: {
    wsClient: WebSocket;
    isBg: boolean;
}) => void;
type CmdStartCompile = (m: ModuleName.simulator, cmd: CmdEnum.startCompile, opt: {
    compileType: CompilePathType;
    bridge: any;
    compilePath: string;
    from: 'simulator' | 'devtools';
    remoteDebugUrl?: string;
}) => void;
type CmdGetDebugInfo = (m: ModuleName.simulator, cmd: CmdEnum.getDebugInfo, accountInfo: DebugAccountInfo, appID: string, appType: AppType) => Promise<void>;
type CmdInitDebugInfo = (m: ModuleName.simulator, cmd: CmdEnum.initDebugInfo, type: AppType) => Promise<void>;
export type Command = CmdStart & CmdGetPorts & CmdReceiveMsg & CmdSetTrack & CmdSwitchProject & CmdCheckProject & CmdExecAutoAPI & CmdInitCompilePath & CmdCompileProject & CmdWSClientCreated & CmdStartCompile & CmdGetDebugInfo & CmdInitDebugInfo;
export interface CmdMap extends ModuleCmdMap<CmdEnum> {
    [CmdEnum.start]: CmdFun<CmdStart>;
    [CmdEnum.getServerInfo]: CmdFun<CmdGetPorts>;
    [CmdEnum.receiveMsg]: CmdFun<CmdReceiveMsg>;
    [CmdEnum.setTrack]: CmdFun<CmdSetTrack>;
    [CmdEnum.execAutoAPI]: CmdFun<CmdExecAutoAPI>;
    [CmdEnum.switchProject]: CmdFun<CmdSwitchProject>;
    [CmdEnum.checkProject]: CmdFun<CmdCheckProject>;
    [CmdEnum.initCompilePath]: CmdFun<CmdInitCompilePath>;
    [CmdEnum.createBridge]: CmdFun<CmdCompileProject>;
    [CmdEnum.wsClientCreated]: CmdFun<CmdWSClientCreated>;
    [CmdEnum.startCompile]: CmdFun<CmdStartCompile>;
    [CmdEnum.getDebugInfo]: CmdFun<CmdGetDebugInfo>;
    [CmdEnum.initDebugInfo]: CmdFun<CmdInitDebugInfo>;
}
type ModuleDependencies = ModuleName.jssdk | ModuleName.storage | ModuleName.compile | ModuleName.account | ModuleName.service | ModuleName.ui | ModuleName.eventTracker | ModuleName.sniffer | ModuleName.preview | ModuleName.upload | ModuleName.creator | ModuleName.feedback | ModuleName.debugger;
export declare const SimulatorDesc: ModuleDesc<EventMap, CmdMap, ModuleDependencies>;
export {};
