imgproxy
Version:
NodeJS client library to generate imgproxy urls
40 lines (38 loc) • 885 B
JavaScript
import {
ImgproxyBuilder
} from "./chunk-R4FDCJNE.mjs";
import {
ImgproxyPresetOnlyBuilder
} from "./chunk-H5IZJI3B.mjs";
import "./chunk-JXUYAEMM.mjs";
import {
WatermarkPosition
} from "./chunk-JZHE3YKO.mjs";
import {
isSecureConfig
} from "./chunk-X7NDVT4E.mjs";
// src/index.ts
var Imgproxy = class {
config;
constructor(config) {
if (isSecureConfig(config) && typeof config.signatureSize !== "undefined") {
if (config.signatureSize < 1 || config.signatureSize > 32) {
throw new Error(
"`signatureSize` must be greater than or equal to 1, and less than or equal to 32"
);
}
}
this.config = config;
}
builder() {
return new ImgproxyBuilder(this.config);
}
presetOnlyBuilder() {
return new ImgproxyPresetOnlyBuilder(this.config);
}
};
export {
Imgproxy,
WatermarkPosition,
Imgproxy as default
};