UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

49 lines 2.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextExtractionLinks = void 0; class TextExtractionLinks { constructor(data) { let fromTextDefault = false; this.fromText = typeof (data === null || data === void 0 ? void 0 : data.fromText) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fromText : fromTextDefault; let protocolDefault = ""; this.protocol = typeof (data === null || data === void 0 ? void 0 : data.protocol) !== "undefined" ? data === null || data === void 0 ? void 0 : data.protocol : protocolDefault; let withoutProtocolDefault = true; this.withoutProtocol = typeof (data === null || data === void 0 ? void 0 : data.withoutProtocol) !== "undefined" ? data === null || data === void 0 ? void 0 : data.withoutProtocol : withoutProtocolDefault; } static getFromTextDefault() { return false; } static getFromTextDescription() { return "Advanced mode for extracting links When using this mode, links will not be extracted from annotations, but will instead be extracted directly from the text. This means that links that are not found in standard mode can be found with this advanced mode, provided that they are present in the form of text."; } static getProtocolDefault() { return ""; } static getProtocolDescription() { return "Provides the option of filtering the links being extracted by protocol. If multiple protocols are specified, they need to be separated with commas (e.g., \"http,https,ftp\"). The following values are valid: \"http\",\"https\",\"ftp\", \"telnet\",\"mailto\", \"file\", \"nntp\", and \"notes\"."; } static getWithoutProtocolDefault() { return true; } static getWithoutProtocolDescription() { return "When enabled, incomplete URLs from which the protocol information is missing will be extracted as well when extracting links from text. This would apply to the following examples, for instance:\n\n* \"www.webpdf.de\" - There is no protocol information. If the option is enabled and \"http\" links are searched for, the link will be extracted.\n* \"ftp.softvision.de\" - There is no protocol information here either. If the option is enabled and \"ftp\" links are searched for, the link will be extracted."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new TextExtractionLinks(data); } toJson() { return { 'fromText': this.fromText, 'protocol': this.protocol, 'withoutProtocol': this.withoutProtocol, }; } clone() { return TextExtractionLinks.fromJson(this.toJson()); } } exports.TextExtractionLinks = TextExtractionLinks; //# sourceMappingURL=TextExtractionLinks.js.map