Essential component for TypeScript magics.
npm i type-containerA Type Container is simply an empty object but carries specific TypeScript type information, enabling infinite possibilities of advanced type inferences and manipulations.
The $type function produces a type container:
const $payload = $type<{ id: string }>();
// $payload -> TypeContainer<{ id: string }>Conventionally, variables and parameters of a
TypeContainertype are prefixed with$for easy identification.
To extract the type information from a type container, use the ContainedTypeOf type:
const $payload