///
///
///
import type { File as FormidableFile } from 'formidable';
import { yup } from '@strapi/utils';
import { z } from 'zod';
export declare const SUPPORTED_FORMATS: readonly ["jpeg", "webp", "avif", "png"];
export type SupportedFormat = (typeof SUPPORTED_FORMATS)[number];
export declare const breakpointsSchema: z.ZodRecord, "many">;
}, "strip", z.ZodTypeAny, {
breakpoint?: number;
formats?: ("jpeg" | "webp" | "avif" | "png")[];
}, {
breakpoint?: number;
formats?: ("jpeg" | "webp" | "avif" | "png")[];
}>, z.ZodNumber]>>;
export type Breakpoints = z.infer;
export type Dimensions = {
width: number | null;
height: number | null;
};
export type InputFile = FormidableFile & {
path?: string;
tmpWorkingDirectory?: string;
};
export interface File {
id: number;
name: string;
alternativeText?: string | null;
caption?: string | null;
width?: number;
height?: number;
formats?: Record;
hash: string;
ext?: string;
mime?: string;
size?: number;
sizeInBytes?: number;
url?: string;
previewUrl?: string;
path?: string | null;
provider?: string;
provider_metadata?: Record;
isUrlSigned?: boolean;
folder?: number;
folderPath?: string;
related?: {
id: string | number;
__type: string;
__pivot: {
field: string;
};
}[];
createdAt?: string;
updatedAt?: string;
createdBy?: number;
updatedBy?: number;
}
export interface Folder {
id: number;
name: string;
pathId: number;
/**
* parent id
*/
parent?: number;
/**
* children ids
*/
children?: number[];
path: string;
files?: File[];
}
export interface Config {
provider: string;
sizeLimit?: number;
providerOptions: Record;
actionOptions: Record;
}
export interface UploadableFile extends Omit {
filepath?: string;
getStream: () => NodeJS.ReadableStream;
stream?: NodeJS.ReadableStream;
buffer?: Buffer;
tmpWorkingDirectory?: string;
}
export type FileInfo = {
name?: string | null;
alternativeText?: string | null;
caption?: string | null;
folder?: number;
};
export declare const settingsSchema: import("yup/lib/object").OptionalObjectSchema<{
sizeOptimization: import("yup/lib/boolean").RequiredBooleanSchema>;
responsiveDimensions: import("yup/lib/boolean").RequiredBooleanSchema>;
autoOrientation: yup.BooleanSchema, boolean>;
}, Record, import("yup/lib/object").TypeOfShape<{
sizeOptimization: import("yup/lib/boolean").RequiredBooleanSchema>;
responsiveDimensions: import("yup/lib/boolean").RequiredBooleanSchema>;
autoOrientation: yup.BooleanSchema, boolean>;
}>>;
export type Settings = yup.InferType;
export declare const jpegOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Use progressive (interlace) scan (optional, default false) */
progressive: z.ZodOptional;
/** Set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default '4:2:0') */
chromaSubsampling: z.ZodOptional;
/** Apply trellis quantisation (optional, default false) */
trellisQuantisation: z.ZodOptional;
/** Apply overshoot deringing (optional, default false) */
overshootDeringing: z.ZodOptional;
/** Optimise progressive scans, forces progressive (optional, default false) */
optimiseScans: z.ZodOptional;
/** Alternative spelling of optimiseScans (optional, default false) */
optimizeScans: z.ZodOptional;
/** Optimise Huffman coding tables (optional, default true) */
optimiseCoding: z.ZodOptional;
/** Alternative spelling of optimiseCoding (optional, default true) */
optimizeCoding: z.ZodOptional;
/** Quantization table to use, integer 0-8 (optional, default 0) */
quantisationTable: z.ZodOptional;
/** Alternative spelling of quantisationTable (optional, default 0) */
quantizationTable: z.ZodOptional;
/** Use mozjpeg defaults (optional, default false) */
mozjpeg: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
progressive?: boolean;
chromaSubsampling?: string;
trellisQuantisation?: boolean;
overshootDeringing?: boolean;
optimiseScans?: boolean;
optimizeScans?: boolean;
optimiseCoding?: boolean;
optimizeCoding?: boolean;
quantisationTable?: number;
quantizationTable?: number;
mozjpeg?: boolean;
}, {
force?: boolean;
quality?: number;
progressive?: boolean;
chromaSubsampling?: string;
trellisQuantisation?: boolean;
overshootDeringing?: boolean;
optimiseScans?: boolean;
optimizeScans?: boolean;
optimiseCoding?: boolean;
optimizeCoding?: boolean;
quantisationTable?: number;
quantizationTable?: number;
mozjpeg?: boolean;
}>;
export declare const jp2OptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Use lossless compression mode (optional, default false) */
lossless: z.ZodOptional;
/** Horizontal tile size (optional, default 512) */
tileWidth: z.ZodOptional;
/** Vertical tile size (optional, default 512) */
tileHeight: z.ZodOptional;
/** Set to '4:2:0' to enable chroma subsampling (optional, default '4:4:4') */
chromaSubsampling: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
chromaSubsampling?: "4:4:4" | "4:2:0";
lossless?: boolean;
tileWidth?: number;
tileHeight?: number;
}, {
force?: boolean;
quality?: number;
chromaSubsampling?: "4:4:4" | "4:2:0";
lossless?: boolean;
tileWidth?: number;
tileHeight?: number;
}>;
export declare const jxlOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */
distance: z.ZodOptional;
/** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */
quality: z.ZodOptional;
/** Target decode speed tier, between 0 (highest quality) and 4 (lowest quality) (optional, default 0) */
decodingTier: z.ZodOptional;
/** Use lossless compression (optional, default false) */
lossless: z.ZodOptional;
/** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */
effort: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
lossless?: boolean;
distance?: number;
decodingTier?: number;
effort?: number;
}, {
force?: boolean;
quality?: number;
lossless?: boolean;
distance?: number;
decodingTier?: number;
effort?: number;
}>;
export declare const webpOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Number of animation iterations, use 0 for infinite animation (optional, default 0) */
loop: z.ZodOptional;
/** Delay between animation frames in milliseconds (optional, default 100) */
delay: z.ZodOptional]>>;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Quality of alpha layer, number from 0-100 (optional, default 100) */
alphaQuality: z.ZodOptional;
/** Use lossless compression mode (optional, default false) */
lossless: z.ZodOptional;
/** Use near_lossless compression mode (optional, default false) */
nearLossless: z.ZodOptional;
/** Use high quality chroma subsampling (optional, default false) */
smartSubsample: z.ZodOptional;
/** Auto-adjust the deblocking filter, slow but can improve low contrast edges (optional, default false) */
smartDeblock: z.ZodOptional;
/** Level of CPU effort to reduce file size, integer 0-6 (optional, default 4) */
effort: z.ZodOptional;
/** Prevent use of animation key frames to minimise file size (slow) (optional, default false) */
minSize: z.ZodOptional;
/** Allow mixture of lossy and lossless animation frames (slow) (optional, default false) */
mixed: z.ZodOptional;
/** Preset options: one of default, photo, picture, drawing, icon, text (optional, default 'default') */
preset: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
loop?: number;
delay?: number | number[];
quality?: number;
lossless?: boolean;
effort?: number;
alphaQuality?: number;
nearLossless?: boolean;
smartSubsample?: boolean;
smartDeblock?: boolean;
minSize?: boolean;
mixed?: boolean;
preset?: "default" | "photo" | "picture" | "drawing" | "icon" | "text";
}, {
force?: boolean;
loop?: number;
delay?: number | number[];
quality?: number;
lossless?: boolean;
effort?: number;
alphaQuality?: number;
nearLossless?: boolean;
smartSubsample?: boolean;
smartDeblock?: boolean;
minSize?: boolean;
mixed?: boolean;
preset?: "default" | "photo" | "picture" | "drawing" | "icon" | "text";
}>;
export declare const avifOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 50) */
quality: z.ZodOptional;
/** Use lossless compression (optional, default false) */
lossless: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
effort: z.ZodOptional;
/** Set to '4:2:0' to use chroma subsampling, requires libvips v8.11.0 (optional, default '4:4:4') */
chromaSubsampling: z.ZodOptional;
/** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
bitdepth: z.ZodOptional, z.ZodLiteral<10>, z.ZodLiteral<12>]>>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
}, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
}>;
export declare const heifOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 50) */
quality: z.ZodOptional;
/** Compression format: av1, hevc (optional, default 'av1') */
compression: z.ZodOptional>;
/** Use lossless compression (optional, default false) */
lossless: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
effort: z.ZodOptional;
/** Set to '4:2:0' to use chroma subsampling (optional, default '4:4:4') */
chromaSubsampling: z.ZodOptional;
/** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
bitdepth: z.ZodOptional, z.ZodLiteral<10>, z.ZodLiteral<12>]>>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
compression?: "av1" | "hevc";
}, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
compression?: "av1" | "hevc";
}>;
export declare const gifOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Number of animation iterations, use 0 for infinite animation (optional, default 0) */
loop: z.ZodOptional;
/** Delay between animation frames in milliseconds (optional, default 100) */
delay: z.ZodOptional]>>;
} & {
/** Re-use existing palette, otherwise generate new (slow) */
reuse: z.ZodOptional;
/** Use progressive (interlace) scan */
progressive: z.ZodOptional;
/** Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */
colours: z.ZodOptional;
/** Alternative spelling of "colours". Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */
colors: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest) (optional, default 7) */
effort: z.ZodOptional;
/** Level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) (optional, default 1.0) */
dither: z.ZodOptional;
/** Maximum inter-frame error for transparency, between 0 (lossless) and 32 (optional, default 0) */
interFrameMaxError: z.ZodOptional;
/** Maximum inter-palette error for palette reuse, between 0 and 256 (optional, default 3) */
interPaletteMaxError: z.ZodOptional;
/** Keep duplicate frames in the output instead of combining them (optional, default false) */
keepDuplicateFrames: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
loop?: number;
delay?: number | number[];
progressive?: boolean;
effort?: number;
reuse?: boolean;
colours?: number;
colors?: number;
dither?: number;
interFrameMaxError?: number;
interPaletteMaxError?: number;
keepDuplicateFrames?: boolean;
}, {
force?: boolean;
loop?: number;
delay?: number | number[];
progressive?: boolean;
effort?: number;
reuse?: boolean;
colours?: number;
colors?: number;
dither?: number;
interFrameMaxError?: number;
interPaletteMaxError?: number;
keepDuplicateFrames?: boolean;
}>;
export declare const tiffOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k (optional, default 'jpeg') */
compression: z.ZodOptional>;
/** Use BigTIFF variant (has no effect when compression is none) (optional, default false) */
bigtiff: z.ZodOptional;
/** Compression predictor options: none, horizontal, float (optional, default 'horizontal') */
predictor: z.ZodOptional>;
/** Write an image pyramid (optional, default false) */
pyramid: z.ZodOptional;
/** Write a tiled tiff (optional, default false) */
tile: z.ZodOptional;
/** Horizontal tile size (optional, default 256) */
tileWidth: z.ZodOptional;
/** Vertical tile size (optional, default 256) */
tileHeight: z.ZodOptional;
/** Horizontal resolution in pixels/mm (optional, default 1.0) */
xres: z.ZodOptional;
/** Vertical resolution in pixels/mm (optional, default 1.0) */
yres: z.ZodOptional;
/** Reduce bitdepth to 1, 2 or 4 bit (optional, default 8) */
bitdepth: z.ZodOptional, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<8>]>>;
/** Write 1-bit images as miniswhite (optional, default false) */
miniswhite: z.ZodOptional;
/** Resolution unit options: inch, cm (optional, default 'inch') */
resolutionUnit: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
tileWidth?: number;
tileHeight?: number;
bitdepth?: 4 | 1 | 2 | 8;
compression?: "jpeg" | "webp" | "none" | "deflate" | "packbits" | "ccittfax4" | "lzw" | "zstd" | "jp2k";
bigtiff?: boolean;
predictor?: "float" | "none" | "horizontal";
pyramid?: boolean;
tile?: boolean;
xres?: number;
yres?: number;
miniswhite?: boolean;
resolutionUnit?: "inch" | "cm";
}, {
force?: boolean;
quality?: number;
tileWidth?: number;
tileHeight?: number;
bitdepth?: 4 | 1 | 2 | 8;
compression?: "jpeg" | "webp" | "none" | "deflate" | "packbits" | "ccittfax4" | "lzw" | "zstd" | "jp2k";
bigtiff?: boolean;
predictor?: "float" | "none" | "horizontal";
pyramid?: boolean;
tile?: boolean;
xres?: number;
yres?: number;
miniswhite?: boolean;
resolutionUnit?: "inch" | "cm";
}>;
export declare const pngOptionsSchema: z.ZodObject<{
/** Force format output, otherwise attempt to use input format (optional, default true) */
force: z.ZodOptional;
} & {
/** Use progressive (interlace) scan (optional, default false) */
progressive: z.ZodOptional;
/** zlib compression level, 0-9 (optional, default 6) */
compressionLevel: z.ZodOptional;
/** Use adaptive row filtering (optional, default false) */
adaptiveFiltering: z.ZodOptional;
/** Use the lowest number of colours needed to achieve given quality (optional, default 100) */
quality: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest), sets palette to true (optional, default 7) */
effort: z.ZodOptional;
/** Quantise to a palette-based image with alpha transparency support (optional, default false) */
palette: z.ZodOptional;
/** Maximum number of palette entries (optional, default 256) */
colours: z.ZodOptional;
/** Alternative Spelling of "colours". Maximum number of palette entries (optional, default 256) */
colors: z.ZodOptional;
/** Level of Floyd-Steinberg error diffusion (optional, default 1.0) */
dither: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
progressive?: boolean;
effort?: number;
colours?: number;
colors?: number;
dither?: number;
compressionLevel?: number;
adaptiveFiltering?: boolean;
palette?: boolean;
}, {
force?: boolean;
quality?: number;
progressive?: boolean;
effort?: number;
colours?: number;
colors?: number;
dither?: number;
compressionLevel?: number;
adaptiveFiltering?: boolean;
palette?: boolean;
}>;
export declare const formatOptionsSchema: z.ZodObject<{
jpeg: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Use progressive (interlace) scan (optional, default false) */
progressive: z.ZodOptional;
/** Set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default '4:2:0') */
chromaSubsampling: z.ZodOptional;
/** Apply trellis quantisation (optional, default false) */
trellisQuantisation: z.ZodOptional;
/** Apply overshoot deringing (optional, default false) */
overshootDeringing: z.ZodOptional;
/** Optimise progressive scans, forces progressive (optional, default false) */
optimiseScans: z.ZodOptional;
/** Alternative spelling of optimiseScans (optional, default false) */
optimizeScans: z.ZodOptional;
/** Optimise Huffman coding tables (optional, default true) */
optimiseCoding: z.ZodOptional;
/** Alternative spelling of optimiseCoding (optional, default true) */
optimizeCoding: z.ZodOptional;
/** Quantization table to use, integer 0-8 (optional, default 0) */
quantisationTable: z.ZodOptional;
/** Alternative spelling of quantisationTable (optional, default 0) */
quantizationTable: z.ZodOptional;
/** Use mozjpeg defaults (optional, default false) */
mozjpeg: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
progressive?: boolean;
chromaSubsampling?: string;
trellisQuantisation?: boolean;
overshootDeringing?: boolean;
optimiseScans?: boolean;
optimizeScans?: boolean;
optimiseCoding?: boolean;
optimizeCoding?: boolean;
quantisationTable?: number;
quantizationTable?: number;
mozjpeg?: boolean;
}, {
force?: boolean;
quality?: number;
progressive?: boolean;
chromaSubsampling?: string;
trellisQuantisation?: boolean;
overshootDeringing?: boolean;
optimiseScans?: boolean;
optimizeScans?: boolean;
optimiseCoding?: boolean;
optimizeCoding?: boolean;
quantisationTable?: number;
quantizationTable?: number;
mozjpeg?: boolean;
}>>;
jp2: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Use lossless compression mode (optional, default false) */
lossless: z.ZodOptional;
/** Horizontal tile size (optional, default 512) */
tileWidth: z.ZodOptional;
/** Vertical tile size (optional, default 512) */
tileHeight: z.ZodOptional;
/** Set to '4:2:0' to enable chroma subsampling (optional, default '4:4:4') */
chromaSubsampling: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
chromaSubsampling?: "4:4:4" | "4:2:0";
lossless?: boolean;
tileWidth?: number;
tileHeight?: number;
}, {
force?: boolean;
quality?: number;
chromaSubsampling?: "4:4:4" | "4:2:0";
lossless?: boolean;
tileWidth?: number;
tileHeight?: number;
}>>;
jxl: z.ZodOptional;
} & {
/** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */
distance: z.ZodOptional;
/** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */
quality: z.ZodOptional;
/** Target decode speed tier, between 0 (highest quality) and 4 (lowest quality) (optional, default 0) */
decodingTier: z.ZodOptional;
/** Use lossless compression (optional, default false) */
lossless: z.ZodOptional;
/** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */
effort: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
lossless?: boolean;
distance?: number;
decodingTier?: number;
effort?: number;
}, {
force?: boolean;
quality?: number;
lossless?: boolean;
distance?: number;
decodingTier?: number;
effort?: number;
}>>;
webp: z.ZodOptional;
} & {
/** Number of animation iterations, use 0 for infinite animation (optional, default 0) */
loop: z.ZodOptional;
/** Delay between animation frames in milliseconds (optional, default 100) */
delay: z.ZodOptional]>>;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Quality of alpha layer, number from 0-100 (optional, default 100) */
alphaQuality: z.ZodOptional;
/** Use lossless compression mode (optional, default false) */
lossless: z.ZodOptional;
/** Use near_lossless compression mode (optional, default false) */
nearLossless: z.ZodOptional;
/** Use high quality chroma subsampling (optional, default false) */
smartSubsample: z.ZodOptional;
/** Auto-adjust the deblocking filter, slow but can improve low contrast edges (optional, default false) */
smartDeblock: z.ZodOptional;
/** Level of CPU effort to reduce file size, integer 0-6 (optional, default 4) */
effort: z.ZodOptional;
/** Prevent use of animation key frames to minimise file size (slow) (optional, default false) */
minSize: z.ZodOptional;
/** Allow mixture of lossy and lossless animation frames (slow) (optional, default false) */
mixed: z.ZodOptional;
/** Preset options: one of default, photo, picture, drawing, icon, text (optional, default 'default') */
preset: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
loop?: number;
delay?: number | number[];
quality?: number;
lossless?: boolean;
effort?: number;
alphaQuality?: number;
nearLossless?: boolean;
smartSubsample?: boolean;
smartDeblock?: boolean;
minSize?: boolean;
mixed?: boolean;
preset?: "default" | "photo" | "picture" | "drawing" | "icon" | "text";
}, {
force?: boolean;
loop?: number;
delay?: number | number[];
quality?: number;
lossless?: boolean;
effort?: number;
alphaQuality?: number;
nearLossless?: boolean;
smartSubsample?: boolean;
smartDeblock?: boolean;
minSize?: boolean;
mixed?: boolean;
preset?: "default" | "photo" | "picture" | "drawing" | "icon" | "text";
}>>;
avif: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 50) */
quality: z.ZodOptional;
/** Use lossless compression (optional, default false) */
lossless: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
effort: z.ZodOptional;
/** Set to '4:2:0' to use chroma subsampling, requires libvips v8.11.0 (optional, default '4:4:4') */
chromaSubsampling: z.ZodOptional;
/** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
bitdepth: z.ZodOptional, z.ZodLiteral<10>, z.ZodLiteral<12>]>>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
}, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
}>>;
heif: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 50) */
quality: z.ZodOptional;
/** Compression format: av1, hevc (optional, default 'av1') */
compression: z.ZodOptional>;
/** Use lossless compression (optional, default false) */
lossless: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */
effort: z.ZodOptional;
/** Set to '4:2:0' to use chroma subsampling (optional, default '4:4:4') */
chromaSubsampling: z.ZodOptional;
/** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */
bitdepth: z.ZodOptional, z.ZodLiteral<10>, z.ZodLiteral<12>]>>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
compression?: "av1" | "hevc";
}, {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
compression?: "av1" | "hevc";
}>>;
gif: z.ZodOptional;
} & {
/** Number of animation iterations, use 0 for infinite animation (optional, default 0) */
loop: z.ZodOptional;
/** Delay between animation frames in milliseconds (optional, default 100) */
delay: z.ZodOptional]>>;
} & {
/** Re-use existing palette, otherwise generate new (slow) */
reuse: z.ZodOptional;
/** Use progressive (interlace) scan */
progressive: z.ZodOptional;
/** Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */
colours: z.ZodOptional;
/** Alternative spelling of "colours". Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */
colors: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest) (optional, default 7) */
effort: z.ZodOptional;
/** Level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) (optional, default 1.0) */
dither: z.ZodOptional;
/** Maximum inter-frame error for transparency, between 0 (lossless) and 32 (optional, default 0) */
interFrameMaxError: z.ZodOptional;
/** Maximum inter-palette error for palette reuse, between 0 and 256 (optional, default 3) */
interPaletteMaxError: z.ZodOptional;
/** Keep duplicate frames in the output instead of combining them (optional, default false) */
keepDuplicateFrames: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
loop?: number;
delay?: number | number[];
progressive?: boolean;
effort?: number;
reuse?: boolean;
colours?: number;
colors?: number;
dither?: number;
interFrameMaxError?: number;
interPaletteMaxError?: number;
keepDuplicateFrames?: boolean;
}, {
force?: boolean;
loop?: number;
delay?: number | number[];
progressive?: boolean;
effort?: number;
reuse?: boolean;
colours?: number;
colors?: number;
dither?: number;
interFrameMaxError?: number;
interPaletteMaxError?: number;
keepDuplicateFrames?: boolean;
}>>;
tiff: z.ZodOptional;
} & {
/** Quality, integer 1-100 (optional, default 80) */
quality: z.ZodOptional;
/** Compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k (optional, default 'jpeg') */
compression: z.ZodOptional>;
/** Use BigTIFF variant (has no effect when compression is none) (optional, default false) */
bigtiff: z.ZodOptional;
/** Compression predictor options: none, horizontal, float (optional, default 'horizontal') */
predictor: z.ZodOptional>;
/** Write an image pyramid (optional, default false) */
pyramid: z.ZodOptional;
/** Write a tiled tiff (optional, default false) */
tile: z.ZodOptional;
/** Horizontal tile size (optional, default 256) */
tileWidth: z.ZodOptional;
/** Vertical tile size (optional, default 256) */
tileHeight: z.ZodOptional;
/** Horizontal resolution in pixels/mm (optional, default 1.0) */
xres: z.ZodOptional;
/** Vertical resolution in pixels/mm (optional, default 1.0) */
yres: z.ZodOptional;
/** Reduce bitdepth to 1, 2 or 4 bit (optional, default 8) */
bitdepth: z.ZodOptional, z.ZodLiteral<2>, z.ZodLiteral<4>, z.ZodLiteral<8>]>>;
/** Write 1-bit images as miniswhite (optional, default false) */
miniswhite: z.ZodOptional;
/** Resolution unit options: inch, cm (optional, default 'inch') */
resolutionUnit: z.ZodOptional>;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
tileWidth?: number;
tileHeight?: number;
bitdepth?: 4 | 1 | 2 | 8;
compression?: "jpeg" | "webp" | "none" | "deflate" | "packbits" | "ccittfax4" | "lzw" | "zstd" | "jp2k";
bigtiff?: boolean;
predictor?: "float" | "none" | "horizontal";
pyramid?: boolean;
tile?: boolean;
xres?: number;
yres?: number;
miniswhite?: boolean;
resolutionUnit?: "inch" | "cm";
}, {
force?: boolean;
quality?: number;
tileWidth?: number;
tileHeight?: number;
bitdepth?: 4 | 1 | 2 | 8;
compression?: "jpeg" | "webp" | "none" | "deflate" | "packbits" | "ccittfax4" | "lzw" | "zstd" | "jp2k";
bigtiff?: boolean;
predictor?: "float" | "none" | "horizontal";
pyramid?: boolean;
tile?: boolean;
xres?: number;
yres?: number;
miniswhite?: boolean;
resolutionUnit?: "inch" | "cm";
}>>;
png: z.ZodOptional;
} & {
/** Use progressive (interlace) scan (optional, default false) */
progressive: z.ZodOptional;
/** zlib compression level, 0-9 (optional, default 6) */
compressionLevel: z.ZodOptional;
/** Use adaptive row filtering (optional, default false) */
adaptiveFiltering: z.ZodOptional;
/** Use the lowest number of colours needed to achieve given quality (optional, default 100) */
quality: z.ZodOptional;
/** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest), sets palette to true (optional, default 7) */
effort: z.ZodOptional;
/** Quantise to a palette-based image with alpha transparency support (optional, default false) */
palette: z.ZodOptional;
/** Maximum number of palette entries (optional, default 256) */
colours: z.ZodOptional;
/** Alternative Spelling of "colours". Maximum number of palette entries (optional, default 256) */
colors: z.ZodOptional;
/** Level of Floyd-Steinberg error diffusion (optional, default 1.0) */
dither: z.ZodOptional;
}, "strip", z.ZodTypeAny, {
force?: boolean;
quality?: number;
progressive?: boolean;
effort?: number;
colours?: number;
colors?: number;
dither?: number;
compressionLevel?: number;
adaptiveFiltering?: boolean;
palette?: boolean;
}, {
force?: boolean;
quality?: number;
progressive?: boolean;
effort?: number;
colours?: number;
colors?: number;
dither?: number;
compressionLevel?: number;
adaptiveFiltering?: boolean;
palette?: boolean;
}>>;
}, "strip", z.ZodTypeAny, {
jpeg?: {
force?: boolean;
quality?: number;
progressive?: boolean;
chromaSubsampling?: string;
trellisQuantisation?: boolean;
overshootDeringing?: boolean;
optimiseScans?: boolean;
optimizeScans?: boolean;
optimiseCoding?: boolean;
optimizeCoding?: boolean;
quantisationTable?: number;
quantizationTable?: number;
mozjpeg?: boolean;
};
webp?: {
force?: boolean;
loop?: number;
delay?: number | number[];
quality?: number;
lossless?: boolean;
effort?: number;
alphaQuality?: number;
nearLossless?: boolean;
smartSubsample?: boolean;
smartDeblock?: boolean;
minSize?: boolean;
mixed?: boolean;
preset?: "default" | "photo" | "picture" | "drawing" | "icon" | "text";
};
avif?: {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
};
png?: {
force?: boolean;
quality?: number;
progressive?: boolean;
effort?: number;
colours?: number;
colors?: number;
dither?: number;
compressionLevel?: number;
adaptiveFiltering?: boolean;
palette?: boolean;
};
jp2?: {
force?: boolean;
quality?: number;
chromaSubsampling?: "4:4:4" | "4:2:0";
lossless?: boolean;
tileWidth?: number;
tileHeight?: number;
};
jxl?: {
force?: boolean;
quality?: number;
lossless?: boolean;
distance?: number;
decodingTier?: number;
effort?: number;
};
heif?: {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
compression?: "av1" | "hevc";
};
gif?: {
force?: boolean;
loop?: number;
delay?: number | number[];
progressive?: boolean;
effort?: number;
reuse?: boolean;
colours?: number;
colors?: number;
dither?: number;
interFrameMaxError?: number;
interPaletteMaxError?: number;
keepDuplicateFrames?: boolean;
};
tiff?: {
force?: boolean;
quality?: number;
tileWidth?: number;
tileHeight?: number;
bitdepth?: 4 | 1 | 2 | 8;
compression?: "jpeg" | "webp" | "none" | "deflate" | "packbits" | "ccittfax4" | "lzw" | "zstd" | "jp2k";
bigtiff?: boolean;
predictor?: "float" | "none" | "horizontal";
pyramid?: boolean;
tile?: boolean;
xres?: number;
yres?: number;
miniswhite?: boolean;
resolutionUnit?: "inch" | "cm";
};
}, {
jpeg?: {
force?: boolean;
quality?: number;
progressive?: boolean;
chromaSubsampling?: string;
trellisQuantisation?: boolean;
overshootDeringing?: boolean;
optimiseScans?: boolean;
optimizeScans?: boolean;
optimiseCoding?: boolean;
optimizeCoding?: boolean;
quantisationTable?: number;
quantizationTable?: number;
mozjpeg?: boolean;
};
webp?: {
force?: boolean;
loop?: number;
delay?: number | number[];
quality?: number;
lossless?: boolean;
effort?: number;
alphaQuality?: number;
nearLossless?: boolean;
smartSubsample?: boolean;
smartDeblock?: boolean;
minSize?: boolean;
mixed?: boolean;
preset?: "default" | "photo" | "picture" | "drawing" | "icon" | "text";
};
avif?: {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
};
png?: {
force?: boolean;
quality?: number;
progressive?: boolean;
effort?: number;
colours?: number;
colors?: number;
dither?: number;
compressionLevel?: number;
adaptiveFiltering?: boolean;
palette?: boolean;
};
jp2?: {
force?: boolean;
quality?: number;
chromaSubsampling?: "4:4:4" | "4:2:0";
lossless?: boolean;
tileWidth?: number;
tileHeight?: number;
};
jxl?: {
force?: boolean;
quality?: number;
lossless?: boolean;
distance?: number;
decodingTier?: number;
effort?: number;
};
heif?: {
force?: boolean;
quality?: number;
chromaSubsampling?: string;
lossless?: boolean;
effort?: number;
bitdepth?: 8 | 10 | 12;
compression?: "av1" | "hevc";
};
gif?: {
force?: boolean;
loop?: number;
delay?: number | number[];
progressive?: boolean;
effort?: number;
reuse?: boolean;
colours?: number;
colors?: number;
dither?: number;
interFrameMaxError?: number;
interPaletteMaxError?: number;
keepDuplicateFrames?: boolean;
};
tiff?: {
force?: boolean;
quality?: number;
tileWidth?: number;
tileHeight?: number;
bitdepth?: 4 | 1 | 2 | 8;
compression?: "jpeg" | "webp" | "none" | "deflate" | "packbits" | "ccittfax4" | "lzw" | "zstd" | "jp2k";
bigtiff?: boolean;
predictor?: "float" | "none" | "horizontal";
pyramid?: boolean;
tile?: boolean;
xres?: number;
yres?: number;
miniswhite?: boolean;
resolutionUnit?: "inch" | "cm";
};
}>;
export type JpegOptions = z.infer;
export type Jp2Options = z.infer;
export type JxlOptions = z.infer;
export type WebpOptions = z.infer;
export type AvifOptions = z.infer;
export type HeifOptions = z.infer;
export type GifOptions = z.infer;
export type TiffOptions = z.infer;
export type PngOptions = z.infer;
export type FormatOptions = z.infer;
export type ImageFormatOptions = JpegOptions | Jp2Options | JxlOptions | WebpOptions | AvifOptions | HeifOptions | GifOptions | TiffOptions | PngOptions;