UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

61 lines 2.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileAttachment = void 0; const index_1 = require("./../index"); class FileAttachment { constructor(data) { this.annotation = index_1.FileAnnotation.fromJson(data === null || data === void 0 ? void 0 : data.annotation); let creatorDefault = ""; this.creator = typeof (data === null || data === void 0 ? void 0 : data.creator) !== "undefined" ? data === null || data === void 0 ? void 0 : data.creator : creatorDefault; this.data = index_1.AttachmentFileData.fromJson(data.data); let fileNameDefault = ""; this.fileName = typeof data.fileName !== "undefined" ? data.fileName : fileNameDefault; let mimeTypeDefault = ""; this.mimeType = typeof (data === null || data === void 0 ? void 0 : data.mimeType) !== "undefined" ? data === null || data === void 0 ? void 0 : data.mimeType : mimeTypeDefault; } static getAnnotationDescription() { return ""; } static getCreatorDefault() { return ""; } static getCreatorDescription() { return "Can be used to set an author for the attachment. If you leave this value blank, the currently active system user will be used."; } static getDataDescription() { return ""; } static getFileNameDefault() { return ""; } static getFileNameDescription() { return "Used to define the name under which the attachment in the document will be created."; } static getMimeTypeDefault() { return ""; } static getMimeTypeDescription() { return "Can be used to set an optional MIME data type for the attachment. If you leave this value blank, the \"application\/octet-stream\" MIME data type will be used."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new FileAttachment(data); } toJson() { var _a, _b; return { 'annotation': (_a = this.annotation) === null || _a === void 0 ? void 0 : _a.toJson(), 'creator': this.creator, 'data': (_b = this.data) === null || _b === void 0 ? void 0 : _b.toJson(), 'fileName': this.fileName, 'mimeType': this.mimeType, }; } clone() { return FileAttachment.fromJson(this.toJson()); } } exports.FileAttachment = FileAttachment; //# sourceMappingURL=FileAttachment.js.map