Type Declarations

    While TypeScript automatically infers the type of every expression, sometimes we want to provide additional hints to the compiler to better describe our intentions.

    We can do this with type declarations and annotations. In this section, we'll cover the most common kinds of type declarations.

    Additionally, TypeScript supports a handful of custom values (e.g. enums) that don't exist at all in JavaScript. These types are translated to a close JavaScript approximation by the TypeScript compiler.