migrate from JavaScript to TypeScript