my-awesome-typescript-project / src/composed-types
Composed types.
type ecmaPrimitives = ecmaPrimitives;Defined in: src/composed-types.ts:23
Union of primitive types
- Union of all ECMA primitive types.
- Typescript provides the following types :
- any
- unknown
- never
- void
- Typescript-only types cannot be tested at execution time.
type ecmaSpecialCases = ecmaSpecialCases;Defined in: src/composed-types.ts:34
Union of special types
- Union of all ECMA type-like special cases.
null,functionandobjectare not primitive types (see below).nullis null andfunctionare special objects that are callable.
type impossible = never;Defined in: src/composed-types.ts:43
Empty intersection type
- Evaluates to
neversince the consituents do not overlap.
type unit = "unit";Defined in: src/composed-types.ts:54
Subtype from a union type
- The unions overlap evaluate to a single value of type string.
- Thus, this intersection type evaluates to a unit type.
- Parentheses can be used to constrain operator precedence.
type event = serverEvent | userEvent;Defined in: src/composed-types.ts:68
Discriminated union types
- Every constituent of a discriminated union type must have a common property set to a literal value.