Skip to main content

Base Type

set

(maths concept) collection of distinct things

Top Type

universal (super-) Type assignable to any Variable

any

(default) untyped anonymous Type, can be literally anything

unknown

Top Type to rep any value but also make it illegal to use (w/o Narrow)

Source: The unknown Type in TypeScript — Marius Schulz

void

Type to rep no return value from function

never

bottom type to rep values never observed (or never return from function)

Typed Object

Type to ref any non-Primitive; as Record or Dictionary

enum

Enumerated set of named constants Type. default numbered. optional string member assign via =

Source: TypeScript: Handbook - Enums

Function Type

Type to annotate Methods & Callback Function with implicit return of any

Typed Classes

Numeric Literal Type

fixed set of specific values for number as Type

String Literal Type

fixed set of specific values for string as types

Array

TS Extended Type for Array

Booleanish

type Booleanish = boolean | 'true' | 'false';

References