@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
110 lines • 4.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Attachment = void 0;
const index_1 = require("./../index");
class Attachment {
constructor(data) {
let descriptionDefault = "";
this.description = typeof (data === null || data === void 0 ? void 0 : data.description) !== "undefined" ? data === null || data === void 0 ? void 0 : data.description : descriptionDefault;
this.documentType = index_1.Document.fromJson(data === null || data === void 0 ? void 0 : data.documentType);
let folderIdDefault = 0;
this.folderId = typeof (data === null || data === void 0 ? void 0 : data.folderId) !== "undefined" ? data === null || data === void 0 ? void 0 : data.folderId : folderIdDefault;
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;
let nameDefault = "";
this.name = typeof (data === null || data === void 0 ? void 0 : data.name) !== "undefined" ? data === null || data === void 0 ? void 0 : data.name : nameDefault;
let numberDefault = 0;
this.number = typeof (data === null || data === void 0 ? void 0 : data.number) !== "undefined" ? data === null || data === void 0 ? void 0 : data.number : numberDefault;
let objectKeyDefault = "";
this.objectKey = typeof (data === null || data === void 0 ? void 0 : data.objectKey) !== "undefined" ? data === null || data === void 0 ? void 0 : data.objectKey : objectKeyDefault;
let pageDefault = 0;
this.page = typeof (data === null || data === void 0 ? void 0 : data.page) !== "undefined" ? data === null || data === void 0 ? void 0 : data.page : pageDefault;
let sizeDefault = 0;
this.size = typeof (data === null || data === void 0 ? void 0 : data.size) !== "undefined" ? data === null || data === void 0 ? void 0 : data.size : sizeDefault;
}
static getDescriptionDefault() {
return "";
}
static getDescriptionDescription() {
return "The file description of the attachment.";
}
static getDocumentTypeDescription() {
return "";
}
static getFolderIdDefault() {
return 0;
}
static getFolderIdDescription() {
return "The numeric ID of the folder containing the attachment. (This is only relevant for PDF Collections\/Portfolios - otherwise attachments may not be arranged in a folder tree.)";
}
static getMimeTypeDefault() {
return "";
}
static getMimeTypeDescription() {
return "The attachment's MIME type.";
}
static getNameDefault() {
return "";
}
static getNameDescription() {
return "The file name of the attachment.";
}
static getNumberDefault() {
return 0;
}
static getNumberDescription() {
return "The position number of the attachment in the embedded files of the document.";
}
static getNumberMin() {
return 1;
}
static getObjectKeyDefault() {
return "";
}
static getObjectKeyDescription() {
return "The object ID of the attachment. **Info:** A PDF objects ID consists of two number, where the first number selects the object's number and the second the \"generation\" of the object. The object ID shall always be unique within the context of the document and can be used to select a specific object.";
}
static getPageDefault() {
return 0;
}
static getPageDescription() {
return "The page (if any), the attachment is placed on.";
}
static getPageMin() {
return 0;
}
static getSizeDefault() {
return 0;
}
static getSizeDescription() {
return "The byte size of the attachment.";
}
static getSizeMin() {
return 0;
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new Attachment(data);
}
toJson() {
var _a;
return {
'description': this.description,
'documentType': (_a = this.documentType) === null || _a === void 0 ? void 0 : _a.toJson(),
'folderId': this.folderId,
'mimeType': this.mimeType,
'name': this.name,
'number': this.number,
'objectKey': this.objectKey,
'page': this.page,
'size': this.size,
};
}
clone() {
return Attachment.fromJson(this.toJson());
}
}
exports.Attachment = Attachment;
//# sourceMappingURL=Attachment.js.map