TypeScript: Ensure WebpOptions minSize is boolean (#3758)

This commit is contained in:
sho-xizz 2023-08-09 21:45:10 +09:00 committed by GitHub
parent 2829e17743
commit 87562a5111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

2
lib/index.d.ts vendored
View File

@ -1124,7 +1124,7 @@ declare namespace sharp {
/** Level of CPU effort to reduce file size, integer 0-6 (optional, default 4) */
effort?: number | undefined;
/** Prevent use of animation key frames to minimise file size (slow) (optional, default false) */
minSize?: number;
minSize?: boolean;
/** Allow mixture of lossy and lossless animation frames (slow) (optional, default false) */
mixed?: boolean;
/** Preset options: one of default, photo, picture, drawing, icon, text (optional, default 'default') */

View File

@ -524,7 +524,7 @@ sharp('input.tiff').jxl({ lossless: true }).toFile('out.jxl');
sharp('input.tiff').jxl({ effort: 7 }).toFile('out.jxl');
// Support `minSize` and `mixed` webp options
sharp('input.tiff').webp({ minSize: 1000, mixed: true }).toFile('out.gif');
sharp('input.tiff').webp({ minSize: true, mixed: true }).toFile('out.gif');
// 'failOn' input param
sharp('input.tiff', { failOn: 'none' });