Skip to content

Commit 84a0781

Browse files
committed
Union Condition type
1 parent 7857c69 commit 84a0781

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/core/src/models/uischema.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export enum RuleEffect {
114114
/**
115115
* Represents a condition to be evaluated.
116116
*/
117-
export interface Condition {
117+
export interface BaseCondition {
118118
/**
119119
* The type of condition.
120120
*/
@@ -124,7 +124,7 @@ export interface Condition {
124124
/**
125125
* A leaf condition.
126126
*/
127-
export interface LeafCondition extends Condition, Scoped {
127+
export interface LeafCondition extends BaseCondition, Scoped {
128128
type: 'LEAF';
129129

130130
/**
@@ -133,7 +133,7 @@ export interface LeafCondition extends Condition, Scoped {
133133
expectedValue: any;
134134
}
135135

136-
export interface SchemaBasedCondition extends Condition, Scoped {
136+
export interface SchemaBasedCondition extends BaseCondition, Scoped {
137137
schema: JsonSchema;
138138

139139
/**
@@ -153,7 +153,7 @@ export interface SchemaBasedCondition extends Condition, Scoped {
153153
/**
154154
* A composable condition.
155155
*/
156-
export interface ComposableCondition extends Condition {
156+
export interface ComposableCondition extends BaseCondition {
157157
conditions: Condition[];
158158
}
159159

@@ -171,6 +171,13 @@ export interface AndCondition extends ComposableCondition {
171171
type: 'AND';
172172
}
173173

174+
export type Condition =
175+
| BaseCondition
176+
| LeafCondition
177+
| OrCondition
178+
| AndCondition
179+
| SchemaBasedCondition;
180+
174181
/**
175182
* Common base interface for any UI schema element.
176183
*/

0 commit comments

Comments
 (0)