Title: Flatten Function Parameters and remember param names? · Issue #35752 · microsoft/TypeScript · GitHub
Open Graph Title: Flatten Function Parameters and remember param names? · Issue #35752 · microsoft/TypeScript
X Title: Flatten Function Parameters and remember param names? · Issue #35752 · microsoft/TypeScript
Description: I would like to create new tuple of function params A and B.. that means flatten together two function params. I have the flatten type for that. For sake of simplicity showing only with one Parameters not two below. But problem is that T...
Open Graph Description: I would like to create new tuple of function params A and B.. that means flatten together two function params. I have the flatten type for that. For sake of simplicity showing only with one Paramet...
X Description: I would like to create new tuple of function params A and B.. that means flatten together two function params. I have the flatten type for that. For sake of simplicity showing only with one Paramet...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/35752
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Flatten Function Parameters and remember param names?","articleBody":"I would like to create new tuple of function params A and B.. that means flatten together two function params. I have the flatten type for that. For sake of simplicity showing only with one Parameters not two below.\r\n\r\nBut problem is that Typescript then forgets the parameter names, would it be possible to fix it somehow? Neither is possible to extract the params names from Parameters\u003c\u003e helper. (just saying another not related problem)\r\n\r\n```\r\ntype Flatten\u003cT extends E[], E extends any[] = any[]\u003e = {\r\n [K in keyof T]: T[K][Exclude\u003ckeyof T[K], keyof any[]\u003e]\r\n}\r\n\r\nconst a = (x: string) =\u003e { }\r\n\r\nconst c = (...args: Parameters\u003ctypeof a\u003e) { }\r\nconst d = (...args: Flatten\u003c[Parameters\u003ctypeof a\u003e]) { } // later here can be Flatten\u003c[Tuple1, Tuple2]\u003e only one for now.\r\n\r\nc() // arguments are: x:string\r\nd() // argumentes are: args_0:string\r\n\r\nBest would be something like this\r\n\r\nconst e = (...args: [...Parameters\u003ctypeof a\u003e]) { }\r\n\r\n```\r\nhttps://www.typescriptlang.org/play/?ssl=1\u0026ssc=1\u0026pln=11\u0026pc=4#code/C4TwDgpgBAYgNgQ2MCA7APAFShAHi1AEwGcoBRAbQF0AacnfNEqBVEaqAXhbeoD4uUAN4AoKFAoBpKAEtUUANYQQAewBmUTFQBcmqVQplcAYzgBXQhHRLVGzPro31PdlT5URAXxEjjK1MTALIIAFLi6gQBOcgDmAJRcAkJQ3r7+gVDGoQB0uQiRMcS6AAr5CAC2ECiRxOigkM4IfAnJ3n4BQYQ5eQVFsIjIaOgUpZEVVRA1deAQje4tKT7GIXEihCtAA","author":{"url":"https://github.com/luky1984","@type":"Person","name":"luky1984"},"datePublished":"2019-12-18T14:03:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/35752/TypeScript/issues/35752"}
| 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:9f332380-775c-ae22-aac7-dc30aa16e951 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D402:183EB6:BA66EF:10222C9:6A61A206 |
| html-safe-nonce | e08f7f835372c6ab2177d8dda20804d41427df45bcd7a0717831a1260a54676d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDAyOjE4M0VCNjpCQTY2RUY6MTAyMjJDOTo2QTYxQTIwNiIsInZpc2l0b3JfaWQiOiIyNzg3ODAzNTk1MDQ3ODA1NDQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 449e68fe538578db1a803fda7151efb5c27edb63370e4285967cbd8bebd97307 |
| hovercard-subject-tag | issue:539700816 |
| 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/35752/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d4a7384e76c494da3ab738e1edacf8dd1ae882b8d45d3455e2f72f744bb80dd0/microsoft/TypeScript/issues/35752 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d4a7384e76c494da3ab738e1edacf8dd1ae882b8d45d3455e2f72f744bb80dd0/microsoft/TypeScript/issues/35752 |
| og:image:alt | I would like to create new tuple of function params A and B.. that means flatten together two function params. I have the flatten type for that. For sake of simplicity showing only with one Paramet... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | luky1984 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9 |
| 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 | ac296ae7f21856f1f92adbad22f870b6fbb4b907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width