export interface Hash { [name: string]: number | string | boolean | Hash | Hash[]; } export interface ICompileOptions { define?: Map; scope?: Map; } export interface ICondition extends Array { scope?: Map; [0]: string | ICondition; [1]: string | ICondition; [2]: string; [3]?: any; [4]?: { from: string; }; } export interface IOrConstraint extends Array { [0]: 'or'; } export interface ISimpleConstraint extends Array { [0]: string; [1]: string; } export interface INomalConstraint extends Array { [0]: string; [1]: string; [2]: string; } export interface INotConstraint extends Array { [0]: 'not'; [1]: string; [2]: string; [3]: string; } export interface IFromstraint extends Array { [0]: string; [1]: string; [2]: string; [3]: string; } export interface IRuleContextOptions { priority?: number; salience?: number; agendaGroup?: string; autoFocus?: boolean; scope?: Map; } export interface IRuleContext { action: string; constraints: (ISimpleConstraint | INomalConstraint | INotConstraint | IFromstraint | IOrConstraint)[]; name: string; options: IRuleContextOptions; } export interface IContext { rules: IRuleContext[]; define: { name: string; properties: string; }[]; scope: { name: string; body: string; }[]; } export interface IPatternOptions { scope2?: Hash; scope: Map; pattern: string; alias?: string; } import { Match } from './context'; export interface IInsert { rule: IRule; hashCode: string; index: number; name: string; recency: number; match: Match; counter: number; } export interface IBucket { counter: number; recency: number; } import { IPattern } from './pattern'; import Flow from './flow'; export interface IRule { n: string; g: string; p: number; af: boolean; pt: IPattern; action?: string; fire?(flow: Flow, match: Match): Promise<{}>; }