TypeScript instead of Javascript for building moodle plugins?

TypeScript instead of Javascript for building moodle plugins?

by Ava Taylor -
Number of replies: 2
Hi

is there some way I can use TypeScript instead of Javascript for building moodle plugins?
I just like the syntax of TypeScript better.

I have moodle 3.5.1 installed, will be moving to moodle 3.9 soon
Average of ratings: -
In reply to Ava Taylor

Re: TypeScript instead of Javascript for building moodle plugins?

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
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