UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

50 lines 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DetectBarcode = void 0; const index_1 = require("./../index"); class DetectBarcode { constructor(data) { let inputFormatDefault = "pdf"; this.inputFormat = typeof (data === null || data === void 0 ? void 0 : data.inputFormat) !== "undefined" ? data === null || data === void 0 ? void 0 : data.inputFormat : inputFormatDefault; let outputFormatDefault = "json"; this.outputFormat = typeof (data === null || data === void 0 ? void 0 : data.outputFormat) !== "undefined" ? data === null || data === void 0 ? void 0 : data.outputFormat : outputFormatDefault; this.selection = (data.selection || []).map(index_1.BarcodeSelection.fromJson); } static getInputFormatDefault() { return "pdf"; } static getInputFormatDescription() { return "Used to select the format of the file with the contents that will be scanned for barcodes.\n\n* pdf = PDF document\n* img = Image document (JPG, PNG, TIF)"; } static getOutputFormatDefault() { return "json"; } static getOutputFormatDescription() { return "Used to select the format in which the recognition results should be returned.\n\n* json = JSON\n* xml = XML"; } static getSelectionDefault() { return []; } static getSelectionDescription() { return ""; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new DetectBarcode(data); } toJson() { var _a; return { 'inputFormat': this.inputFormat, 'outputFormat': this.outputFormat, 'selection': (_a = this.selection) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()), }; } clone() { return DetectBarcode.fromJson(this.toJson()); } } exports.DetectBarcode = DetectBarcode; //# sourceMappingURL=DetectBarcode.js.map