@bitpatty/imgproxy-url-builder
Version:
A TypeScript helper library for building imgproxy URLs
50 lines (49 loc) • 1.26 kB
TypeScript
import WatermarkPosition from '../enums/watermark-position.enum.js';
/**
* The watermark options
*/
type WatermarkOptions = {
/**
* The opacity.
* The final opacity is calculated like base_opacity * opacity
*/
opacity: number;
/**
* The scale factor of the watermark
*/
scale?: number;
} & ({
/**
* The position of the watermark
*/
position?: WatermarkPosition.REPLICATE;
} | {
/**
* The position of the watermark
*/
position?: Exclude<WatermarkPosition, WatermarkPosition.REPLICATE>;
/**
* The offset of the watermark
*/
offset?: {
/**
* The offset of the water mark on the X axis
*/
x: number;
/**
* The offset of the water mark on the Y axis
*/
y: number;
};
});
/**
* Places a watermark on the processed image.
*
* See https://github.com/imgproxy/imgproxy/blob/6f292443eafb2e39f9252175b61faa6b38105a7c/docs/generating_the_url.md#watermark for the imgproxy documentation
*
* @param options The watermark options
* @returns The watermark param string
*/
declare const watermark: (options: WatermarkOptions) => string;
export default watermark;
export { WatermarkOptions };