The platform adds native TypeScript support, only at the beginning of the source code (select the type of scripting language or JavaScript)
// @ts-check
It's automatically recognized as 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')) }