UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

53 lines 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SignatureImage = void 0; const index_1 = require("./../index"); class SignatureImage { constructor(data) { this.data = index_1.SignatureFileData.fromJson(data.data); let opacityDefault = 50; this.opacity = typeof (data === null || data === void 0 ? void 0 : data.opacity) !== "undefined" ? data === null || data === void 0 ? void 0 : data.opacity : opacityDefault; let positionDefault = "center"; this.position = typeof (data === null || data === void 0 ? void 0 : data.position) !== "undefined" ? data === null || data === void 0 ? void 0 : data.position : positionDefault; } static getDataDescription() { return ""; } static getOpacityDefault() { return 50; } static getOpacityDescription() { return "Opacity of image as a percentage value between 0 and 100."; } static getOpacityMin() { return 0; } static getOpacityMax() { return 100; } static getPositionDefault() { return "center"; } static getPositionDescription() { return "Position of image within signature field:\n\n* center = Centred\n* left = Left\n* right = Right"; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new SignatureImage(data); } toJson() { var _a; return { 'data': (_a = this.data) === null || _a === void 0 ? void 0 : _a.toJson(), 'opacity': this.opacity, 'position': this.position, }; } clone() { return SignatureImage.fromJson(this.toJson()); } } exports.SignatureImage = SignatureImage; //# sourceMappingURL=SignatureImage.js.map