javascript-externs-generator icon indicating copy to clipboard operation
javascript-externs-generator copied to clipboard

Invalid externs for Quill

Open smogg opened this issue 8 years ago • 3 comments

Generating externs for Quill 1.1.0 doesn't include methods from Quill API. It also generates invalid js:

Quill.imports / formats / list / item.prototype = { ....

Which was generated based on this source from Quill:

_core2.default.register({
  ...
  'formats/list/item': _list.ListItem,

smogg avatar Oct 17 '16 16:10 smogg

@smogg thanks for the report.

Interesting, I guess the correct JS is:

Quill['imports']['formats/list/item'].prototype = { ...

but I don't think this is valid in an extern. In that case, perhaps these can be excluded from the extern altogether (somewhat related to #22). Not sure.

As for the Quill API functions... it looks like they are instance methods (new Quill().deleteText()) rather than being static calls (Quill.deleteText()) which I currently don't handle. I'm not 100% sure that those need to be in an extern, but #29 seems to provide some evidence that they do.

jmmk avatar Oct 19 '16 22:10 jmmk

Same for the "ACE Editor" (https://ace.c9.io/), btw.

dfrese avatar Jan 26 '17 15:01 dfrese

I've fixed the invalid format in https://github.com/jmmk/javascript-externs-generator/commit/0fcc0df8a08d5dfd6760a10d9885bed11033cba9

instance methods are still not handled

jmmk avatar Nov 11 '18 18:11 jmmk