Skip to content

Type Alias: GrainsForSelectedTimeDims\<K, D\>

GrainsForSelectedTimeDims<K, D> = K extends AugmentedRegistry<MetricRegistry> ? { [P in Extract<D[number], keyof MetricDimensionMeta<K>>]: MetricDimensionMeta<K>[P] extends { time_grain: infer G extends readonly unknown[] } ? G[number] : never }[Extract<D[number], keyof MetricDimensionMeta<K>>] : string

The valid grains for the SELECTED temporal dimensions D of K — the union of each selected temporal dimension’s time_grain tuple. In practice grains are type-driven (all timestamp dims share one set, all date dims another), so the union is exactly the grains applicable to the query. Falls back to the metric’s whole timeGrains union (or string) for an unknown/degraded key.

K

D extends ReadonlyArray<PropertyKey>