InterviewSolution
| 1. |
What Is Typescript Declare Keyword? |
|
Answer» It’s quite POSSIBLE that JavaScript libraries/frameworks don’t have TYPESCRIPT definition files and yet you want to use them without any errors. TE solution is to use the declare keyword. The declare keyword is used for ambient declarations where you want to DEFINE a VARIABLE that may not have originated from a TypeScript file. declare var unKnownLibrary; It’s quite possible that JavaScript libraries/frameworks don’t have TypeScript definition files and yet you want to use them without any errors. Te solution is to use the declare keyword. The declare keyword is used for ambient declarations where you want to define a variable that may not have originated from a TypeScript file. declare var unKnownLibrary; |
|