0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

Fix limitInputPixels type (#9622)

* Fix limitInputPixels type

* Use sharp options
This commit is contained in:
Bjorn Lu 2024-01-05 22:47:00 +08:00 committed by GitHub
parent d87a97e109
commit 5156c74050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Fixes the Sharp image service `limitInputPixels` option type

View file

@ -1118,7 +1118,7 @@ export interface AstroUserConfig {
* @docs * @docs
* @name image.service.config.limitInputPixels * @name image.service.config.limitInputPixels
* @kind h4 * @kind h4
* @type {boolean} * @type {number | boolean}
* @default `true` * @default `true`
* @version 4.1.0 * @version 4.1.0
* @description * @description

View file

@ -1,4 +1,4 @@
import type { FormatEnum } from 'sharp'; import type { FormatEnum, SharpOptions } from 'sharp';
import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import { AstroError, AstroErrorData } from '../../core/errors/index.js';
import type { ImageOutputFormat, ImageQualityPreset } from '../types.js'; import type { ImageOutputFormat, ImageQualityPreset } from '../types.js';
import { import {
@ -12,7 +12,7 @@ export interface SharpImageServiceConfig {
/** /**
* The `limitInputPixels` option passed to Sharp. See https://sharp.pixelplumbing.com/api-constructor for more information * 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'); let sharp: typeof import('sharp');