import { i as PipelineConfig, n as CodecOptions, r as ImageFormat, t as CodecMap } from "./types-CVksEKC4.mjs"; //#region src/builder.d.ts declare class SinterBuilder { /** @internal */ protected readonly _config: PipelineConfig; /** @internal */ constructor(config: PipelineConfig); /** * Sets the highest quality the encoder is allowed to use. * * The final quality may still be reduced to satisfy `targetSize()`. */ maxQuality(value: number): SinterBuilder; /** * Sets maximum pixel bounds without upscaling or changing aspect ratio. * * Provide `width`, `height`, or both. * Tries to satisfy the given constraints without distorting the image. */ maxDimensions(value: { width?: number; height?: number; }): SinterBuilder; /** Sets a best-effort target in KB (1024 bytes) or MB (1024² bytes). */ targetSize(value: number, unit: "MB" | "KB"): SinterBuilder; /** Sets a timeout in seconds. Rejects with an error if compression exceeds the limit. */ timeout(seconds: number): SinterBuilder; private withConfig; /** Replaces all codec options. The input object is copied. */ codecOptions(options: CodecOptions): SinterBuilder; /** Extracts the first composited animation frame. Still inputs are unchanged. */ firstFrame(): SinterBuilder; /** Executes the pipeline and returns the compressed image Blob. */ compress(file: Blob, options?: { signal?: AbortSignal; }): Promise; private runInWorker; } //#endregion //#region src/format.d.ts declare class SinterFormatStage { /** @internal */ private readonly _config; /** @internal */ constructor(config: PipelineConfig); /** Keeps the original image format for the output blob. */ keepFormat(): SinterBuilder; /** * Always encodes the result into the given output format. * * @param format Target output format. */ toFormat(format: F): SinterBuilder; /** * Keeps the input format when it is in the allowed list, otherwise converts to the fallback. * * @param allowed Input formats to preserve (the image is still compressed). * @param fallback Fallback format used when the source format is not allowed. */ allowFormats(allowed: A, fallback: F): SinterBuilder; } //#endregion //#region src/errors.d.ts declare class SinterError extends Error { constructor(message: string); } declare class SinterValidationError extends SinterError { constructor(message: string); } declare class SinterCodecError extends SinterError { constructor(message: string); } //#endregion //#region src/index.d.ts /** * 압축 파이프라인을 구성한다. 포맷 → 옵션 순서로 체이닝하고, 마지막 `compress(file)`에 파일을 전달한다. * * 파이프라인 설정을 const로 저장해 여러 파일에 재사용할 수 있다. * * @example * const pipeline = sinter() * .allowFormats(["avif", "webp"], "webp") * .codecOptions({ webp: { lossless: false } }) * .maxQuality(80) * .maxDimensions({ width: 1200 }); * * const blob = await pipeline.compress(file); */ declare function sinter(): SinterFormatStage; //#endregion export { type CodecMap, type CodecOptions, type ImageFormat, SinterCodecError, SinterError, SinterValidationError, sinter };