Initial code to translate getdocs to TypeScript declaration #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "initial-translation-to-type-script-declaration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello @marijnh
I'm working in a proper solution to convert
getdocsto TypeScript declaration, and this is the initial work. My main idea is to use the proper TS compiler to generate it for us, but for now I'm doing this manually, I hope you could check and merge this PR then I could improve this much more and add some tests.getdocs example
ts-declaration expected
This is a neat prototype. But I wonder whether you need to integrate it with builddocs at all—wouldn't it be just as easy to build it as a separate project? What builddocs components are actually necessary to do this?
CC @bradleyayers who I believe has used a similar approach to generate https://www.npmjs.com/package/atlassian-prosemirror-type-definitions . Is that code open somewhere?
We used https://github.com/bradleyayers/getdocs2ts initially, and it was okay, but eventually switched to manually curating them to because TypeScript can be more expressive than docs (e.g. generic type variables).
@RatoX in your types
nullshould be included when translating?foo, i.e.?foo -> foo | null | undefinedPull request closed