Skip to content

Commit eb94294

Browse files
authoredDec 6, 2023
fix: add types for is:inline on slots (#9342)
1 parent c769010 commit eb94294

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
 

‎.changeset/cold-toys-greet.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fix missing `is:inline` type for the `<slot />` element

‎packages/astro/astro-jsx.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ declare namespace astroHTML.JSX {
3636
AstroDefineVarsAttribute;
3737
type AstroStyleAttributes = import('./dist/@types/astro.js').AstroStyleAttributes &
3838
AstroDefineVarsAttribute;
39+
type AstroSlotAttributes = import('./dist/@types/astro.js').AstroSlotAttributes;
3940

4041
// This is an unfortunate use of `any`, but unfortunately we can't make a type that works for every framework
4142
// without importing every single framework's types (which comes with its own set of problems).
@@ -1415,7 +1416,7 @@ declare namespace astroHTML.JSX {
14151416
ruby: HTMLAttributes;
14161417
s: HTMLAttributes;
14171418
samp: HTMLAttributes;
1418-
slot: SlotHTMLAttributes;
1419+
slot: SlotHTMLAttributes & AstroSlotAttributes;
14191420
script: ScriptHTMLAttributes & AstroScriptAttributes;
14201421
section: HTMLAttributes;
14211422
select: SelectHTMLAttributes;

‎packages/astro/src/@types/astro.ts

+4
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export interface AstroScriptAttributes {
132132
'is:inline'?: boolean;
133133
}
134134

135+
export interface AstroSlotAttributes {
136+
'is:inline'?: boolean;
137+
}
138+
135139
export interface AstroComponentMetadata {
136140
displayName: string;
137141
hydrate?: 'load' | 'idle' | 'visible' | 'media' | 'only';

0 commit comments

Comments
 (0)
Please sign in to comment.