diff --git a/package.json b/package.json index b602cfb..0c0e10d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "json-rules-engine", - "version": "6.0.1", + "version": "6.1.0", "description": "Rules Engine expressed in simple json", "main": "dist/index.js", "types": "types/index.d.ts", diff --git a/types/index.d.ts b/types/index.d.ts index ad1f432..b3d39e2 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -20,7 +20,8 @@ export class Engine { constructor(rules?: Array, options?: EngineOptions); addRule(rule: RuleProperties): this; - removeRule(rule: Rule): boolean; + removeRule(ruleOrName: Rule | string): boolean; + updateRule(rule: Rule): void; addOperator(operator: Operator): Map; addOperator( diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 70657aa..dcf5541 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -58,6 +58,7 @@ const rule: Rule = new Rule(ruleProps); const ruleFromString: Rule = new Rule(JSON.stringify(ruleProps)); expectType(engine.addRule(rule)); expectType(engine.removeRule(ruleFromString)); +expectType(engine.updateRule(ruleFromString)); expectType(rule.setConditions({ any: [] })); expectType(rule.setEvent({ type: "test" }));