// Set up a tsconfig.json file in the root of your TypeScript project, with the following contents: { "compilerOptions": { "target": "es6", "module": "es6", "outDir": "dist", "strict": true }, "include": [ "src/**/*" ] } // Install the 'TypeScript and JavaScript Language Features' extension in VSCode
// Define a class in a .ts file class Person { name: string; age: number; constructor(name: string, age: number) { this.name = name; this.age = age; } sayHello() { console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`); } } // Instantiate the class and call its methods const john = new Person('John', 30); john.sayHello();Package library: TypeScript Language Features extension.