Skip to content

Type Alias: ForecastBody

@kortexya/reasoninglayer


@kortexya/reasoninglayer / ForecastBody

ForecastBody = object & GroupedRankForecast | object & CrossSectionForecast

Defined in: src/types/forecast.ts:246

The domain-shaped prediction carried by a committed forecast.

A union discriminated by shape — one variant per outcome shape. Switch on shape to reach the shape-specific payload.

switch (forecast.body.shape) {
case 'grouped_rank':
console.log(forecast.body.competitors);
break;
case 'cross_section':
console.log(forecast.body.ranked);
break;
}