平台加入原生TypeScript支持, 只需要在源码开头加入 (策略语言类型还是选JavaScript)
// @ts-check
就可以自动识别为TypeScript
// @ts-check class Greeter { greeting: string; constructor(message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; } } function peopleName(firstName: string, ...restOfname: string[]) { return firstName + " " + restOfname.join(" "); } function main() { let greeter = new Greeter("world"); Log(greeter.greet()); Log(peopleName('xiaochuan', 'xiaoming', 'xiaohong')) }