@shapediver/viewer.session
Version:
This is the npm package for the ShapeDiver Viewer Session API. For more information on ShapeDiver, please visit our [homepage](https://shapediver.com/).
142 lines • 7.78 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _ExportApi_export, _ExportApi_inputValidator, _ExportApi_logger;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isExportApi = exports.ExportApi = void 0;
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
class ExportApi {
// #endregion Properties (3)
// #region Constructors (1)
constructor(exportD) {
// #region Properties (3)
_ExportApi_export.set(this, void 0);
_ExportApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
_ExportApi_logger.set(this, viewer_shared_services_1.Logger.instance);
__classPrivateFieldSet(this, _ExportApi_export, exportD, "f");
}
// #endregion Constructors (1)
// #region Public Getters And Setters (24)
get content() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").content;
}
get delay() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").delay;
}
get dependency() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").dependency;
}
get displayname() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").displayname;
}
set displayname(value) {
const scope = "displayname";
__classPrivateFieldGet(this, _ExportApi_inputValidator, "f").validateAndError(`ExportApi.${scope}`, value, "string", false);
__classPrivateFieldGet(this, _ExportApi_export, "f").displayname = value;
__classPrivateFieldGet(this, _ExportApi_logger, "f").debug(`ExportApi.${scope}: ${scope} was updated to ${__classPrivateFieldGet(this, _ExportApi_export, "f").displayname}.`);
}
get filename() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").filename;
}
get group() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").group;
}
get hidden() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").hidden;
}
set hidden(value) {
const scope = "hidden";
__classPrivateFieldGet(this, _ExportApi_inputValidator, "f").validateAndError(`ExportApi.${scope}`, value, "boolean");
__classPrivateFieldGet(this, _ExportApi_export, "f").hidden = value;
__classPrivateFieldGet(this, _ExportApi_logger, "f").debug(`ExportApi.${scope}: ${scope} was updated to ${__classPrivateFieldGet(this, _ExportApi_export, "f").hidden}.`);
}
get id() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").id;
}
get maxWaitTime() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").maxWaitTime;
}
set maxWaitTime(value) {
const scope = "maxWaitTime";
__classPrivateFieldGet(this, _ExportApi_inputValidator, "f").validateAndError(`ExportApi.${scope}`, value, "number");
__classPrivateFieldGet(this, _ExportApi_export, "f").maxWaitTime = value;
__classPrivateFieldGet(this, _ExportApi_logger, "f").debug(`ExportApi.${scope}: ${scope} was updated to ${__classPrivateFieldGet(this, _ExportApi_export, "f").maxWaitTime}.`);
}
get msg() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").msg;
}
get name() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").name;
}
get order() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").order;
}
set order(value) {
const scope = "order";
__classPrivateFieldGet(this, _ExportApi_inputValidator, "f").validateAndError(`ExportApi.${scope}`, value, "number", false);
__classPrivateFieldGet(this, _ExportApi_export, "f").order = value;
__classPrivateFieldGet(this, _ExportApi_logger, "f").debug(`ExportApi.${scope}: ${scope} was updated to ${__classPrivateFieldGet(this, _ExportApi_export, "f").order}.`);
}
get result() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").result;
}
get status_collect() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").status_collect;
}
get status_computation() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").status_computation;
}
get tooltip() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").tooltip;
}
set tooltip(value) {
const scope = "tooltip";
__classPrivateFieldGet(this, _ExportApi_inputValidator, "f").validateAndError(`ExportApi.${scope}`, value, "string", false);
__classPrivateFieldGet(this, _ExportApi_export, "f").tooltip = value;
__classPrivateFieldGet(this, _ExportApi_logger, "f").debug(`ExportApi.${scope}: ${scope} was updated to ${__classPrivateFieldGet(this, _ExportApi_export, "f").tooltip}.`);
}
get type() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").type;
}
get uid() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").uid;
}
get version() {
return __classPrivateFieldGet(this, _ExportApi_export, "f").version;
}
// #endregion Public Getters And Setters (24)
// #region Public Methods (2)
request(parameters = {}) {
return __awaiter(this, void 0, void 0, function* () {
const scope = "request";
__classPrivateFieldGet(this, _ExportApi_inputValidator, "f").validateAndError(`ExportApi.${scope}`, parameters, "object");
return __classPrivateFieldGet(this, _ExportApi_export, "f").request(parameters);
});
}
updateExport() {
__classPrivateFieldGet(this, _ExportApi_export, "f").updateExport();
}
}
exports.ExportApi = ExportApi;
_ExportApi_export = new WeakMap(), _ExportApi_inputValidator = new WeakMap(), _ExportApi_logger = new WeakMap();
const isExportApi = (obj) => obj instanceof ExportApi;
exports.isExportApi = isExportApi;
//# sourceMappingURL=ExportApi.js.map