Typescript in add-on

Is there a way to get typescript in add-on the same way we get autocompletion in python?
I tried to look at @hengiesel 's closet add-on but can’t figure out how the compilation is done.

If I just try to rename js into ts and run tsc, it warns that a lot of elements are not defined - which makes sens since I’ve not even imported them. But I don’t see how to let the ts file know it should import from editor module