From 0d61b429ecf63591d31e09702058fa4c7132e1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= Date: Fri, 8 Dec 2023 22:16:25 +0800 Subject: [PATCH] fix(types): add `xmlns:xlink` to `SVGAttributes` (#9300) close #9299 --- packages/dts-test/tsx.test-d.tsx | 8 ++++++++ packages/runtime-dom/src/jsx.ts | 1 + packages/shared/src/domAttrConfig.ts | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/dts-test/tsx.test-d.tsx b/packages/dts-test/tsx.test-d.tsx index 4b4a0dbf9df..5e171e1f75f 100644 --- a/packages/dts-test/tsx.test-d.tsx +++ b/packages/dts-test/tsx.test-d.tsx @@ -112,3 +112,11 @@ expectType( ) // @ts-expect-error ; + +// svg +expectType( + +) diff --git a/packages/runtime-dom/src/jsx.ts b/packages/runtime-dom/src/jsx.ts index dfa4fc561c6..b83f13e7098 100644 --- a/packages/runtime-dom/src/jsx.ts +++ b/packages/runtime-dom/src/jsx.ts @@ -1077,6 +1077,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers { xlinkTitle?: string xlinkType?: string xmlns?: string + xmlnsXlink?: string y1?: Numberish y2?: Numberish y?: Numberish diff --git a/packages/shared/src/domAttrConfig.ts b/packages/shared/src/domAttrConfig.ts index 5f7f851b0df..9a0f88b94de 100644 --- a/packages/shared/src/domAttrConfig.ts +++ b/packages/shared/src/domAttrConfig.ts @@ -118,6 +118,6 @@ export const isKnownSvgAttr = /*#__PURE__*/ makeMap( `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` + `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` + `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` + - `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` + + `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,` + `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` )