convert index.js to index.ts