@beabee/beabee-common 1.8.3 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,15 +10,16 @@ export interface RuleGroup {
|
|
|
10
10
|
condition: "AND" | "OR";
|
|
11
11
|
rules: (RuleGroup | Rule)[];
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
export declare type ValidatedRuleValue<T extends FilterType> = T extends "number" ? number : T extends "boolean" ? boolean : string;
|
|
14
|
+
interface BaseValidatedRule<T extends FilterType, F extends string> {
|
|
14
15
|
type: T;
|
|
15
16
|
field: F;
|
|
16
17
|
operator: keyof typeof operatorsByType[T];
|
|
17
|
-
value:
|
|
18
|
+
value: ValidatedRuleValue<T>[];
|
|
18
19
|
}
|
|
19
|
-
declare type ValidatedNumberRule<Field extends string> = BaseValidatedRule<"number", Field
|
|
20
|
-
declare type ValidatedStringRule<Field extends string> = BaseValidatedRule<Exclude<FilterType, "number" | "boolean">, Field
|
|
21
|
-
declare type ValidatedBooleanRule<Field extends string> = BaseValidatedRule<"boolean", Field
|
|
20
|
+
declare type ValidatedNumberRule<Field extends string> = BaseValidatedRule<"number", Field>;
|
|
21
|
+
declare type ValidatedStringRule<Field extends string> = BaseValidatedRule<Exclude<FilterType, "number" | "boolean">, Field>;
|
|
22
|
+
declare type ValidatedBooleanRule<Field extends string> = BaseValidatedRule<"boolean", Field>;
|
|
22
23
|
export declare type ValidatedRule<Field extends string> = ValidatedNumberRule<Field> | ValidatedStringRule<Field> | ValidatedBooleanRule<Field>;
|
|
23
24
|
export interface ValidatedRuleGroup<Field extends string> {
|
|
24
25
|
condition: "AND" | "OR";
|