UNPKG

747 BTypeScriptView Raw
1import { IAction, IInteractionContext, LooseObject } from '../../interface';
2/**
3 * Action 的基类
4 */
5declare abstract class Action<T = LooseObject> implements IAction {
6 /** Action 名字 */
7 name: any;
8 /** 上下文对象 */
9 context: IInteractionContext;
10 /** Action 配置 */
11 protected cfg: T;
12 /** 配置项的字段,自动负值到 this 上 */
13 protected cfgFields: string[];
14 constructor(context: IInteractionContext, cfg?: T);
15 /**
16 * 设置配置项传入的值
17 * @param cfg
18 */
19 protected applyCfg(cfg: any): void;
20 /**
21 * Inits action,提供给子类用于继承
22 */
23 init(): void;
24 /**
25 * Destroys action
26 */
27 destroy(): void;
28}
29export default Action;