@cf-wasm/og
Version:
Generate Open Graph Images dynamically from HTML/CSS without a browser.
40 lines (39 loc) • 845 B
JavaScript
// src/core/modules.ts
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(module) {
this._resvg = module;
}
/** 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(module) {
this._satori = module;
}
/** 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();
export {
modules
};