TypeScript support is very partial
See original GitHub issueHi!
Thanks for adding TypeScript support. However, I think that current support is not sufficient. Actually, after doing suneditor.init, we’re getting type “any”, so we don’t have any type annotations for editor functionalities. I think that’s the most crucial part because most of the logic is after instantiating the object, not before.
Another thing with the support is the fact, that currently, support is only for the main suneditor module. There’s no support for plugins and locale, so in strictly typed environment we still need to add empty declaration like declare module 'suneditor/*';
to avoid TypeScript errors.
It’s not critical, it’s just a nice to have feature, that would be very useful for development purposes. It’s much easier to browse through code suggestions from TypeScript in IDEs like WebStorm or VS Code than browsing through documentation.
Cheers!
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (17 by maintainers)
Top GitHub Comments
Thank you! I couldn’t find a way. It helped me a lot in studying TypeScript. I’ll release new version and let you know. Thank you again : )
@JiHong88 everything looks good. I’ve just added an additional pull request https://github.com/JiHong88/SunEditor/pull/315 with small fix.
And IMO we can close that ticket 😃 . TypeScript works great now.