@ironsoftware/ironpdf
Version:
IronPDF for Node
54 lines • 1.95 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IronPdfGlobalConfig = void 0;
/**
* Global installation and setup preferences for IronPDF
*
* See {@link IronPdfGlobalConfig.setConfig}
*/
class IronPdfGlobalConfig {
constructor() {
if (IronPdfGlobalConfig._instance) {
throw new Error("Error: Instantiation failed: Use Access.getInstance() instead of new.");
}
IronPdfGlobalConfig._instance = this;
}
static getInstance() {
return IronPdfGlobalConfig._instance || (IronPdfGlobalConfig._instance = new IronPdfGlobalConfig());
}
/**
* Main IronPdf configuration method
*
* @param ironPdfConfig configuration see {@link IronPdfConfig}
*/
static setConfig(ironPdfConfig) {
if (ironPdfConfig.debugMode != undefined) {
IronPdfGlobalConfig._config.debugMode = ironPdfConfig.debugMode;
}
if (ironPdfConfig.licenseKey) {
IronPdfGlobalConfig._config.licenseKey = ironPdfConfig.licenseKey;
}
if (ironPdfConfig.ironPdfEngineAddress) {
IronPdfGlobalConfig._config.ironPdfEngineAddress =
ironPdfConfig.ironPdfEngineAddress;
}
if (ironPdfConfig.ironPdfEngineDockerAddress) {
IronPdfGlobalConfig._config.ironPdfEngineDockerAddress =
ironPdfConfig.ironPdfEngineDockerAddress;
}
}
static getConfig() {
return IronPdfGlobalConfig._config;
}
}
exports.IronPdfGlobalConfig = IronPdfGlobalConfig;
IronPdfGlobalConfig._config = {
ironPdfEngineAddress: "127.0.0.1:33350",
ironPdfEngineDockerAddress: undefined,
debugMode: false,
licenseKey: undefined,
};
IronPdfGlobalConfig.ironPdfEngineVersion =
// eslint-disable-next-line @typescript-eslint/no-var-requires
require(`../../package.json`).ironPdfEngineVersion;
//# sourceMappingURL=ironpdfglobalconfig.js.map