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:
parent
66e8ae3bee
commit
f684e9d361
2 changed files with 10 additions and 3 deletions
5
.changeset/little-dodos-beam.md
Normal file
5
.changeset/little-dodos-beam.md
Normal 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).
|
8
packages/astro/astro-jsx.d.ts
vendored
8
packages/astro/astro-jsx.d.ts
vendored
|
@ -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,8 +1461,10 @@ declare namespace astroHTML.JSX {
|
||||||
tspan: SVGAttributes;
|
tspan: SVGAttributes;
|
||||||
use: SVGAttributes;
|
use: SVGAttributes;
|
||||||
view: SVGAttributes;
|
view: SVGAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
// Allow for arbitrary elements
|
interface IntrinsicElements extends DefinedIntrinsicElements {
|
||||||
[name: string]: { [name: string]: any };
|
// Allow for arbitrary elements
|
||||||
|
[name: string]: { [name: string]: any };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue