diff --git a/.changeset/slow-impalas-taste.md b/.changeset/slow-impalas-taste.md new file mode 100644 index 0000000000..9825d54200 --- /dev/null +++ b/.changeset/slow-impalas-taste.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes the Sharp image service `limitInputPixels` option type diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 70a11337b6..f32bcefe07 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1118,7 +1118,7 @@ export interface AstroUserConfig { * @docs * @name image.service.config.limitInputPixels * @kind h4 - * @type {boolean} + * @type {number | boolean} * @default `true` * @version 4.1.0 * @description diff --git a/packages/astro/src/assets/services/sharp.ts b/packages/astro/src/assets/services/sharp.ts index 74bf921d9c..5175bfb96b 100644 --- a/packages/astro/src/assets/services/sharp.ts +++ b/packages/astro/src/assets/services/sharp.ts @@ -1,4 +1,4 @@ -import type { FormatEnum } from 'sharp'; +import type { FormatEnum, SharpOptions } from 'sharp'; import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import type { ImageOutputFormat, ImageQualityPreset } from '../types.js'; import { @@ -12,7 +12,7 @@ export interface SharpImageServiceConfig { /** * The `limitInputPixels` option passed to Sharp. See https://sharp.pixelplumbing.com/api-constructor for more information */ - limitInputPixels?: number; + limitInputPixels?: SharpOptions['limitInputPixels']; } let sharp: typeof import('sharp');