js-rules-engine
Version:
JavaScript rules engine for validating data object structures.
24 lines (23 loc) • 489 B
TypeScript
/**
* Rule type.
*/
export declare type RuleType = 'and' | 'or';
/**
* Operator callback function.
*/
export declare type OperatorFn = (a: any, b: any) => boolean;
/**
* Rule json configuration.
*/
export interface RuleJson extends Object {
and?: Array<RuleJson | ConditionJson>;
or?: Array<RuleJson | ConditionJson>;
}
/**
* Condition json configuration.
*/
export interface ConditionJson {
fact: string;
operator: string;
value: any;
}