declare in TypeScript


declare const someVariable: any

declare in TypeScript is used to tell the compiler that a variable already exists and can be referenced.
It is not compiled to any JavaScript.

For example, when an object is created by a script that is loaded externally. If it now isn't explicitly declared, the compiler won't be happy.