@cf-wasm/og
Version:
Generate Open Graph Images dynamically from HTML/CSS without a browser.
65 lines (63 loc) • 1.86 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/core/modules.ts
var modules_exports = {};
__export(modules_exports, {
modules: () => modules
});
module.exports = __toCommonJS(modules_exports);
var Modules = class {
/** The {@link ResvgModule} */
get resvg() {
if (!this._resvg) {
throw new Error("Module `resvg` is not set, set it before accessing.");
}
return this._resvg;
}
set resvg(module2) {
this._resvg = module2;
}
/** The {@link SatoriModule} */
get satori() {
if (!this._satori) {
throw new Error("Module `satori` is not set, set it before accessing.");
}
return this._satori;
}
set satori(module2) {
this._satori = module2;
}
/** Sets modules */
set(resvgModule, satoriModule) {
this.resvg = resvgModule;
this.satori = satoriModule;
}
/** Ensures all the modules are set */
isUsable() {
if (this._resvg && this._satori) {
return true;
}
return false;
}
};
var modules = new Modules();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
modules
});