Typescript alt

TypeScript rewrite