UNPKG

fastlion-amis

Version:

一种MIS页面生成工具

34 lines (33 loc) 1.32 kB
import { RendererEvent } from '../utils/renderer-event'; declare type LogicActionType = 'parallel' | 'switch' | 'loop' | 'continue' | 'break'; export declare enum LoopStatus { NORMAL = 0, BREAK = 1, CONTINUE = 2 } export interface ListenerAction { actionType: 'broadcast' | LogicActionType | 'custom' | string; eventName?: string; description?: string; componentId?: string; args?: any; preventDefault?: boolean; stopPropagation?: boolean; execOn?: string; script?: string; [propName: string]: any; } export interface LogicAction extends ListenerAction { children?: ListenerAction[]; } export interface ListenerContext { [propName: string]: any; } export interface Action { run: (action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>, mergeData?: any) => Promise<void>; } export declare const registerAction: (type: string, action: Action) => void; export declare const getActionByType: (type: string) => Action; export declare const runActions: (actions: ListenerAction | ListenerAction[], renderer: ListenerContext, event: any) => Promise<void>; export declare const runAction: (actionInstrance: Action, actionConfig: ListenerAction, renderer: ListenerContext, event: any) => Promise<void>; export {};