For example, let’s imagine you have a library called customLibrary that doesn’t have a TypeScript declaration and have a namespace called customLibrary in the global namespace. You can use this library in typescript code as below,
declare var customLibrary;
In the runtime, typescript will provide the type to the customLibrary variable as any type. The another alternative without using declare keyword is below
var customLibrary: any;
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.