import { ModuleDesc, ModuleName, ModuleEventMap, ModuleCmdMap, CmdFun } from '../types/protocol';
export declare enum EventEnum {
}
export type EventMap = ModuleEventMap<never>;
export declare enum CmdEnum {
    pick = "UI.pick",
    showInfo = "UI.showInfo",
    confirm = "UI.confirm",
    input = "UI.input",
    openPage = "UI.openPage",
    link = "UI.link",
    dialog = "UI.dialog",
    showLoading = "UI.loading",
    multiPick = "UI.multiPick"
}
export interface Info {
    content: string;
    title?: string;
    type?: 'warn' | 'info' | 'error';
}
type CmdPick = <T>(m: ModuleName.ui, cmd: CmdEnum.pick, list: ({
    name: string;
    value: T;
} | T)[], message?: string) => Promise<T>;
type CmdShowInfo = (m: ModuleName.ui, cmd: CmdEnum.showInfo, info: Info) => void;
type CmdConfirm = (m: ModuleName.ui, cmd: CmdEnum.confirm, info: Info & {
    default?: boolean;
}) => Promise<boolean>;
type CmdOpenPage = (m: ModuleName.ui, cmd: CmdEnum.openPage, url: string, options?: {
    forceChrome?: boolean;
}) => Promise<void>;
type CmdInput = (m: ModuleName.ui, cmd: CmdEnum.input, info: {
    placeholder: string;
    label?: string;
    checker?: (text: string) => boolean | string | Promise<boolean | string>;
    default?: string;
}) => Promise<string>;
type CmdLink = (m: ModuleName.ui, cmd: CmdEnum.link, url: string, tooltip?: string) => string;
type CmdDialog = (m: ModuleName.ui, cmd: CmdEnum.dialog, info: Info) => void;
export interface LoadingInfo {
    text: string;
}
type CmdShowLoading = (m: ModuleName.ui, cmd: CmdEnum.showLoading, info: LoadingInfo) => {
    hideLoading: () => void;
};
type CmdMultiPick = <T>(m: ModuleName.ui, cmd: CmdEnum.multiPick, list: ({
    name: string;
    value: T;
} | T)[], message?: string) => Promise<T[]>;
export type Command = CmdPick & CmdShowInfo & CmdConfirm & CmdInput & CmdOpenPage & CmdLink & CmdDialog & CmdShowLoading & CmdMultiPick;
export interface CmdMap extends ModuleCmdMap<CmdEnum> {
    [CmdEnum.pick]: CmdFun<CmdPick>;
    [CmdEnum.showInfo]: CmdFun<CmdShowInfo>;
    [CmdEnum.confirm]: CmdFun<CmdConfirm>;
    [CmdEnum.input]: CmdFun<CmdInput>;
    [CmdEnum.openPage]: CmdFun<CmdOpenPage>;
    [CmdEnum.link]: CmdFun<CmdLink>;
    [CmdEnum.dialog]: CmdFun<CmdDialog>;
    [CmdEnum.showLoading]: CmdFun<CmdShowLoading>;
    [CmdEnum.multiPick]: CmdFun<CmdMultiPick>;
}
export declare const UIDesc: ModuleDesc<EventMap, CmdMap, never>;
export {};
