Browse Source

refactor: KERNEL-936 申明 action && behaver

es6
alan 5 years ago
parent
commit
bf42e6b31e
  1. 5
      typescript/core/action/action.show.ts
  2. 11
      typescript/core/action/action.ts
  3. 4
      typescript/core/behavior/behavior.highlight.ts
  4. 4
      typescript/core/behavior/behavior.redmark.ts
  5. 9
      typescript/core/behavior/behavior.ts
  6. 13
      typescript/index.ts

5
typescript/core/action/action.show.ts

@ -0,0 +1,5 @@
import { _Action } from "./action";
export interface _ShowAction extends _Action {
}

11
typescript/core/action/action.ts

@ -0,0 +1,11 @@
import { _OB } from "../ob";
export interface _Action extends _OB {
actionPerformed(src: any, tar: any, callback: Function): void;
actionBack(tar: any, src: any, callback: Function): void;
}
export interface _ActionFactory {
createAction(key: string, options: any): _Action;
}

4
typescript/core/behavior/behavior.highlight.ts

@ -0,0 +1,4 @@
import { _Behavior } from "./behavior";
export interface _HighlightBehavior extends _Behavior {
}

4
typescript/core/behavior/behavior.redmark.ts

@ -0,0 +1,4 @@
import { _Behavior } from "./behavior";
export interface _RedMarkBehavior extends _Behavior {
}

9
typescript/core/behavior/behavior.ts

@ -0,0 +1,9 @@
import { _OB } from "../ob";
export interface _Behavior extends _OB {
doBehavior(items: any[]): void;
}
export interface _BehaviorFactory {
createBehavior(key: string, options: any): _Behavior;
}

13
typescript/index.ts

@ -6,6 +6,12 @@ import { _Single } from "./base/single/single";
import { _base } from "./core/base";
import { _BasicButton } from "./base/single/button/button.basic";
import { _Trigger } from "./base/single/trigger/trigger";
import { _Action, _ActionFactory } from "./core/action/action";
import { _ShowAction } from "./core/action/action.show";
import { _Behavior, _BehaviorFactory } from "./core/behavior/behavior";
import { _HighlightBehavior } from "./core/behavior/behavior.highlight";
import { _RedMarkBehavior } from "./core/behavior/behavior.redmark";
type Constructor<T extends {}> = T & {
new(config: any): T;
@ -19,4 +25,11 @@ export interface _BI extends _func, _i18n, _base {
Single: Constructor<_Single>;
BasicButton: Constructor<_BasicButton>;
Trigger: Constructor<_Trigger>;
Action: Constructor<_Action>;
ActionFactory: Constructor<_ActionFactory>;
ShowAction: Constructor<_ShowAction>;
Behavior: Constructor<_Behavior>;
BehaviorFactory: Constructor<_BehaviorFactory>;
HighlightBehavior: Constructor<_HighlightBehavior>;
RedMarkBehavior: Constructor<_RedMarkBehavior>;
}

Loading…
Cancel
Save