0
Fork 0
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:
Admir Šaheta 2024-03-26 10:44:17 +01:00 committed by GitHub
parent c585528f44
commit 54c2f9707f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Updates the `HTMLAttributes` type exported from `astro` to allow data attributes

View file

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