@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
38 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.wsclientConfiguration = void 0;
const globals = global;
class WsclientConfiguration {
constructor() {
if (typeof process !== "undefined") {
this._FormData = require("form-data");
this._btoa = function (data) {
return Buffer.from(data).toString('base64');
};
}
else {
this._FormData = typeof FormData !== "undefined" ? FormData : globals.FormData;
this._btoa = typeof window !== "undefined" ? window.btoa.bind(window) : globals.btoa;
}
}
static get instance() {
if (typeof this._instance === "undefined") {
this._instance = new WsclientConfiguration();
}
return this._instance;
}
get FormData() {
return this._FormData;
}
set FormData(value) {
this._FormData = value;
}
get btoa() {
return this._btoa;
}
set btoa(value) {
this._btoa = value;
}
}
exports.wsclientConfiguration = WsclientConfiguration.instance;
//# sourceMappingURL=WsclientConfiguration.js.map