import { ModuleDesc, ModuleName, ModuleEventMap, ModuleCmdMap, CmdFun } from '../types/protocol';
import { CompileType, AppInfoList, AppType } from '../types/commonData';
import { PackageType, Engine, LynxBundler } from '../types/compile';
export interface CompileEndResult {
    errMsg: string;
    data: {
        appType: AppType;
        productName?: string;
        from: From;
        blockTypeID?: string;
        isUpdate: boolean;
    };
}
export declare enum EventEnum {
    PathChange = "Compile.PathChange",
    Start = "Compile.Start",
    End = "Compile.End",
    WatchCompileEnd = "Compile.WatchCompileEnd",
    WatchCompileStart = "Compile.WatchCompileStart",
    EventTrack = "Compile.EventTrack",
    CompileProgress = "Compile.CompileProgress"
}
export type From = 'watch' | 'force' | 'live' | 'debug';
export interface EventMap extends ModuleEventMap<EventEnum> {
    [EventEnum.PathChange]: {
        type: '';
        params: {
            old: string | void;
            now: string;
        };
    };
    [EventEnum.Start]: {
        type: '';
        params: {
            compileId: number;
            from: From;
            appType: AppType;
        };
    };
    [EventEnum.End]: {
        type: '';
        params: {
            compileId: number;
            result: CompileEndResult;
        };
    };
    [EventEnum.WatchCompileEnd]: {
        type: '';
        params: CompileEndResult;
    };
    [EventEnum.WatchCompileStart]: {
        type: '';
        params: {
            data: {
                appType: AppType;
                from: From;
                isUpdate: boolean;
            };
        };
    };
    [EventEnum.EventTrack]: {
        type: '';
        params: {
            event: string;
            data: any;
        };
    };
}
export declare enum CmdEnum {
    Compile = "Compile.Compile",
    SetPath = "Compile.SetPath",
    GetPath = "Compile.GetPath",
    ListPath = "Compile.ListPath",
    Unpack = "Compile.Unpack",
    Clear = "Compile.Clear",
    ClearByPath = "Compile.ClearByPath"
}
export type CmdSetPath = (m: ModuleName.compile, cmd: CmdEnum.SetPath, path: string) => Promise<boolean>;
export type CompileOpt = {
    from: From;
    type: CompileType;
    compilePath: string;
    packageType?: PackageType;
    blockEngineType?: Engine;
    blockTypeId?: string;
    blockLynxBundler?: LynxBundler;
    remoteDebugUrl?: string;
    needWatch?: boolean;
};
export type CmdCompile = (m: ModuleName.compile, cmd: CmdEnum.Compile, opt: CompileOpt) => Promise<{
    taskId: number;
    distPath: string;
    error: string;
}>;
export type CmdGet = (m: ModuleName.compile, cmd: CmdEnum.GetPath) => void | string;
export type CmdList = (m: ModuleName.compile, cmd: CmdEnum.ListPath, appType?: AppType) => Promise<AppInfoList>;
export type CmdUnpack = (m: ModuleName.compile, cmd: CmdEnum.Unpack, path: string, targetPath: string) => Promise<void>;
export type CmdClear = (m: ModuleName.compile, cmd: CmdEnum.Clear, taskId?: number) => void;
export type CmdClearByPath = (m: ModuleName.compile, cmd: CmdEnum.ClearByPath, compilePath: string, from: From | 'all') => void;
export type Command = CmdSetPath & CmdCompile & CmdGet & CmdList & CmdUnpack & CmdClear & CmdClearByPath;
export interface CmdMap extends ModuleCmdMap<CmdEnum> {
    [CmdEnum.SetPath]: CmdFun<CmdSetPath>;
    [CmdEnum.Compile]: CmdFun<CmdCompile>;
    [CmdEnum.GetPath]: CmdFun<CmdGet>;
    [CmdEnum.ListPath]: CmdFun<CmdList>;
    [CmdEnum.Unpack]: CmdFun<CmdUnpack>;
    [CmdEnum.Clear]: CmdFun<CmdClear>;
    [CmdEnum.ClearByPath]: CmdFun<CmdClearByPath>;
}
export declare const CompileDesc: ModuleDesc<EventMap, CmdMap, ModuleName.storage | ModuleName.sniffer | ModuleName.ui | ModuleName.eventTracker>;
