Replace JavaScript application code with TypeScript