UNPKG

mindee

Version:

Mindee Client Library for Node.js

29 lines (28 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CropperV1 = void 0; const common_1 = require("../../parsing/common"); const cropperV1Document_1 = require("./cropperV1Document"); const cropperV1Page_1 = require("./cropperV1Page"); /** * Cropper API version 1 inference prediction. */ class CropperV1 extends common_1.Inference { constructor(rawPrediction) { super(rawPrediction); /** The endpoint's name. */ this.endpointName = "cropper"; /** The endpoint's version. */ this.endpointVersion = "1"; /** The document's pages. */ this.pages = []; this.prediction = new cropperV1Document_1.CropperV1Document(); rawPrediction["pages"].forEach((page) => { if (page.prediction !== undefined && page.prediction !== null && Object.keys(page.prediction).length > 0) { this.pages.push(new common_1.Page(cropperV1Page_1.CropperV1Page, page, page["id"], page["orientation"])); } }); } } exports.CropperV1 = CropperV1;