fix(core): update
This commit is contained in:
21
ts/smartrule.classes.rule.ts
Normal file
21
ts/smartrule.classes.rule.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as plugins from './smartrule.plugins';
|
||||
import { SmartRule } from './smartrule.classes.smartrule';
|
||||
|
||||
export type TTreeActionResult = 'continue' | 'apply-continue' | 'apply-stop' | 'stop';
|
||||
export type TActionFunc = (objectArg) => Promise<any>;
|
||||
|
||||
export type TCheckFunc<T> = (objectArg: T) => Promise<TTreeActionResult>;
|
||||
|
||||
export class Rule<T> {
|
||||
public smartRuleRef: SmartRule<T>;
|
||||
public priority: number;
|
||||
public checkFunction: TCheckFunc<T>;
|
||||
public actionFunction: TActionFunc;
|
||||
|
||||
constructor(smartRuleRef: SmartRule<T>, priorityArg: number, checkFunctionArg: TCheckFunc<T>, actionFunctionArg: TActionFunc) {
|
||||
this.smartRuleRef = smartRuleRef;
|
||||
this.priority = priorityArg;
|
||||
this.checkFunction = checkFunctionArg;
|
||||
this.actionFunction = actionFunctionArg;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user