ambient declaration

A declaration starting with declare, which tells the compiler something exists at run time without generating any code for it.

In more detail

declare const VERSION: string describes a global set by a script tag or build tool. Ambient declarations produce no output, so a wrong one is a lie the compiler will believe.

Related terms

Taught in

References