summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Erika <3019731+Princesseuh@users.noreply.github.com> 2023-12-06 13:09:30 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-06 13:09:30 +0100
commiteb942942d67508c07d7efaa859a7840f7c0223da (patch)
tree1a33762b9b530c2303de834164288440549daa54
parentc76901065545f6a8d3de3e44d1c8ee5456a8a77a (diff)
downloadastro-eb942942d67508c07d7efaa859a7840f7c0223da.tar.gz
astro-eb942942d67508c07d7efaa859a7840f7c0223da.tar.zst
astro-eb942942d67508c07d7efaa859a7840f7c0223da.zip
fix: add types for `is:inline` on slots (#9342)
-rw-r--r--.changeset/cold-toys-greet.md5
-rw-r--r--packages/astro/astro-jsx.d.ts3
-rw-r--r--packages/astro/src/@types/astro.ts4
3 files changed, 11 insertions, 1 deletions
diff --git a/.changeset/cold-toys-greet.md b/.changeset/cold-toys-greet.md
new file mode 100644
index 000000000..7923c5567
--- /dev/null
+++ b/.changeset/cold-toys-greet.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fix missing `is:inline` type for the `<slot />` element
diff --git a/packages/astro/astro-jsx.d.ts b/packages/astro/astro-jsx.d.ts
index 3e8a86889..3f73bcc61 100644
--- a/packages/astro/astro-jsx.d.ts
+++ b/packages/astro/astro-jsx.d.ts
@@ -36,6 +36,7 @@ declare namespace astroHTML.JSX {
AstroDefineVarsAttribute;
type AstroStyleAttributes = import('./dist/@types/astro.js').AstroStyleAttributes &
AstroDefineVarsAttribute;
+ type AstroSlotAttributes = import('./dist/@types/astro.js').AstroSlotAttributes;
// This is an unfortunate use of `any`, but unfortunately we can't make a type that works for every framework
// without importing every single framework's types (which comes with its own set of problems).
@@ -1415,7 +1416,7 @@ declare namespace astroHTML.JSX {
ruby: HTMLAttributes;
s: HTMLAttributes;
samp: HTMLAttributes;
- slot: SlotHTMLAttributes;
+ slot: SlotHTMLAttributes & AstroSlotAttributes;
script: ScriptHTMLAttributes & AstroScriptAttributes;
section: HTMLAttributes;
select: SelectHTMLAttributes;
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index bbea82025..fa8c33920 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -132,6 +132,10 @@ export interface AstroScriptAttributes {
'is:inline'?: boolean;
}
+export interface AstroSlotAttributes {
+ 'is:inline'?: boolean;
+}
+
export interface AstroComponentMetadata {
displayName: string;
hydrate?: 'load' | 'idle' | 'visible' | 'media' | 'only';