diff --git a/.changeset/lovely-trees-wait.md b/.changeset/lovely-trees-wait.md new file mode 100644 index 000000000000..2a7511d8a066 --- /dev/null +++ b/.changeset/lovely-trees-wait.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes typing issues when using `format` and `quality` options with remote images diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index 29cf1ef9ee8a..89610b05b05c 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -118,6 +118,28 @@ type ImageSharedProps = T & { * ``` */ height?: number | `${number}`; + /** + * Desired output format for the image. Defaults to `webp`. + * + * **Example**: + * ```astro + * ... + * ``` + */ + format?: ImageOutputFormat; + /** + * Desired quality for the image. Value can either be a preset such as `low` or `high`, or a numeric value from 0 to 100. + * + * The perceptual quality of the output image is service-specific. + * For instance, a certain service might decide that `high` results in a very beautiful image, but another could choose for it to be at best passable. + * + * **Example**: + * ```astro + * ... + * ... + * ``` + */ + quality?: ImageQuality; } & ( | { /** @@ -153,28 +175,6 @@ export type LocalImageProps = ImageSharedProps & { * ``` */ src: ImageMetadata | Promise<{ default: ImageMetadata }>; - /** - * Desired output format for the image. Defaults to `webp`. - * - * **Example**: - * ```astro - * ... - * ``` - */ - format?: ImageOutputFormat; - /** - * Desired quality for the image. Value can either be a preset such as `low` or `high`, or a numeric value from 0 to 100. - * - * The perceptual quality of the output image is service-specific. - * For instance, a certain service might decide that `high` results in a very beautiful image, but another could choose for it to be at best passable. - * - * **Example**: - * ```astro - * ... - * ... - * ``` - */ - quality?: ImageQuality; }; export type RemoteImageProps =