UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

88 lines 3.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AddToolboxAnnotation = void 0; const index_1 = require("./../index"); class AddToolboxAnnotation { constructor(data) { this.circle = (data.circle || []).map(index_1.CircleAnnotation.fromJson); this.freetext = (data.freetext || []).map(index_1.FreeTextAnnotation.fromJson); this.line = (data.line || []).map(index_1.LineAnnotation.fromJson); this.markup = (data.markup || []).map(index_1.MarkupAnnotation.fromJson); this.redact = (data.redact || []).map(index_1.RedactAnnotation.fromJson); this.rubberstamp = (data.rubberstamp || []).map(index_1.RubberStampAnnotation.fromJson); this.square = (data.square || []).map(index_1.SquareAnnotation.fromJson); this.text = (data.text || []).map(index_1.TextAnnotation.fromJson); } static getCircleDefault() { return []; } static getCircleDescription() { return ""; } static getFreetextDefault() { return []; } static getFreetextDescription() { return ""; } static getLineDefault() { return []; } static getLineDescription() { return ""; } static getMarkupDefault() { return []; } static getMarkupDescription() { return ""; } static getRedactDefault() { return []; } static getRedactDescription() { return ""; } static getRubberstampDefault() { return []; } static getRubberstampDescription() { return ""; } static getSquareDefault() { return []; } static getSquareDescription() { return ""; } static getTextDefault() { return []; } static getTextDescription() { return ""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new AddToolboxAnnotation(data); } toJson() { var _a, _b, _c, _d, _e, _f, _g, _h; return { 'circle': (_a = this.circle) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()), 'freetext': (_b = this.freetext) === null || _b === void 0 ? void 0 : _b.map((data) => data.toJson()), 'line': (_c = this.line) === null || _c === void 0 ? void 0 : _c.map((data) => data.toJson()), 'markup': (_d = this.markup) === null || _d === void 0 ? void 0 : _d.map((data) => data.toJson()), 'redact': (_e = this.redact) === null || _e === void 0 ? void 0 : _e.map((data) => data.toJson()), 'rubberstamp': (_f = this.rubberstamp) === null || _f === void 0 ? void 0 : _f.map((data) => data.toJson()), 'square': (_g = this.square) === null || _g === void 0 ? void 0 : _g.map((data) => data.toJson()), 'text': (_h = this.text) === null || _h === void 0 ? void 0 : _h.map((data) => data.toJson()), }; } clone() { return AddToolboxAnnotation.fromJson(this.toJson()); } } exports.AddToolboxAnnotation = AddToolboxAnnotation; //# sourceMappingURL=AddToolboxAnnotation.js.map