From 086746f7e8bd6a89b1f6fafa02fe0af9cfb39bf3 Mon Sep 17 00:00:00 2001 From: Elnegren <114156013+asaura08@users.noreply.github.com> Date: Wed, 21 May 2025 13:14:04 +0000 Subject: [PATCH 1/3] feat: add loading behavior option to ImageSharedProps type --- packages/astro/src/assets/types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index ca1216e71f5c..8dd63abd5ee6 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -210,7 +210,10 @@ type ImageSharedProps = T & { * ``` */ priority?: boolean; - + /** + * Loading behavior for the image, e.g., "lazy" or "eager". + */ + loading?: string; /** * A list of widths to generate images for. The value of this property will be used to assign the `srcset` property on the final `img` element. * From 1f5c1090ee8676afd01b4e2604f9545cbf3ad0fc Mon Sep 17 00:00:00 2001 From: Elnegren <114156013+asaura08@users.noreply.github.com> Date: Wed, 21 May 2025 13:46:47 +0000 Subject: [PATCH 2/3] Add a changeset --- .changeset/lazy-trains-switch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lazy-trains-switch.md diff --git a/.changeset/lazy-trains-switch.md b/.changeset/lazy-trains-switch.md new file mode 100644 index 000000000000..841763754dff --- /dev/null +++ b/.changeset/lazy-trains-switch.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Add loading behavior option to ImageSharedProps type From cc2c16e5c74afda914052e9944d8c3b30a98ea08 Mon Sep 17 00:00:00 2001 From: Elnegren <114156013+asaura08@users.noreply.github.com> Date: Wed, 21 May 2025 20:47:01 +0200 Subject: [PATCH 3/3] fix(Type): Add "title" and "class" --- packages/astro/src/assets/types.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 8dd63abd5ee6..22837919fee4 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -219,6 +219,16 @@ type ImageSharedProps = T & { * * This attribute is incompatible with `densities`. */ + title?: string; + /** + * Class name for the image element. This will be passed to the `class` attribute of the final `img` element. + */ + class?: string; + /** + * A list of widths to generate images for. The value of this property will be used to assign the `srcset` property on the final `img` element. + * + * This attribute is incompatible with `densities`. + */ widths?: number[]; densities?: never; }