summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/little-dodos-beam.md5
-rw-r--r--packages/astro/astro-jsx.d.ts8
2 files changed, 10 insertions, 3 deletions
diff --git a/.changeset/little-dodos-beam.md b/.changeset/little-dodos-beam.md
new file mode 100644
index 000000000..09bd0d7cf
--- /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).
diff --git a/packages/astro/astro-jsx.d.ts b/packages/astro/astro-jsx.d.ts
index aa7c0a573..a750c29f2 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 };
}
}