@@ -159,7 +159,7 @@ export type RuleResultSerializable = Pick<
159159
160160export interface RuleResult {
161161 name : string ;
162- conditions : TopLevelCondition ;
162+ conditions : TopLevelConditionResult ;
163163 event ?: Event ;
164164 priority ?: number ;
165165 result : any ;
@@ -184,6 +184,14 @@ export class Rule implements RuleProperties {
184184 ) : T extends true ? string : RuleSerializable ;
185185}
186186
187+ interface BooleanConditionResultProperties {
188+ result : boolean
189+ }
190+
191+ interface ConditionResultProperties extends BooleanConditionResultProperties {
192+ factResult : any
193+ }
194+
187195interface ConditionProperties {
188196 fact : string ;
189197 operator : string ;
@@ -194,25 +202,41 @@ interface ConditionProperties {
194202 name ?: string ;
195203}
196204
205+ type ConditionPropertiesResult = ConditionProperties & ConditionResultProperties
206+
197207type NestedCondition = ConditionProperties | TopLevelCondition ;
208+ type NestedConditionResult = ConditionPropertiesResult | TopLevelConditionResult ;
198209type AllConditions = {
199210 all : NestedCondition [ ] ;
200211 name ?: string ;
201212 priority ?: number ;
202213} ;
214+ type AllConditionsResult = AllConditions & {
215+ all : NestedConditionResult [ ]
216+ } & BooleanConditionResultProperties
203217type AnyConditions = {
204218 any : NestedCondition [ ] ;
205219 name ?: string ;
206220 priority ?: number ;
207221} ;
222+ type AnyConditionsResult = AnyConditions & {
223+ any : NestedConditionResult [ ]
224+ } & BooleanConditionResultProperties
208225type NotConditions = { not : NestedCondition ; name ?: string ; priority ?: number } ;
226+ type NotConditionsResult = NotConditions & { not : NestedConditionResult } & BooleanConditionResultProperties ;
209227type ConditionReference = {
210228 condition : string ;
211229 name ?: string ;
212230 priority ?: number ;
213231} ;
232+ type ConditionReferenceResult = ConditionReference & ConditionResultProperties ;
214233export type TopLevelCondition =
215234 | AllConditions
216235 | AnyConditions
217236 | NotConditions
218237 | ConditionReference ;
238+ export type TopLevelConditionResult =
239+ | AllConditionsResult
240+ | AnyConditionsResult
241+ | NotConditionsResult
242+ | ConditionReferenceResult
0 commit comments