Skip to content
Discussion options

You must be logged in to vote

JS Doc has various variants so it depends what's the purpose of this documentation. For example, TypeScript supports the @overload tags for multiple signatures: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#overload-support-in-jsdoc.

If you use TypeScript as a language and just want to use JSDoc for documentation, you can define multiple signature types and a proper JS Doc comment above them, as is done e.g. in DefinitelyTyped; see the .on() method: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/108e356f1a990ac7a2416a9790ff8bdcd4919d30/types/jquery/JQuery.d.ts#L7875-L8371.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gfucci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants