@enonic-types/core 7.12.0 → 7.12.1
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.
- package/index.d.ts +11 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -323,13 +323,17 @@ export type AggregationsToAggregationResults<AggregationInput extends Aggregatio
|
|
|
323
323
|
[Key in keyof AggregationInput]: AggregationToAggregationResult<AggregationInput[Key]>;
|
|
324
324
|
};
|
|
325
325
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
326
|
+
type AggregationOrNone<T> = T extends Aggregation ? T : Record<never, never>;
|
|
327
|
+
|
|
328
|
+
export type AggregationToAggregationResult<Type extends Aggregation> = Type extends GeoDistanceAggregation
|
|
329
|
+
? BucketsAggregationResult
|
|
330
|
+
: Type extends Exclude<BucketsAggregationsUnion, GeoDistanceAggregation>
|
|
331
|
+
? BucketsAggregationResult<AggregationOrNone<Type['aggregations']>>
|
|
332
|
+
: Type extends SingleValueMetricAggregationsUnion
|
|
333
|
+
? SingleValueMetricAggregationResult
|
|
334
|
+
: Type extends StatsAggregation
|
|
335
|
+
? StatsAggregationResult
|
|
336
|
+
: never;
|
|
333
337
|
|
|
334
338
|
export type BucketsAggregationsUnion =
|
|
335
339
|
| TermsAggregation
|