Moodle doesn't automatically handle TypeScript. It does have a gruntjs task-runner for generating js from various other js versions to target the browsers Moodle supports. See Gruntfile.js - https://github.com/moodle/moodle/blob/master/Gruntfile.js
You don't have to use Moodle's task-runner though, you could always create your own, e.g. gulp: https://www.typescriptlang.org/docs/handbook/gulp.html
You don't have to use Moodle's task-runner though, you could always create your own, e.g. gulp: https://www.typescriptlang.org/docs/handbook/gulp.html