Title: allow type parameters on type arguments · Issue #5959 · microsoft/TypeScript · GitHub
Open Graph Title: allow type parameters on type arguments · Issue #5959 · microsoft/TypeScript
X Title: allow type parameters on type arguments · Issue #5959 · microsoft/TypeScript
Description: interface Map { [key: string]: a; } // IMPORTANT: here my intention is that the `read` and `run` methods are agreed on using the same type parameter interface Command
Open Graph Description: interface Map { [key: string]: a; } // IMPORTANT: here my intention is that the `read` and `run` methods are agreed on using the same type parameter interface Command
X Description: interface Map<a> { [key: string]: a; } // IMPORTANT: here my intention is that the `read` and `run` methods are agreed on using the same type parameter interface Command<Options> { read...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/5959
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"allow type parameters on type arguments","articleBody":"``` typescript\ninterface Map\u003ca\u003e {\n [key: string]: a;\n}\n\n// IMPORTANT: here my intention is that the `read` and `run` methods are agreed on using the same type parameter\ninterface Command\u003cOptions\u003e {\n read(args: string[]): Options;\n run(options: Options): void;\n};\n\ninterface CopyCommandOptions {\n from: string;\n to: string;\n}\n\ninterface CleanCommandOptions {\n directory: string;\n pattern: string;\n}\n\n\n// currently in TypeScript there are 2 options to to declare `knownCommands` below:\n// - Map\u003cCommand\u003cany\u003e\u003e which contaminates my code with `any`\n// - Map\u003cCommand\u003cCopyCommandOptions | CleanCommandOptions\u003e\u003e which has different semantics\n// ideally I wish I could declare it like this:\nlet knownCommands : Map\u003c\u003ca\u003eCommand\u003ca\u003e\u003e = { // \u003c-- hypothetical syntax\n 'copy': \u003cCommand\u003cCopyCommandOptions\u003e\u003e undefined,\n 'clean': \u003cCommand\u003cCleanCommandOptions\u003e\u003e undefined\n};\n\n// so that later I could the following do in a type safe manner:\nlet command = knownCommands[name];\ncommand.run(command.read(args));\n```\n","author":{"url":"https://github.com/zpdDG4gta8XKpMCd","@type":"Person","name":"zpdDG4gta8XKpMCd"},"datePublished":"2015-12-06T19:25:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/5959/TypeScript/issues/5959"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9b280e75-6722-819a-d94a-98ffa664c568 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7F2:92FE:1DFE1F:298D7E:6A626739 |
| html-safe-nonce | 81ab1560643f75ac751c0738cd2956fcddc4f5d56e4744d58c3e53980f1c14c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0YyOjkyRkU6MURGRTFGOjI5OEQ3RTo2QTYyNjczOSIsInZpc2l0b3JfaWQiOiI3NzM5ODU0OTU2OTU1NTkyNTA1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f6b75ed37144f627ef7ffb550b541529b95aa5a1e9d804d9fb9aa2749bce9e95 |
| hovercard-subject-tag | issue:120653732 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/5959/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e680c8b484b13b45f658963b05e260dfdf343eee4eeb66ac111d9839b970d8e1/microsoft/TypeScript/issues/5959 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e680c8b484b13b45f658963b05e260dfdf343eee4eeb66ac111d9839b970d8e1/microsoft/TypeScript/issues/5959 |
| og:image:alt | interface Map { [key: string]: a; } // IMPORTANT: here my intention is that the `read` and `run` methods are agreed on using the same type parameter interface Command |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zpdDG4gta8XKpMCd |
| hostname | github.com |
| expected-hostname | github.com |
| None | 194bddaed53c0eb07047629c520853f4208e77a17ff57428346485cc202e39f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c2862cf2db52f0c7f6cba3de21ffeeafe7c5456e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width