-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
🔎 Search Terms
jsdoc generics
🕗 Version & Regression Information
- This is a crash
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
No response
💻 Code
Given the following code:
function api<T>(endpoint: string): Promise<T> {
return fetch(endpoint).then(res => res.json());
}
When I consume the api
function in a .js
file, I'd still like to leverage the T
generic via JSDoc-only. There currently isnt a straightforward way to do this, and the DX of this could definitely be improved.
🙁 Actual behavior
Cant leverage the T
generic
🙂 Expected behavior
I can leverage the T
generic
Additional information about the issue
This is a long overdue feature :)
bivens-dev, KonnorRogers, trystan2k, TimvdLippe, jrunning and 18 more
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript