converting to TypeScript