Port to TypeScript.