mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: adopt sharp 0.35.2+ by centralizing the FormatEnum key type (#362)
Centralizes the sharp format key type into a single `SharpFormat` alias derived from `toFormat()`'s signature (exported from @snapotter/image-engine, imported by the API consumers), replacing the duplicated `keyof FormatEnum` definitions. Adds convert/compress format round-trip tests covering webp/avif/png/jpeg. Part of #325.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import sharp, { type FormatEnum } from "sharp";
|
||||
|
||||
export type SharpFormat = Extract<keyof FormatEnum, string> | "avif";
|
||||
import type { SharpFormat } from "@snapotter/image-engine";
|
||||
import sharp from "sharp";
|
||||
|
||||
export interface OutputFormat {
|
||||
format: SharpFormat;
|
||||
|
||||
Reference in New Issue
Block a user