From 1d47a3a45bc08c008462ab9321f62e4e76d4dc29 Mon Sep 17 00:00:00 2001 From: Josh Kramer Date: Sat, 15 Oct 2022 09:45:39 -0400 Subject: [PATCH 1/2] Separate arbitrary intrinsic element definition --- packages/astro/astro-jsx.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/astro/astro-jsx.d.ts b/packages/astro/astro-jsx.d.ts index 893b92b2f78a..2ee5d3573178 100644 --- a/packages/astro/astro-jsx.d.ts +++ b/packages/astro/astro-jsx.d.ts @@ -1288,7 +1288,7 @@ declare namespace astroHTML.JSX { zoomAndPan?: string | undefined | null; } - interface IntrinsicElements { + interface DefinedIntrinsicElements { // HTML a: AnchorHTMLAttributes; abbr: HTMLAttributes; @@ -1461,8 +1461,10 @@ declare namespace astroHTML.JSX { tspan: SVGAttributes; use: SVGAttributes; view: SVGAttributes; + } - // Allow for arbitrary elements - [name: string]: { [name: string]: any }; + interface IntrinsicElements extends DefinedIntrinsicElements { + // Allow for arbitrary elements + [name: string]: { [name: string]: any }; } } From 9a692da6eb69d78e80f53f75f22ae845ae5f4cf4 Mon Sep 17 00:00:00 2001 From: Josh Kramer Date: Sat, 15 Oct 2022 10:05:33 -0400 Subject: [PATCH 2/2] Create changeset --- .changeset/little-dodos-beam.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/little-dodos-beam.md diff --git a/.changeset/little-dodos-beam.md b/.changeset/little-dodos-beam.md new file mode 100644 index 000000000000..09bd0d7cff71 --- /dev/null +++ b/.changeset/little-dodos-beam.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Separate type definitions for built-in HTML elements and custom elements. Helpful when implementing an "as" prop similar to [styled-components](https://styled-components.com/docs/api#as-polymorphic-prop).