From c0cb2bc61a6cfc7559b5faae4f06655a0840cc79 Mon Sep 17 00:00:00 2001 From: Michael Harris Date: Wed, 26 Feb 2025 13:54:42 -0600 Subject: [PATCH] Add evaluate to operator type --- types/index.d.ts | 1 + types/index.test-d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index aaa22f8..c1a54f5 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -72,6 +72,7 @@ export class Operator { evaluator: OperatorEvaluator, validator?: (factValue: A) => boolean ); + evaluate(factValue: A, compareToValue: B): boolean; } export interface OperatorDecoratorEvaluator { diff --git a/types/index.test-d.ts b/types/index.test-d.ts index a7e1120..2cb5d5e 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -90,6 +90,7 @@ const operator: Operator = new Operator( ); expectType(engine.addOperator(operator)); expectType(engine.removeOperator(operator)); +expectType(operator.evaluate(1, 1)); // Operator Decorator tests const operatorDecoratorEvaluator: OperatorDecoratorEvaluator = (