Title: Update Pick to use new key remapping in mapped types · Issue #41383 · microsoft/TypeScript · GitHub
Open Graph Title: Update Pick to use new key remapping in mapped types · Issue #41383 · microsoft/TypeScript
X Title: Update Pick to use new key remapping in mapped types · Issue #41383 · microsoft/TypeScript
Description: Search Terms pick omit key remapping Suggestion Update Pick in lib.d.ts to be: type Pick ]: T[P]; }; It is currently defined as: type Pick
Open Graph Description: Search Terms pick omit key remapping Suggestion Update Pick in lib.d.ts to be: type Pick ]: T[P]; }; It is currently defined as: type Pick X Description: Search Terms pick omit key remapping Suggestion Update Pick in lib.d.ts to be: type Pick<T, K extends keyof T> = { [P in keyof T as Extract<P, K>]: T[P]; }; It is currently defined as: ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/41383
X: @github
Domain: github.com
]: T[P]; }; It is currently defined as: type Pick Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update Pick to use new key remapping in mapped types","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ, especially the \"Common Feature Requests\" section: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\n-->\r\n\r\n## Search Terms\r\n\r\npick omit key remapping\r\n\r\n## Suggestion\r\n\r\nUpdate `Pick` in `lib.d.ts` to be:\r\n```ts\r\ntype Pick\u003cT, K extends keyof T> = {\r\n [P in keyof T as Extract\u003cP, K>]: T[P];\r\n};\r\n```\r\n\r\nIt is currently defined as:\r\n```ts\r\ntype Pick\u003cT, K extends keyof T> = {\r\n [P in K]: T[P];\r\n};\r\n```\r\n\r\n## Use Cases\r\n\r\nWith this new definition, typescript can statically analyze the keys, which allows interfaces to extends these types.\r\n\r\n## Examples\r\n\r\n```ts\r\ninterface Base {\r\n a: number,\r\n b: string,\r\n c: boolean,\r\n}\r\n\r\n// Errors: \"An interface can only extend an object type or intersection of object types with statically known members\"\r\ninterface PickBase0\u003cK extends keyof Base> extends Pick\u003cBase, K> {\r\n pickedKeys: K\r\n}\r\n\r\ntype Pick1\u003cT, K extends keyof T> = { [L in keyof T as Extract\u003cL, K>]: T[L] }\r\n\r\n// Works\r\ninterface PickBase1\u003cK extends keyof Base> extends Pick1\u003cBase, K> {\r\n pickedKeys: K\r\n}\r\n```\r\n[Playground Link](https://www.typescriptlang.org/play?ts=next#code/FASwdgLgpgTgZgQwMZQAQCEEGc0G9iqGoIBcqYArgLYBGsANAUTWVhDOAOaNGpJk0A9oIA2UBGEYBfYMAD0c1AFEYMQTCwBuYmFTho8ZGiQTUgsCICeqKAA9oYACY6zNAFZQkEVBEsAHNHU9SFgcLxBzMzhXDy8ffygsVAB3EAgAC1Q2BAgQExErVABrMEFk3SooWlDQEMMUVAAFPKLMHAAGAB4AaRt7KCckoqhLQWi2qAA+PodHJOakIs6J+lRu6fxePxaoR26RrDJu4BlgXwCmloBGToAVVd67WaGRsdRb6YBeVFxUAG0ADLBYqvaK3YhJJT2GDICCdAEPSYAXTIt0BSNQpwUqAA6uoilhagZEA0Fq1sFAbo9+oMQaNxhTpk8BnNLosbis1hsmIRtotdvtLIc1idgEA)\r\n\r\n## Checklist\r\n\r\nMy suggestion meets these guidelines:\r\n\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. library functionality, non-ECMAScript syntax with JavaScript output, etc.)\r\n* [X] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).\r\n","author":{"url":"https://github.com/tjjfvi","@type":"Person","name":"tjjfvi"},"datePublished":"2020-11-03T17:42:37Z","url":"https://github.com/microsoft/TypeScript/issues/41383"}
react-profiling 0 react-import-map react,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-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:5961f74a-aec7-62cc-3f8b-4dfd1c169171 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id AF82:33D24F:292D99B:34E09DA:6B01B042 html-safe-nonce 752b170878573dfa1b918f4148c7bfb88c2302a0fecf45300006a44d5e4c1052 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjgyOjMzRDI0RjoyOTJEOTlCOjM0RTA5REE6NkIwMUIwNDIiLCJ2aXNpdG9yX2lkIjoiNzYzMDA5Njc2Mjc3NDA3MzQxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 visitor-hmac e5f1993ecd665e2fa9d0bf944657f63e53d8df699ea450054d48874083db07a2 hovercard-subject-tag issue:735517116 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/41383/issue_layout twitter:image https://opengraph.githubassets.com/4d8abe643ce03dd5073cc4488a4faa77e6bda4a7d5ae68ad012040806e804d38/microsoft/TypeScript/issues/41383 twitter:card summary_large_image og:image https://opengraph.githubassets.com/4d8abe643ce03dd5073cc4488a4faa77e6bda4a7d5ae68ad012040806e804d38/microsoft/TypeScript/issues/41383 og:image:alt Search Terms pick omit key remapping Suggestion Update Pick in lib.d.ts to be: type Pick og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username tjjfvi hostname github.com expected-hostname github.com None cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c 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 8c77c9e8439031ad54c75a250694842892f693e1 ui-target full theme-color #1e2327 color-scheme light dark react-app-name issues
URLs of crawlers that visited me.