You can use the following public API to write your scripts and modules in TypeScript.
For more information, see the following page Workflow for Setting up the Environment for Public API to Customize Analyses.