Convert library to TypeScript