-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with typings in 2.1.0 #970
Comments
In the latest version, |
Consider using an updated API instead of an obsolete one! |
I am doing. The issue is that it's still present in the index.d.ts, but it should not be. |
For the first question, when I tested the declaration file(
And for the second question, that's a bug. However, I am suddenly wondering if it is right to use it as For the last question, the
I think this means you're sending PR (Pull Request). Contributing is always welcome, so you can do that! Then I will wait for your answer. 😃 |
Thanks for the response! For 1., the problem is the opposite way around: the index.d.ts file specifies a setValue method: tui.editor/apps/editor/index.d.ts Line 838 in d0a1c47
but trying to call this method fails because it doesn't actually exist. For 2. I agree -- there is an "addCommand" method that allows you to access the method on CommandManager you need (though it isn't in the index.d.ts) -- I think a nice solution is to add an "addEventType" that calls through to eventManager. Alternatively, "on" could be changed to add an event if it hasn't been added yet (because if you don't add an event before listening for it, the program will crash), but I can't see a way to tell this through the public API. For 3., I've inherited a project that has no preview area for the Markdown. I can try to check why when the Product Owner comes back on Monday. It might be because you can flip to the WYSIWYG tab to see what it looks like, so the PO decided that the preview mode was unnecessary noise. If you set the previewStyle to 'none', you can see that the preview disappears 😉. Null is also an allowed value, and does work even if it's not supposed to be supported: tui.editor/apps/editor/index.d.ts Line 234 in d0a1c47
|
@midgleyc Sorry, the answer is late. For 1. As of the answer above, since version 2.0, the For 2 and 3. These two are related to the specification, so we are discussing these issues. For example, when using So the correct answer will be given once these discussions are decided. I would appreciate it if you wait a little longer! 🙏 |
You don't need to use insertItem to insert a new button. The Editor constructor takers a toolbarItems parameter that you can pass custom buttons to: https://github.com/nhn/tui.editor/blob/master/apps/editor/src/js/editor.js#L141 If the constructor would go through our custom buttons and register our events itself, that would also be nice, but having insertItem alone would mean we'd have to rewrite this, and I prefer the way that the up-front declaration works. |
I've been using this under Typescript, and I've found some issues with version 2.1.0.
Would you accept a pull request to fix any of these, and which if yes?
The text was updated successfully, but these errors were encountered: