wstaelens / TypeScript-Summernote

TypeScript definition for summernote ( http://summernote.org )
MIT License
5 stars 4 forks source link

Expose of UI #2

Open gkopevski opened 7 years ago

gkopevski commented 7 years ago

Hi, I am new to summernote and both typescript. I am having a problem to get the ui object from summernote (http://summernote.org/deep-dive/#custom-button).

Can you please provide me help how to expose the ui to the the summernote types or give me guide/example how to achieve this.

Thanks

wstaelens commented 7 years ago

Hi,

I've only needed a basic summernote definition in TypeScript, because of code I was converting. so I only wrote this (I'm not sure how the modules would translate to TypeScript itself).

The UI and other modules are not yet defined, feel free to add it to the code or discuss further. I believe my TypeScript skills are the same as yours! :-)

gkopevski commented 7 years ago

I managed to solve it by adding 1 more interface: interface JQueryStatic { summernote:any; } On this way I am able to get the ui instance: Example: let ui = $.summernote.ui;

If you tink that it is ok, I will make pull request.

wstaelens commented 7 years ago

well for sure it is ok as it makes the UI module available. You or others can later on improve code if they want.

gkopevski commented 7 years ago

Added pull request https://github.com/wstaelens/TypeScript-Summernote/pull/3