Title: Unable to define SVG elements conflicting with HTML · Issue #20149 · microsoft/TypeScript · GitHub
Open Graph Title: Unable to define SVG elements conflicting with HTML · Issue #20149 · microsoft/TypeScript
X Title: Unable to define SVG elements conflicting with HTML · Issue #20149 · microsoft/TypeScript
Description: TypeScript Version: master Expected behavior: interface SVGElementTagNameMap { 'a': SVGAElement; } interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } But deriving from both HTMLElementTagNameMap and SVGEl...
Open Graph Description: TypeScript Version: master Expected behavior: interface SVGElementTagNameMap { 'a': SVGAElement; } interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } But deriving f...
X Description: TypeScript Version: master Expected behavior: interface SVGElementTagNameMap { 'a': SVGAElement; } interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } But de...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/20149
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to define SVG elements conflicting with HTML","articleBody":"**TypeScript Version:** master\r\n\r\n**Expected behavior:**\r\n\r\n```ts\r\ninterface SVGElementTagNameMap {\r\n 'a': SVGAElement;\r\n}\r\ninterface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap {\r\n}\r\n```\r\n\r\nBut deriving from both `HTMLElementTagNameMap` and `SVGElementTagNameMap` still throw an error by conflicts. To resolve this, `ElementTagNameMap` has to be defined using Diff type as follows.\r\n\r\n```ts\r\ninterface ElementTagNameMap extends HTMLElementTagNameMap, Diff\u003cSVGElementTagNameMap, HTMLElementTagNameMap> {\r\n}\r\n\r\ntype Diff\u003cT, U> = Pick\u003cT, DiffKey\u003ckeyof T, keyof U>>;\r\ntype DiffKey\u003cT extends string, U extends string> = (\r\n & { [P in T]: P; }\r\n & { [P in U]: never; }\r\n & { [x: string]: never; }\r\n)[T];\r\n```\r\n\r\nHowever, defining `ElementTagNameMap` is originally wrong. It should be removed later.\r\n\r\n**Actual behavior:**\r\n\r\n```ts\r\ninterface ElementTagNameMap {\r\n 'a': SVGAElement; // error, conflicts with 'a': HTMLAnchorElement;\r\n}\r\n```\r\n\r\nrelated: #20134, #14783","author":{"url":"https://github.com/falsandtru","@type":"Person","name":"falsandtru"},"datePublished":"2017-11-20T10:52:33Z","url":"https://github.com/microsoft/TypeScript/issues/20149"}
| 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:b4790ae0-630f-b116-5e5d-57465d87dcf9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AA0:3D8CBB:F66A9C:145FB72:6B01055D |
| html-safe-nonce | 76c34c9d3ea1f8401a0154dd9a537ee5777dd720fad6eaded668f444d81fd8fc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUEwOjNEOENCQjpGNjZBOUM6MTQ1RkI3Mjo2QjAxMDU1RCIsInZpc2l0b3JfaWQiOiIzNTgyNjQzODQwNzIyNDcwMjM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a7c4c91af1f18da95631d4e1936f48cc4a976b843b0e5f6385b7ec6c63711d5e |
| hovercard-subject-tag | issue:275312617 |
| 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/20149/issue_layout |
| twitter:image | https://opengraph.githubassets.com/22002c5834060780301f287f3d26b6d22ed88f6ee6d1e9cc9afbc8dbefb52a45/microsoft/TypeScript/issues/20149 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/22002c5834060780301f287f3d26b6d22ed88f6ee6d1e9cc9afbc8dbefb52a45/microsoft/TypeScript/issues/20149 |
| og:image:alt | TypeScript Version: master Expected behavior: interface SVGElementTagNameMap { 'a': SVGAElement; } interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } But deriving f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | falsandtru |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width