@o3r/rules-engine
Version:
This module provides a rule engine that can be executed on your Otter application to customize your application (translations, placeholders and configs) based on a json file generated by your CMS.
25 lines • 995 B
TypeScript
import { Observable } from 'rxjs';
/** Represents all the supported facts types TOCHECK utils.Date vs Date */
export type Facts = string | number | boolean | null | Date | Record<string, unknown> | unknown[];
/** Fact basic value type */
export type FactBasicValues = number | boolean | string | string[] | boolean[] | number[] | undefined;
/** Map of fact name / type pairs */
export interface FactDefinitions {
[factName: string]: unknown;
}
/** Return type of a fact factory */
export type FactFactoryReturn<T> = Observable<T> | Promise<T> | T;
/** Set of facts */
export type FactSet<T extends FactDefinitions> = {
[P in keyof T]: FactFactoryReturn<T[P] | undefined | null>;
};
/** Fact stream type */
export type FactValueStream<T = unknown> = Observable<T | undefined>;
/** Fact stream */
export interface Fact<T = unknown> {
/** Fact ID */
id: string;
/** Stream of the fact fact value */
value$: FactValueStream<T>;
}
//# sourceMappingURL=fact.interfaces.d.ts.map