Can you change the code above to TypeScript?