0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

Implicit element types (#5098)

* Separate arbitrary intrinsic element definition

* Create changeset
This commit is contained in:
Josh Kramer 2022-10-18 09:23:48 -04:00 committed by GitHub
parent 66e8ae3bee
commit f684e9d361
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -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).

View file

@ -1288,7 +1288,7 @@ declare namespace astroHTML.JSX {
zoomAndPan?: string | undefined | null; zoomAndPan?: string | undefined | null;
} }
interface IntrinsicElements { interface DefinedIntrinsicElements {
// HTML // HTML
a: AnchorHTMLAttributes; a: AnchorHTMLAttributes;
abbr: HTMLAttributes; abbr: HTMLAttributes;
@ -1461,7 +1461,9 @@ declare namespace astroHTML.JSX {
tspan: SVGAttributes; tspan: SVGAttributes;
use: SVGAttributes; use: SVGAttributes;
view: SVGAttributes; view: SVGAttributes;
}
interface IntrinsicElements extends DefinedIntrinsicElements {
// Allow for arbitrary elements // Allow for arbitrary elements
[name: string]: { [name: string]: any }; [name: string]: { [name: string]: any };
} }