question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript support is very partial

See original GitHub issue

Hi!

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:closed
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
JiHong88commented, Apr 5, 2020

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 : )

1reaction
tswistakcommented, Apr 5, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript support is very partial · Issue #287 - GitHub
I've created the first PR where I've added typings that will allow using Suneditor in TypeScript without any problems. Now, the only thing...
Read more >
Getting To Know The Partial Type in TypeScript - Netanel Basal
TypeScript (v2.1) provides us with a solution precisely for these cases — The Partial interface. ... Under the hood the Partial interface looks...
Read more >
How does the TypeScript Partial type work? - Tim Mousk
The Partial<Type> type is a built-in TypeScript utility type that takes a Type and creates a new type with all Type's properties set...
Read more >
How the TypeScript Partial Type Works - DEV Community ‍ ‍
The Partial type in TypeScript is a utility type which does the opposite of Required. It sets all properties in a type to...
Read more >
How to use TypeScript Partial Type? - Refine Dev
We'll explain the TypeScript Partial utility type with examples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found