@mtucourses/thumbor
Version:
👍 a URL builder for Thumbor
59 lines • 1.6 kB
TypeScript
export declare enum FIT_IN_TYPE {
DEFAULT = "DEFAULT",
FULL = "FULL",
ADAPTIVE = "ADAPTIVE"
}
export declare enum VERTICAL_POSITION {
TOP = "TOP",
MIDDLE = "MIDDLE",
BOTTOM = "BOTTOM"
}
export declare enum HORIZONTAL_POSITION {
LEFT = "LEFT",
CENTER = "CENTER",
RIGHT = "RIGHT"
}
export interface WindowSizeAndPosition {
top: number;
bottom: number;
left: number;
right: number;
}
export interface Parameters {
imagePath: string;
width: number | 'orig';
height: number | 'orig';
smart: boolean;
trimFlag: boolean;
fitInType?: FIT_IN_TYPE;
withFlipHorizontally: boolean;
withFlipVertically: boolean;
halignValue?: HORIZONTAL_POSITION;
valignValue?: VERTICAL_POSITION;
cropValues?: WindowSizeAndPosition;
filtersCalls: string[];
}
export declare class Thumbor {
private readonly url;
private readonly key?;
private parameters;
constructor({ url, key }: {
url: string;
key?: string;
});
setPath(path: string): this;
resize(width: Parameters['width'], height: Parameters['height']): this;
smartCrop(smartCrop: boolean): this;
trim(): this;
fitIn(width: number, height: number, type?: FIT_IN_TYPE): this;
flipHorizontally(): this;
flipVertically(): this;
halign(halign: HORIZONTAL_POSITION): this;
valign(valign: VERTICAL_POSITION): this;
filter(filterCall: string): this;
crop(crop: WindowSizeAndPosition): this;
buildURL(): string;
private getURLParts;
private getOperationPath;
}
//# sourceMappingURL=index.d.ts.map