İçeriğe geç

CatalogState

The catalog’s type-level state. meters is a union of MeterEntry interfaces.

Large catalogs (hundreds of chained .meter() calls) stay cheap for tsc because each step’s state is written out as a plain MeteringState<…> reference in meter()’s return type. Do not wrap it in a type alias: an alias keeps the previous state as an alias type argument, TypeScript re-instantiates that chain recursively, and the checker hits its instantiation depth limit at ~100 meters.

commit: boolean


ctx: BaseContext


meters: MeterEntry


pools: string

Ids that can be feeds targets, kept incrementally (deriving them from meters is quadratic).


rate: boolean


ref: string