From f40eb766c48da02929d35383e8208d8334af9bd6 Mon Sep 17 00:00:00 2001 From: A Prakhar <87535249+aprakhar@users.noreply.github.com> Date: Mon, 4 Aug 2025 12:00:33 +0530 Subject: [PATCH] feat: Allow params in fact and event to be an array of Record [Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) --- types/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index aaa22f8..5f64f9d 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -91,7 +91,7 @@ export class Almanac { constructor(options?: AlmanacOptions); factValue( factId: string, - params?: Record, + params?: TParams, path?: string ): Promise; addFact(fact: Fact): this; @@ -108,8 +108,10 @@ export type FactOptions = { priority?: number; }; +type TParams = Record | Record[]; + export type DynamicFactCallback = ( - params: Record, + params: TParams, almanac: Almanac ) => T; @@ -129,7 +131,7 @@ export class Fact { export interface Event { type: string; - params?: Record; + params?: TParams; } export type PathResolver = (value: object, path: string) => any; @@ -205,7 +207,7 @@ interface ConditionProperties { value: { fact: string } | any; path?: string; priority?: number; - params?: Record; + params?: TParams; name?: string; }