UNPKG

mindee

Version:

Mindee Client Library for Node.js

27 lines (26 loc) 976 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CropperV1Page = void 0; const common_1 = require("../../parsing/common"); const standard_1 = require("../../parsing/standard"); const cropperV1Document_1 = require("./cropperV1Document"); /** * Cropper API version 1.1 page data. */ class CropperV1Page extends cropperV1Document_1.CropperV1Document { constructor(rawPrediction, pageId) { super(); /** List of documents found in the image. */ this.cropping = []; rawPrediction["cropping"].map((itemPrediction) => this.cropping.push(new standard_1.PositionField({ prediction: itemPrediction, pageId: pageId, }))); } toString() { const cropping = this.cropping.join("\n "); const outStr = `:Document Cropper: ${cropping}`.trimEnd(); return (0, common_1.cleanOutString)(outStr); } } exports.CropperV1Page = CropperV1Page;