@enonic-types/core 7.12.0-RC5 → 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.
Files changed (2) hide show
  1. package/index.d.ts +11 -7
  2. 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
- export type AggregationToAggregationResult<Type extends Aggregation> = Type extends BucketsAggregationsUnion
327
- ? BucketsAggregationResult<Type['aggregations']>
328
- : Type extends SingleValueMetricAggregationsUnion
329
- ? SingleValueMetricAggregationResult
330
- : Type extends StatsAggregation
331
- ? StatsAggregationResult
332
- : never;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/core",
3
- "version": "7.12.0-RC5",
3
+ "version": "7.12.1",
4
4
  "description": "Shared type definition for core libraries.",
5
5
  "types": "index.d.ts",
6
6
  "files": [