SAP Spartacus源代码里declare关键字的含义

https://stackoverflow.com/questions/35019987/what-does-declare-do-in-export-declare-class-actions

SAP Spartacus源代码里declare关键字的含义

var creates a new variable. declare is used to tell TypeScript that the variable has been created elsewhere. If you use declare, nothing is added to the JavaScript that is generated - it is simply a hint to the compiler.

The TypeScript declare keyword is used to declare variables that may not have originated from a TypeScript file.

The class’s real implementation is probably in somewhere else—maybe a .js file.

SAP Spartacus源代码里declare关键字的含义

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
SAP Spartacus源代码里declare关键字的含义