Skip to content

Commit 15db7a8

Browse files
committed
[CDX-390]: update FilterNode to union type
1 parent cf7f1c2 commit 15db7a8

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/types/index.d.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,18 @@ export type FilterExpressionRange = {
215215

216216
export type FilterExpressionRangeValue = ['-inf' | number, 'inf' | number];
217217

218-
export interface FilterNode {
218+
export interface VariationsMapSingleFilter {
219219
field: string;
220220
value: string | number | boolean;
221221
}
222222

223+
export interface VariationsMapRange {
224+
field: string;
225+
range: [number, number];
226+
}
227+
228+
export type FilterNode = VariationsMapSingleFilter | VariationsMapRange;
229+
223230
export interface FilterBy {
224231
and?: Array<FilterNode | FilterBy>;
225232
or?: Array<FilterNode | FilterBy>;
@@ -257,7 +264,7 @@ export interface SearchSuggestion extends Item {
257264

258265
export type VariationsMapResponse = Array<Record<string, unknown>> | Record<string, unknown>;
259266

260-
export type Aggregation = 'first' | 'min' | 'max' | 'all' | 'count' | 'field_count' | 'value_count'
267+
export type Aggregation = 'first' | 'min' | 'max' | 'all' | 'count' | 'field_count' | 'value_count';
261268

262269
export interface VariationsMapBaseValue {
263270
aggregation: Aggregation;
@@ -271,7 +278,7 @@ export interface VariationsMapValueCount extends VariationsMapBaseValue {
271278
}
272279

273280
export interface VariationsMapStandardValue extends VariationsMapBaseValue {
274-
aggregation: Exclude<Aggregation, 'value_count'>
281+
aggregation: Exclude<Aggregation, 'value_count'>;
275282
field: string;
276283
}
277284

0 commit comments

Comments
 (0)