mindee
Version:
Mindee Client Library for Node.js
28 lines (27 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayslipV3 = void 0;
const common_1 = require("../../../parsing/common");
const payslipV3Document_1 = require("./payslipV3Document");
/**
* Payslip API version 3 inference prediction.
*/
class PayslipV3 extends common_1.Inference {
constructor(rawPrediction) {
super(rawPrediction);
/** The endpoint's name. */
this.endpointName = "payslip_fra";
/** The endpoint's version. */
this.endpointVersion = "3";
/** The document's pages. */
this.pages = [];
this.prediction = new payslipV3Document_1.PayslipV3Document(rawPrediction["prediction"]);
rawPrediction["pages"].forEach((page) => {
if (page.prediction !== undefined && page.prediction !== null &&
Object.keys(page.prediction).length > 0) {
this.pages.push(new common_1.Page(payslipV3Document_1.PayslipV3Document, page, page["id"], page["orientation"]));
}
});
}
}
exports.PayslipV3 = PayslipV3;