Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class Almanac {
constructor(options?: AlmanacOptions);
factValue<T>(
factId: string,
params?: Record<string, any>,
params?: TParams,
path?: string
): Promise<T>;
addFact<T>(fact: Fact<T>): this;
Expand All @@ -108,8 +108,10 @@ export type FactOptions = {
priority?: number;
};

type TParams = Record<string, any> | Record<string, any>[];

export type DynamicFactCallback<T = unknown> = (
params: Record<string, any>,
params: TParams,
almanac: Almanac
) => T;

Expand All @@ -129,7 +131,7 @@ export class Fact<T = unknown> {

export interface Event {
type: string;
params?: Record<string, any>;
params?: TParams;
}

export type PathResolver = (value: object, path: string) => any;
Expand Down Expand Up @@ -205,7 +207,7 @@ interface ConditionProperties {
value: { fact: string } | any;
path?: string;
priority?: number;
params?: Record<string, any>;
params?: TParams;
name?: string;
}

Expand Down