Adds typescript .d.ts declaration file for RegularTableElement#56
Adds typescript .d.ts declaration file for RegularTableElement#56telamonian wants to merge 3 commits intomasterfrom
Conversation
79ed268 to
966a19c
Compare
texodus
left a comment
There was a problem hiding this comment.
Thanks for the PR!
This is a nice addition but needs some work. I've started some of these changes in ths ts-wip branch, but there is still work left (the sections below the break).
- Revert
element.jsrename please toindex.js, don't need a separate file just to register this class nor should the class itself be exported as it is not intended to be inherited. - Remove docs non-public methods 'get_tds()', et al methods removed by
file-browser-rewritebranch, onlystyleListener()is public and missing docs. - Remove
esmoutput entirely - removing the need for these multiple output targets for different module systems was the entire motivation behind moving to rollup. UseemitDeclarationOnlyflag and skipjsemit entirely, all we need are the.d.tsfor the module itself. - Don't emit
.d.tsfor anything butindex.js- the other files are not even exported by the module.
Not fixed in ts-wip:
- Fix e.g.
_column_sizes,_styles_callbacksprivate methods to not emit types. - Generate
index.d.tsdirectly from build, having this as a separate copy/paste asset with hand-written extensions kindof offsets the purpose of generating these (certainly--watch-ing them). - Speaking of which - can JSDoc outputs handle the
IntrinsicandReacttype hints? Let's please figure out a way to template these as part ofindex.d.tsgeneration.
I poked around for several hours, but was unable to find a way to generate the declaration for the
It was not obvious how to get
I don't think I managed to convey a full appreciation of how limited I agree that this would be very nice to have, but we'll have to roll our own declaration generation system to support this (maybe as a rollup plugin?) |
|
Thanks for the feedback! There was a bunch of stuff that I wasn't sure about (eg the existence of the separate All of the things you mention under "Not fixed in So the approach I went for in the end was basically to just manually write |
|
Closing this in favor of #65 |
dist/esmto the build. This includes.d.tsfiles autogenerated from the existing jsdoc comments in the javascript sources (using the standardtsctypescript compiler)index.d.tsfile to project root