TypeScript: add missing WebpPresetEnum (#3748)

This commit is contained in:
pilotso11
2023-08-04 10:51:06 +01:00
committed by GitHub
parent bc8f983329
commit ffefbd2ecc
2 changed files with 21 additions and 0 deletions

View File

@@ -651,3 +651,13 @@ sharp(input).composite([
unlimited: true,
}
]);
// Support for webp preset in types
// https://github.com/lovell/sharp/issues/3747
sharp('input.tiff').webp({ preset: 'photo' }).toFile('out.webp');
sharp('input.tiff').webp({ preset: 'picture' }).toFile('out.webp');
sharp('input.tiff').webp({ preset: 'icon' }).toFile('out.webp');
sharp('input.tiff').webp({ preset: 'drawing' }).toFile('out.webp');
sharp('input.tiff').webp({ preset: 'text' }).toFile('out.webp');
sharp('input.tiff').webp({ preset: 'default' }).toFile('out.webp');