We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
javascript jsdoc dts overload
https://www.typescriptlang.org/play/?ts=5.6.2&filetype=js#code/PQKhFgCgAIWgBALgUwLYAcA2BDF0DeAzogE4CWAdgOYC+0AopmshYlLAgPYBuyJmnbABN2ceOmwlsqAo2as6yJqhZsYYkskQBXEhUIEAFAEpoAXgB80bpzJCao4FCigI6hCgw48+AEadOJmwKOjkVVlEuXn5BEXdxSWlZZVVFFIj4zR09A3wTcysbOwd1J0gXMEj4Hj4BYSqJKRl8Cm1UXz40+TUOeCzdfSNTS2tbe0dnSFcGxObggE8u8J6QMuQAD3ROEkRoADNtCgBjRDJOCmhzwyVu03woAEh+vWh8kfwSkqA
/** * @template {string} Element * @overload * @param {Element} element * @returns {() => void} */ /** * @template {boolean} Element * @overload * @param {Element} element * @returns {() => void} */ /** * @overload * @param {number} element * @returns {() => void} */ /** * @param {any} element */ export function on(element) { return () => {} }
The resulting dts of the given JSDoc looks like this:
export function on<Element extends string>(element: Element): () => void; export function on<Element extends string>(element: Element): () => void; export function on(element: number): () => void;
As you can see the generic does extends string both times, but it should be extends boolean the second time
extends string
extends boolean
export function on<Element extends string>(element: Element): () => void; export function on<Element extends boolean>(element: Element): () => void; export function on(element: number): () => void;
No response
The text was updated successfully, but these errors were encountered:
Add overloads to correct place, put it into dts for now because of miβ¦
c3d4590
β¦crosoft/TypeScript#59980
fix: add document and window to svelte/events on types. (#13260)
6ed45db
fixes #13259 fixes #12665 put it into dts for now because of microsoft/TypeScript#59980 --------- Co-authored-by: Simon Holthausen <[email protected]>
@template
@overload
Successfully merging a pull request may close this issue.
π Search Terms
javascript jsdoc dts overload
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.6.2&filetype=js#code/PQKhFgCgAIWgBALgUwLYAcA2BDF0DeAzogE4CWAdgOYC+0AopmshYlLAgPYBuyJmnbABN2ceOmwlsqAo2as6yJqhZsYYkskQBXEhUIEAFAEpoAXgB80bpzJCao4FCigI6hCgw48+AEadOJmwKOjkVVlEuXn5BEXdxSWlZZVVFFIj4zR09A3wTcysbOwd1J0gXMEj4Hj4BYSqJKRl8Cm1UXz40+TUOeCzdfSNTS2tbe0dnSFcGxObggE8u8J6QMuQAD3ROEkRoADNtCgBjRDJOCmhzwyVu03woAEh+vWh8kfwSkqA
π» Code
π Actual behavior
The resulting dts of the given JSDoc looks like this:
As you can see the generic does
extends string
both times, but it should beextends boolean
the second timeπ Expected behavior
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: