import type { ActionSchema, FunctionExpression, GlobalQueryConfig } from '@mo-fang/types';
import type { QueryValue, StateValue } from '../models';
export interface SourcemapConfig {
    name: string;
    enable: boolean;
}
export interface ResolveOption {
    scope?: Record<string, unknown>;
    sourcemap?: SourcemapConfig;
    disableError?: boolean;
}
export interface ResolveReferencesOption extends ResolveOption {
    object: unknown;
}
export interface ResolveCodeOption extends ResolveOption {
    code: string;
}
export interface FunctionGeneratorOption extends ResolveOption {
    expression: FunctionExpression;
}
export interface ActionGeneratorOption extends ResolveOption {
    action: ActionSchema;
}
export interface ActionsGeneratorOption extends ResolveOption {
    actions: ActionSchema[];
}
export interface MessageOption {
    content?: string;
    duration?: number;
}
export interface NotificationOption {
    message?: string;
    description?: string;
    placement?: string;
    duration?: number;
    key?: string | number;
}
export interface InjectComponents {
    message?: {
        success(option: MessageOption): void;
        error(option: MessageOption): void;
        info(option: MessageOption): void;
        warning(option: MessageOption): void;
        loading(option: MessageOption): void;
    };
    notification?: {
        success(option: NotificationOption): void;
        error(option: NotificationOption): void;
        info(option: NotificationOption): void;
        warning(option: NotificationOption): void;
    };
}
export interface StoreProtocol {
    /**
     * 注入组件
     */
    getInjectComponents(name: 'message' | 'notification'): InjectComponents[typeof name];
    /**
     * 运行时错误
     *
     * @param error
     */
    throwRuntimeError?: (error: Error) => void;
    /**
     * 解析复杂对象
     *
     * @param object 解析对象
     * @param scope 作用域
     * @param sourcemap sourcemap 配置
     * @returns
     */
    resolveReferences: <P = unknown>(option: ResolveReferencesOption) => [Error | undefined, P | undefined];
    /**
     * 解析代码
     *
     * @param option
     * @returns
     */
    resolveCode: <P = unknown>(option: ResolveCodeOption) => (...rest: unknown[]) => [Error | undefined, P | undefined];
    /**
     * 生成函数
     *
     * @param functionExpression 表达式
     * @param scope 作用域
     * @param sourcemap
     */
    generateFunction: <P>(option: FunctionGeneratorOption) => (...rest: unknown[]) => P | undefined;
    /**
     * 生成单个动作
     *
     * @param action
     * @param scope
     * @param sourcemap
     * @returns
     */
    generateAction: (option: ActionGeneratorOption) => (...rest: unknown[]) => Promise<unknown>;
    /**
     * 生成动作列表
     *
     * @param actions
     * @param scope
     * @param sourcemap
     * @returns
     */
    generateActions: (option: ActionsGeneratorOption) => (...rest: unknown[]) => Promise<unknown[]>;
    /**
     * 获取全局查询配置
     *
     * @returns
     */
    getGlobalQueryConfig: (uuid?: string) => GlobalQueryConfig | undefined;
    /**
     * 获取查询
     *
     * @param id
     */
    getQuery: (id: string) => QueryValue;
    /**
     * 获取状态
     *
     * @param id
     * @returns
     */
    getState: (id: string) => StateValue;
}
//# sourceMappingURL=store-protocol.d.ts.map