denoland / docland

The documentation generation website for Deno
https://doc.deno.land
MIT License
122 stars 29 forks source link

Expand typed rest parameters in call signatures #120

Open KyleJune opened 2 years ago

KyleJune commented 2 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters

I have multiple functions in the same file that share the same call signatures. I created an alias type for the call signatures to avoid repeating myself and reduce the odds of missing a place to update. In vscode, the hint for how to call the function shows all 13 call signatures for the function. I would expect the same behavior in the deno docs. Currently the deno docs just show the rest parameter not expanded.

image

https://doc.deno.land/https://deno.land/x/test_suite@0.13.0/mod.ts/~/it image

Here is a link to the ItArgs<T> type.

kitsonk commented 2 years ago

Try exporting the ItArgs. It will allow the doc generator to link to it.

KyleJune commented 2 years ago

I just tried that now. It still shows the same but links to the type for ItArgs. I originally didn't export it because I didn't want to add an export for a type that is only used internally. vs code is able to figure out what the call signatures are without exporting the ItArgs type.

https://doc.deno.land/https://raw.githubusercontent.com/udibo/test_suite/dev/mod.ts/~/it