UNPKG

@briancullen/aws-textract-parser

Version:

Library for converting AWS Textract responses into a more usable structure.

33 lines (32 loc) 1.36 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var types_1 = require("../types"); var BlockNode_1 = __importDefault(require("./BlockNode")); var DocumentNode = /** @class */ (function (_super) { __extends(DocumentNode, _super); function DocumentNode(pages) { var _this = _super.call(this, pages) || this; _this.blockType = types_1.BlockType.Document; pages.forEach(function (page) { return page.setParant(_this); }); _this.metadata = { pages: pages.length }; return _this; } return DocumentNode; }(BlockNode_1.default)); exports.default = DocumentNode;