How do I write a Typescript plugin?

Are there any docs / examples of writing a Typescript plugin?


The last time I am very inspired by the idea of ​​bringing Typescript to my projects. However, I currently see that this is not possible due to my unsuccessful attempts to find any docs on creating a Typescript plugin . I need this plugin to combine class metadata at compile time and then create an asset. It wasn't that easy, but I already wrote one for babel , and now I'm wondering if it is possible to do the same with Typescript.

+1


source to share


1 answer


You can download https://github.com/microsoft/typescript or via npm.

npm install typescript

      



Then include it in your project and through Compiler API

or TypeScript Language Service

work with TypeScripts codes. You can write your own compiler if you need. The basics are covered in the wiki.

https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API https://github.com/Microsoft/TypeScript/wiki/Using-the-Language-Service-API

+2


source







All Articles