export type NestedPreProcessor = { fn: string; args?: (NestedProperty | unknown)[]; }; export type PreProcessor = string | NestedPreProcessor; export type NestedProperty = { name: string; preProcess?: PreProcessor[]; }; export type Property = string | NestedProperty; export type ValueReference = { property: Property; }; export type ConditionValue = T | ValueReference; export interface BaseCondition { property: Property; } export interface StringCondition extends BaseCondition { operator: "startsWith" | "endsWith" | "matchesRegex" | "doesNotMatchRegex"; value: ConditionValue; } export interface ScalarCondition extends BaseCondition { operator: "equal" | "notEqual"; value: ConditionValue; } export interface NumericCondition extends BaseCondition { operator: "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"; value: ConditionValue; } export interface ArrayInCondition extends BaseCondition { operator: "in" | "notIn"; value: ConditionValue; } export interface ContainsCondition extends BaseCondition { operator: "contains" | "doesNotContain"; value: ConditionValue; } export type AtomicCondition = StringCondition | ScalarCondition | NumericCondition | ArrayInCondition | ContainsCondition; export type EveryCondition = { every: AdvancedCondition[]; }; export type SomeCondition = { some: AdvancedCondition[]; }; export type NotCondition = { not: AdvancedCondition; }; export type AdvancedCondition = AtomicCondition | EveryCondition | SomeCondition | NotCondition; export declare function isCondition(condition: unknown): condition is AdvancedCondition; export declare function getProperty(object: Record, property: Property): unknown; export declare function evaluate(condition: AdvancedCondition, candidate: T): boolean;