imgproxy
Version:
NodeJS client library to generate imgproxy urls
33 lines (30 loc) • 1.36 kB
TypeScript
import { BaseBuilder } from './base-builder.js';
import { ResizingType, Gravity, RGBColor, HexColor, WatermarkPosition, WatermarkOffset } from './types.js';
declare class ImgproxyBuilder extends BaseBuilder {
private options;
resize(type?: ResizingType, width?: number, height?: number, enlarge?: boolean): this;
size(width?: number, height?: number, enlarge?: boolean): this;
resizingType(type: string): this;
width(width: number): this;
height(height: number): this;
minWidth(width: number): this;
minHeight(height: number): this;
dpr(dpr: number | string): this;
enlarge(enlarge: number): this;
gravity(gravity: Gravity): this;
quality(quality: number): this;
background(color: RGBColor | HexColor): this;
blur(sigma: number): this;
sharpen(sigma: number): this;
watermark(opacity: number, position?: WatermarkPosition, offset?: WatermarkOffset, scale?: number): this;
preset(...presets: string[]): this;
cacheBuster(buster: string): this;
format(extension: string): this;
maxBytes(bytes: number): this;
expires(timestamp: number): this;
crop(width: number, height: number, gravity?: Gravity): this;
setOption(option: string, value: string): this;
clearOption(option: string): this;
protected serializeOptions(): string;
}
export { ImgproxyBuilder };