René's URL Explorer Experiment


Title: Allow to explicitly pass type parameters via JSDoc · Issue #27387 · microsoft/TypeScript · GitHub

Open Graph Title: Allow to explicitly pass type parameters via JSDoc · Issue #27387 · microsoft/TypeScript

X Title: Allow to explicitly pass type parameters via JSDoc · Issue #27387 · microsoft/TypeScript

Description: Search Terms jsdoc generics type parameters constraints Suggestion It seems like it is not possible via JSDoc to explicitly tell compiler which type parameters to pass to a generic function. Use Cases In TypeScript it is possible to expl...

Open Graph Description: Search Terms jsdoc generics type parameters constraints Suggestion It seems like it is not possible via JSDoc to explicitly tell compiler which type parameters to pass to a generic function. Use Ca...

X Description: Search Terms jsdoc generics type parameters constraints Suggestion It seems like it is not possible via JSDoc to explicitly tell compiler which type parameters to pass to a generic function. Use Ca...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/27387

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow to explicitly pass type parameters via JSDoc","articleBody":"## Search Terms\r\n\r\njsdoc generics type parameters constraints\r\n\r\n## Suggestion\r\n\r\nIt seems like it is not possible via JSDoc to explicitly tell compiler which type parameters to pass to a generic function.\r\n\r\n## Use Cases\r\n\r\nIn TypeScript it is possible to explicitly pass type parameters such as `mongoose.model\u003cModel, Schema>('modelName', Schema)` while I could not find a way to do same with JSDoc.\r\n\r\n## Examples\r\n\r\n`mongoose.model` has two signatures, first one with one type parameter and the other with two. To make use of the second signature we must pass types explicitly.\r\n\r\n```ts\r\nexport function model\u003cT extends Document>(\r\n  name: string,\r\n  schema?: Schema,\r\n  collection?: string,\r\n  skipInit?: boolean\r\n): Model\u003cT>;\r\n\r\nexport function model\u003cT extends Document, U extends Model\u003cT>>(\r\n  name: string,\r\n  schema?: Schema,\r\n  collection?: string,\r\n  skipInit?: boolean\r\n): U;\r\n```\r\n```ts\r\n//  Choose second signature in typescript.\r\nconst model = mongoose.model\u003cModel, Schema>('modelName', Schema);\r\n\r\n// With JSDoc, compiler always chooses first signature and we receive a type mismatch error.\r\n/** @type {Schema & mongoose.Model\u003cModel>} */\r\nconst model = mongoose.model('modelName', Schema);\r\n\r\n// But something like this would be great.\r\nconst model = mongoose.model/**\u003cModel, Schema>*/('modelName', Schema);\r\n```\r\n\r\nMy apologies if this is already possible, but I've spend almost a week battling this.\r\n\r\nRelated: https://github.com/Microsoft/TypeScript-Node-Starter/issues/101\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n* [x] This wouldn't be a breaking change in existing TypeScript / JavaScript code\r\n* [x] This wouldn't change the runtime behavior of existing JavaScript code\r\n* [x] This could be implemented without emitting different JS based on the types of the expressions\r\n* [x] This isn't a runtime feature (e.g. new expression-level syntax)\r\n\r\n","author":{"url":"https://github.com/ifeltsweet","@type":"Person","name":"ifeltsweet"},"datePublished":"2018-09-27T12:37:45Z","url":"https://github.com/microsoft/TypeScript/issues/27387"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e63f927f-7eb0-3cf0-232c-467c5eb901ab
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEA3C:B53AF:25199AB:316599B:6B019EA7
html-safe-nonce6a1fa3cf91ebc25cdd1a2d25c48fe71a26041887614c3b3c9cacbd480e024a4f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTNDOkI1M0FGOjI1MTk5QUI6MzE2NTk5Qjo2QjAxOUVBNyIsInZpc2l0b3JfaWQiOiI0NDY3ODIyOTMzODQyMTczNjA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac5497167e74231a26b92499913db19ca7bfb9f36e0892da41995f31d5f24b6007
hovercard-subject-tagissue:364455262
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/27387/issue_layout
twitter:imagehttps://opengraph.githubassets.com/604c72bccf9c54e476947bc5e7c6bcf2f7b95745c21f1f65e922bc3496e4029c/microsoft/TypeScript/issues/27387
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/604c72bccf9c54e476947bc5e7c6bcf2f7b95745c21f1f65e922bc3496e4029c/microsoft/TypeScript/issues/27387
og:image:altSearch Terms jsdoc generics type parameters constraints Suggestion It seems like it is not possible via JSDoc to explicitly tell compiler which type parameters to pass to a generic function. Use Ca...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameifeltsweet
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/27387#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F27387
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F27387
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/27387
Reloadhttps://github.com/microsoft/TypeScript/issues/27387
Reloadhttps://github.com/microsoft/TypeScript/issues/27387
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27387
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27387
Allow to explicitly pass type parameters via JSDochttps://github.com/microsoft/TypeScript/issues/27387#top
Domain: JSDocRelates to JSDoc parsing and type generationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JSDoc%22
Domain: JavaScriptThe issue relates to JavaScript specificallyhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JavaScript%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
checkJsRelates to checking JavaScript using TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22checkJs%22
https://github.com/ifeltsweet
Denis Pshenov (ifeltsweet)https://github.com/ifeltsweet
on Sep 27, 2018https://github.com/microsoft/TypeScript/issues/27387#issue-364455262
https://github.com/Microsoft/TypeScript-Node-Starter/issues/101https://github.com/Microsoft/TypeScript-Node-Starter/issues/101
Nexthttps://github.com/microsoft/TypeScript/issues/27387?timeline_page=1
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Sep 27, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1871528196
Domain: JavaScriptThe issue relates to JavaScript specificallyhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JavaScript%22
on Sep 27, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1871528306
Salsahttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Salsa%22
on Sep 27, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1871528424
Domain: JSDocRelates to JSDoc parsing and type generationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JSDoc%22
on Sep 27, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1871528539
checkJsRelates to checking JavaScript using TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22checkJs%22
on Sep 27, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1871528843
Wesley Wigham (weswigham)https://github.com/weswigham
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Nov 6, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1950165839
Wesley Wigham (weswigham)https://github.com/weswigham
Domain: JavaScriptThe issue relates to JavaScript specificallyhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JavaScript%22
Domain: JavaScriptThe issue relates to JavaScript specificallyhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JavaScript%22
Salsahttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Salsa%22
on Nov 29, 2018https://github.com/microsoft/TypeScript/issues/27387#event-1994427582
https://github.com/Stuk
Stuart Knightley (Stuk)https://github.com/Stuk
on Mar 12, 2019https://github.com/microsoft/TypeScript/issues/27387#issuecomment-471799034
https://github.com/ekulabuhov
Eugene Kulabuhov (ekulabuhov)https://github.com/ekulabuhov
on Nov 7, 2019https://github.com/microsoft/TypeScript/issues/27387#issuecomment-551134732
https://github.com/pm0u
Paul Mourer (pm0u)https://github.com/pm0u
on May 1, 2020https://github.com/microsoft/TypeScript/issues/27387#issuecomment-622256812
https://github.com/robertknight
Robert Knight (robertknight)https://github.com/robertknight
on Jul 16, 2020https://github.com/microsoft/TypeScript/issues/27387#issuecomment-659671940
https://github.com/noinkling
Malcolm (noinkling)https://github.com/noinkling
on Oct 18, 2023https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1767982954
Pascal Schilp (@thepassle)https://github.com/thepassle
#27387 (comment)https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1223795056
https://github.com/thepassle
Pascal Schilp (thepassle)https://github.com/thepassle
on Oct 18, 2023https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1768001818
https://github.com/mhofman
Mathieu Hofman (mhofman)https://github.com/mhofman
on Oct 18, 2023https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1768370281
Malcolm (@noinkling)https://github.com/noinkling
https://github.com/noinkling
Malcolm (noinkling)https://github.com/noinkling
on Oct 19, 2023https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1769762453
Malcolm (@noinkling)https://github.com/noinkling
https://github.com/gustavopch
Gustavo (gustavopch)https://github.com/gustavopch
on Oct 19, 2023https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1770736788
https://github.com/noinkling
Malcolm (noinkling)https://github.com/noinkling
on Oct 19, 2023https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1770911354
Gustavo (@gustavopch)https://github.com/gustavopch
https://github.com/phaux
Niki (phaux)https://github.com/phaux
on Feb 4, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1925609832
https://github.com/noinkling
Malcolm (noinkling)https://github.com/noinkling
on Feb 4, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1925614597
Niki (@phaux)https://github.com/phaux
#51694https://github.com/microsoft/TypeScript/issues/51694
https://github.com/apendua
Tomasz Lenarcik (apendua)https://github.com/apendua
on Aug 4, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-2267694194
Nathan Shively-Sanders (@sandersn)https://github.com/sandersn
https://github.com/sandersn
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
on Aug 7, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-2273842157
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
https://github.com/apendua
Tomasz Lenarcik (apendua)https://github.com/apendua
on Aug 17, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-2294624208
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Aug 19, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-2297271237
https://www.typescriptlang.org/play/?filetype=js#code/PQKhFgCgAIWgBALgUwLYAcA2BDF0AqUsC62ATtqtAB7QDe+AvkSMFAGYCuAdgMaIBLAPbdo7ABTUAlPSLR5ZZIk5lR1ANxRmkKJiXQhAIwBW0ALyyY86KAhXrcJGiy5kBOQ5LlKNekw-yrAES0pbW4dCKyqo0mvbQ2oxxuvoA5uY2YAiIAJ7obnS5+ULsYgA8AM6IZALcqQB8jLDA0OLsUnHALdAAegD8UCmIBiYA4hnittl5BUXIJSPGAHTsldW1DU2srUbL7VJLhrUAJuK7HVBd8v1AAhttps://www.typescriptlang.org/play/?filetype=js#code/PQKhFgCgAIWgBALgUwLYAcA2BDF0AqUsC62ATtqtAB7QDe+AvkSMFAGYCuAdgMaIBLAPbdo7ABTUAlPSLR5ZZIk5lR1ANxRmkKJiXQhAIwBW0ALyyY86KAhXrcJGiy5kBOQ5LlKNekw-yrAES0pbW4dCKyqo0mvbQ2oxxuvoA5uY2YAiIAJ7obnS5+ULsYgA8AM6IZALcqQB8jLDA0OLsUnHALdAAegD8UCmIBiYA4hnittl5BUXIJSPGAHTsldW1DU2srUbL7VJLhrUAJuK7HVBd8v1AA
#27387 (comment)https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1925609832
https://github.com/apendua
Tomasz Lenarcik (apendua)https://github.com/apendua
on Aug 22, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-2303886857
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
#27387 (comment)https://github.com/microsoft/TypeScript/issues/27387#issuecomment-1925609832
#51694https://github.com/microsoft/TypeScript/issues/51694
#51695https://github.com/microsoft/TypeScript/pull/51695
https://github.com/tif-calin
Culi T (tif-calin)https://github.com/tif-calin
on Oct 14, 2024https://github.com/microsoft/TypeScript/issues/27387#issuecomment-2409880480
Niki (@phaux)https://github.com/phaux
Petra Jaros (Peeja)https://github.com/Peeja
on Jan 15, 2025https://github.com/microsoft/TypeScript/issues/27387#event-15942155734
Tweaks to work better in practice with `freeway`https://github.com/storacha/gateway-lib/commit/b6565d01986b59ba09e1a9c0193c85d8d64f2092
b6565d0https://github.com/storacha/gateway-lib/commit/b6565d01986b59ba09e1a9c0193c85d8d64f2092
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/27387
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/27387
Domain: JSDocRelates to JSDoc parsing and type generationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JSDoc%22
Domain: JavaScriptThe issue relates to JavaScript specificallyhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20JavaScript%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
checkJsRelates to checking JavaScript using TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22checkJs%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.