-
Notifications
You must be signed in to change notification settings - Fork 1.3k
RFC: generated API docs from typescript declarations #2548
Comments
This is very exciting to hear! I understand from @raulk that the libp2p team is similarly interested in adding declarations files to individual repos, which would likely make the efforts on js-ipfs much easier. I'm not sure what the timeline is for libp2p projects though? We've used typedoc before (see https://textileio.github.io/js-textile-wallet/ for example) and quite liked it. |
I have been trying to push this for a long time, nice to know we are open to this now. Happy to make this happen huge improvement to DX |
I'm somewhat disappointed with typedoc... I added type definitions to When the "Only Exported" checkbox is checked the list on the right is incorrect. Where's my I also have a function called For reference, my setup: alanshaw/abortable-iterator#2 |
Why do you export source as default again? i stopped using default exports a long time ago it only gives you problems esm or no esm. https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module/ Below is a preview for the latest ipfsd-ctl api docs in markdown (still WIP) Table of Contents
createCreate a Factory Parameters
Returns FactoryDaemon createNodeCreate a node Parameters
Returns Promise<Daemon> createNodeTestsCreate a node for tests Parameters
Returns Promise<Daemon> createTestsInterfaceCreate a interface for tests setup Parameters
Returns TestsInterface createServerCreate a Endpoint Server Parameters
Returns Server TestsInterfaceCreateNodeType: Function Parameters
Returns Promise<Daemon> Returns a IPFSd-ctl Daemon TestsInterfaceSetupType: Function Parameters
Returns Promise<IpfsClient> Returns an IPFS core API TestsInterfaceTeardownType: Function Returns Promise<void> TestsInterfaceType: object Properties
IpfsOptionsSame as https://github.com/ipfs/js-ipfs/blob/master/README.md#ipfs-constructor Type: Object Properties
FactoryOptionsType: Object Properties
|
new iteration in html using typedoc and autogenerated type defs all from vanilla js with jsdoc |
Wouldn't it be just simpler to migrate everything to TypeScript? Since it's literally just JavaScript with types, you can convert the whole project without changing a thing at first and just add actual types gradually. |
where are the typescript file at? i didn't see it in this repo |
js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and read the migration guide. Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterwards (see #4336). This should be fixed in Helia since it's written in typescript. I believe libp2p is in the process of being updated to typescript as well. |
I had an idea in #651 (comment) that we could add typescript declarations (i.e. not convert the project to typescript just a type delcarations file
types.d.ts
with typings information) and generate our documentation from them. It would give us incentive to keep them up to date and make js-ipfs more friendly to our community of typescript users!The docs would be decoupled from the actual code but we already have that problem.
Maybe use http://typedoc.org/?
@carsonfarmer might have some ideas if this is possible and might want to be the one to PR the declarations 😝
refs #1166
refs #2320
The text was updated successfully, but these errors were encountered: