mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
Fix: Type error on <Image />
component when strict TypeScript rules are used with library type checking. (#10549)
* hotfix:ts-explicit-error * add:changeset * update:changeset * Update .changeset/blue-dolls-melt.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * add:types-htmlattribute-extends * Update .changeset/blue-dolls-melt.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * Update blue-dolls-melt.md * addition: allow specifying null type --------- Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
This commit is contained in:
parent
c585528f44
commit
54c2f9707f
2 changed files with 9 additions and 1 deletions
5
.changeset/blue-dolls-melt.md
Normal file
5
.changeset/blue-dolls-melt.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Updates the `HTMLAttributes` type exported from `astro` to allow data attributes
|
5
packages/astro/types.d.ts
vendored
5
packages/astro/types.d.ts
vendored
|
@ -4,11 +4,14 @@ import type { Simplify } from './dist/type-utils.js';
|
|||
|
||||
/** Any supported HTML or SVG element name, as defined by the HTML specification */
|
||||
export type HTMLTag = keyof astroHTML.JSX.DefinedIntrinsicElements;
|
||||
|
||||
/** The built-in attributes for any known HTML or SVG element name */
|
||||
export type HTMLAttributes<Tag extends HTMLTag> = Omit<
|
||||
astroHTML.JSX.IntrinsicElements[Tag],
|
||||
keyof Omit<AstroBuiltinAttributes, 'class:list'>
|
||||
>;
|
||||
> & {
|
||||
[key: string]: string | number | boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* All the CSS properties available, as defined by the CSS specification
|
||||
|
|
Loading…
Add table
Reference in a new issue