UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

95 lines 4.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Item = void 0; const index_1 = require("./../index"); class Item { constructor(data) { this.actions = (data.actions || []).map(index_1.ActionEvent.fromJson); let boldDefault = false; this.bold = typeof (data === null || data === void 0 ? void 0 : data.bold) !== "undefined" ? data === null || data === void 0 ? void 0 : data.bold : boldDefault; let colorDefault = "#000000"; this.color = typeof (data === null || data === void 0 ? void 0 : data.color) !== "undefined" ? data === null || data === void 0 ? void 0 : data.color : colorDefault; let isOpenDefault = false; this.isOpen = typeof (data === null || data === void 0 ? void 0 : data.isOpen) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isOpen : isOpenDefault; let italicDefault = false; this.italic = typeof (data === null || data === void 0 ? void 0 : data.italic) !== "undefined" ? data === null || data === void 0 ? void 0 : data.italic : italicDefault; let itemNameDefault = ""; this.itemName = typeof (data === null || data === void 0 ? void 0 : data.itemName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.itemName : itemNameDefault; let pathDefault = ""; this.path = typeof (data === null || data === void 0 ? void 0 : data.path) !== "undefined" ? data === null || data === void 0 ? void 0 : data.path : pathDefault; let pathPositionDefault = "inplace"; this.pathPosition = typeof (data === null || data === void 0 ? void 0 : data.pathPosition) !== "undefined" ? data === null || data === void 0 ? void 0 : data.pathPosition : pathPositionDefault; } static getActionsDefault() { return []; } static getActionsDescription() { return ""; } static getBoldDefault() { return false; } static getBoldDescription() { return "If this value is set to true, the element's name will be shown in bold."; } static getColorDefault() { return "#000000"; } static getColorDescription() { return "Used to set the colour that will be used to display the element's name. The hereby defined color needs to be specified as a hexadecimal RGB value with a number sign before it."; } static getIsOpenDefault() { return false; } static getIsOpenDescription() { return "If this value is set to true, the element will already be expanded when the document is opened."; } static getItalicDefault() { return false; } static getItalicDescription() { return "If this value is set to true, the element's name will be shown in italics."; } static getItemNameDefault() { return ""; } static getItemNameDescription() { return "The name of the new entry in the content structure that should be placed relative to the selected path."; } static getPathDefault() { return ""; } static getPathDescription() { return "The element paths are made of the visible names of the entries in the content structure separated with forward slashes (\/), starting with an initial slash."; } static getPathPositionDefault() { return "inplace"; } static getPathPositionDescription() { return "Selects the position where the entry should be created. The path passed in \"path\" will be interpreted based on this value.\n\n* before = An entry will be generated on the same level before the entry that was selected with \"path.\n* inplace = The entry selected with \"path\" will be treated as a parent element and will contain the new generated entry.\n* after = An entry will be generated on the same level after the entry that was selected with \"path."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new Item(data); } toJson() { var _a; return { 'actions': (_a = this.actions) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()), 'bold': this.bold, 'color': this.color, 'isOpen': this.isOpen, 'italic': this.italic, 'itemName': this.itemName, 'path': this.path, 'pathPosition': this.pathPosition, }; } clone() { return Item.fromJson(this.toJson()); } } exports.Item = Item; //# sourceMappingURL=Item.js.map