boltex / leojs

Leo Literate Editor with Outline in Typescript
https://boltex.github.io/leojs/
MIT License
28 stars 1 forks source link

Support typescript with TSC compiler #74

Closed boltex closed 8 months ago

boltex commented 9 months ago

If the detected language of a script initiated by Ctrl+B is 'typescipt', consider the code to be a typescript source instead of javascript and run it through TSC compiler before giving it to the regular leojs script runner.

see https://stackoverflow.com/questions/23075748/how-to-compile-typescript-code-in-the-browser see https://github.com/microsoft/TypeScript/issues/50758

boltex commented 9 months ago

See this for a working example https://jsfiddle.net/mp4ev9t5/1/