Convert code to TypeScript