Is there ever a reason to use the declare keyword in front of types and interfaces?
问题 I have come across some code like this: declare type A = { ... }; declare interface B { ... } From searching for the declare keyword (and none of the hits pointed to me the TypeScript docs for some reason), declare is used when a variable exists in JavaScript and you need to reference it from TypeScript, so you declare to the compiler that this variable indeed exists. All examples I have found that use this keyword use it like this: declare var a; Why would I ever use it in front of a type or