mindee 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/CHANGELOG.md +33 -19
  2. package/README.md +43 -127
  3. package/bin/mindee +3 -0
  4. package/dist/package.json +70 -0
  5. package/dist/src/api/endpoint.d.ts +29 -0
  6. package/dist/src/api/endpoint.js +148 -0
  7. package/dist/src/api/index.d.ts +2 -0
  8. package/dist/src/api/index.js +18 -0
  9. package/dist/src/api/response.d.ts +52 -0
  10. package/dist/src/api/response.js +107 -0
  11. package/dist/src/cli.d.ts +1 -0
  12. package/dist/src/cli.js +117 -0
  13. package/dist/src/client.d.ts +48 -0
  14. package/dist/src/client.js +134 -0
  15. package/dist/src/constants.d.ts +13 -0
  16. package/dist/src/constants.js +54 -0
  17. package/dist/src/documents/custom.d.ts +14 -0
  18. package/dist/src/documents/custom.js +48 -0
  19. package/dist/src/documents/document.d.ts +38 -0
  20. package/dist/src/documents/document.js +60 -0
  21. package/dist/src/documents/documentConfig.d.ts +44 -0
  22. package/dist/src/documents/documentConfig.js +121 -0
  23. package/dist/src/documents/financialDocument.d.ts +32 -0
  24. package/dist/src/documents/financialDocument.js +130 -0
  25. package/dist/src/documents/index.d.ts +12 -0
  26. package/dist/src/documents/index.js +20 -0
  27. package/dist/src/documents/invoice.d.ts +37 -0
  28. package/dist/src/documents/invoice.js +303 -0
  29. package/dist/src/documents/passport.d.ts +36 -0
  30. package/dist/src/documents/passport.js +218 -0
  31. package/dist/src/documents/receipt.d.ts +24 -0
  32. package/dist/src/documents/receipt.js +157 -0
  33. package/dist/src/errors/handler.d.ts +7 -0
  34. package/dist/src/errors/handler.js +18 -0
  35. package/dist/src/fields/amount.d.ts +13 -0
  36. package/dist/src/fields/amount.js +34 -0
  37. package/dist/src/fields/companyRegistration.d.ts +6 -0
  38. package/dist/src/fields/companyRegistration.js +11 -0
  39. package/dist/src/fields/customDocs.d.ts +42 -0
  40. package/dist/src/fields/customDocs.js +61 -0
  41. package/dist/src/fields/date.d.ts +12 -0
  42. package/dist/src/fields/date.js +25 -0
  43. package/dist/src/fields/field.d.ts +74 -0
  44. package/dist/src/fields/field.js +106 -0
  45. package/dist/src/fields/fullText.d.ts +24 -0
  46. package/dist/src/fields/fullText.js +89 -0
  47. package/dist/src/fields/index.d.ts +11 -0
  48. package/dist/src/fields/index.js +27 -0
  49. package/dist/src/fields/locale.d.ts +13 -0
  50. package/dist/src/fields/locale.js +40 -0
  51. package/dist/src/fields/orientation.d.ts +10 -0
  52. package/dist/src/fields/orientation.js +22 -0
  53. package/dist/src/fields/paymentDetails.d.ts +31 -0
  54. package/dist/src/fields/paymentDetails.js +58 -0
  55. package/dist/src/fields/tax.d.ts +30 -0
  56. package/dist/src/fields/tax.js +51 -0
  57. package/dist/src/geometry.d.ts +59 -0
  58. package/dist/src/geometry.js +113 -0
  59. package/dist/src/index.d.ts +2 -0
  60. package/dist/src/index.js +12 -0
  61. package/dist/src/inputs.d.ts +69 -0
  62. package/dist/src/inputs.js +223 -0
  63. package/dist/src/logger.d.ts +20 -0
  64. package/dist/src/logger.js +35 -0
  65. package/package.json +38 -28
  66. package/mindee/api/financialDocument.js +0 -47
  67. package/mindee/api/index.js +0 -5
  68. package/mindee/api/invoice.js +0 -53
  69. package/mindee/api/object.js +0 -82
  70. package/mindee/api/receipt.js +0 -39
  71. package/mindee/api/request.js +0 -72
  72. package/mindee/api/response.js +0 -80
  73. package/mindee/documents/document.js +0 -69
  74. package/mindee/documents/fields/amount.js +0 -25
  75. package/mindee/documents/fields/date.js +0 -29
  76. package/mindee/documents/fields/field.js +0 -86
  77. package/mindee/documents/fields/index.js +0 -7
  78. package/mindee/documents/fields/locale.js +0 -30
  79. package/mindee/documents/fields/orientation.js +0 -24
  80. package/mindee/documents/fields/paymentDetails.js +0 -52
  81. package/mindee/documents/fields/tax.js +0 -47
  82. package/mindee/documents/financialDocument.js +0 -269
  83. package/mindee/documents/index.js +0 -5
  84. package/mindee/documents/invoice.js +0 -456
  85. package/mindee/documents/receipt.js +0 -287
  86. package/mindee/errors/handler.js +0 -16
  87. package/mindee/index.js +0 -39
  88. package/mindee/inputs.js +0 -181
  89. package/mindee/logger.js +0 -34
@@ -0,0 +1,44 @@
1
+ import { Input } from "../inputs";
2
+ import { Response, Endpoint } from "../api";
3
+ import { Document } from "./index";
4
+ import { ResponseProps } from "../api/response";
5
+ interface CustomDocConstructor {
6
+ documentType: string;
7
+ accountName: string;
8
+ version: string;
9
+ apiKey: string;
10
+ }
11
+ export declare type responseSig<RespType extends Response<Document>> = {
12
+ new ({ httpResponse, documentType, input, error }: ResponseProps): RespType;
13
+ };
14
+ export declare class DocumentConfig {
15
+ readonly documentType: string;
16
+ readonly endpoints: Array<Endpoint>;
17
+ constructor(documentType: string, endpoints: Array<Endpoint>);
18
+ predictRequest(inputDoc: Input, includeWords?: boolean): Promise<unknown>;
19
+ buildResult<RespType extends Response<Document>>(responseType: responseSig<RespType>, inputFile: Input, response: any): RespType;
20
+ predict<RespType extends Response<Document>>(responseType: responseSig<RespType>, params: {
21
+ inputDoc: Input;
22
+ includeWords: boolean;
23
+ cutPages: boolean;
24
+ }): Promise<RespType>;
25
+ cutDocPages(inputDoc: Input, cutPages: boolean): Promise<void>;
26
+ protected checkApiKeys(): void;
27
+ }
28
+ export declare class InvoiceConfig extends DocumentConfig {
29
+ constructor(apiKey: string);
30
+ }
31
+ export declare class ReceiptConfig extends DocumentConfig {
32
+ constructor(apiKey: string);
33
+ }
34
+ export declare class FinancialDocConfig extends DocumentConfig {
35
+ constructor(apiKey: string);
36
+ predictRequest(inputDoc: Input, includeWords?: boolean): Promise<unknown>;
37
+ }
38
+ export declare class PassportConfig extends DocumentConfig {
39
+ constructor(apiKey: string);
40
+ }
41
+ export declare class CustomDocConfig extends DocumentConfig {
42
+ constructor({ documentType, accountName, version, apiKey, }: CustomDocConstructor);
43
+ }
44
+ export {};
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CustomDocConfig = exports.PassportConfig = exports.FinancialDocConfig = exports.ReceiptConfig = exports.InvoiceConfig = exports.DocumentConfig = void 0;
13
+ const api_1 = require("../api");
14
+ const index_1 = require("./index");
15
+ const handler_1 = require("../errors/handler");
16
+ class DocumentConfig {
17
+ constructor(documentType, endpoints) {
18
+ this.documentType = documentType;
19
+ this.endpoints = endpoints;
20
+ }
21
+ predictRequest(inputDoc, includeWords = false) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ return yield this.endpoints[0].predictRequest(inputDoc, includeWords);
24
+ });
25
+ }
26
+ buildResult(responseType, inputFile, response) {
27
+ if (response.statusCode > 201) {
28
+ const errorMessage = JSON.stringify(response.data, null, 4);
29
+ handler_1.errorHandler.throw(new Error(`${this.endpoints[0].urlName} API ${response.statusCode} HTTP error: ${errorMessage}`));
30
+ return new responseType({
31
+ httpResponse: response,
32
+ documentType: this.documentType,
33
+ input: inputFile,
34
+ error: true,
35
+ });
36
+ }
37
+ return new responseType({
38
+ httpResponse: response,
39
+ documentType: this.documentType,
40
+ input: inputFile,
41
+ error: false,
42
+ });
43
+ }
44
+ predict(responseType, params) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ this.checkApiKeys();
47
+ yield params.inputDoc.init();
48
+ yield this.cutDocPages(params.inputDoc, params.cutPages);
49
+ const response = yield this.predictRequest(params.inputDoc, params.includeWords);
50
+ return this.buildResult(responseType, params.inputDoc, response);
51
+ });
52
+ }
53
+ cutDocPages(inputDoc, cutPages) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ if (cutPages && inputDoc.isPdf()) {
56
+ yield inputDoc.cutPdf();
57
+ }
58
+ });
59
+ }
60
+ checkApiKeys() {
61
+ this.endpoints.forEach((endpoint) => {
62
+ if (!endpoint.apiKey) {
63
+ throw new Error(`Missing API key for '${endpoint.keyName}', check your Client configuration.
64
+ You can set this using the '${api_1.API_KEY_ENVVAR_NAME}' environment variable.\n`);
65
+ }
66
+ });
67
+ }
68
+ }
69
+ exports.DocumentConfig = DocumentConfig;
70
+ class InvoiceConfig extends DocumentConfig {
71
+ constructor(apiKey) {
72
+ const endpoints = [new api_1.InvoiceEndpoint(apiKey)];
73
+ super(index_1.DOC_TYPE_INVOICE, endpoints);
74
+ }
75
+ }
76
+ exports.InvoiceConfig = InvoiceConfig;
77
+ class ReceiptConfig extends DocumentConfig {
78
+ constructor(apiKey) {
79
+ const endpoints = [new api_1.ReceiptEndpoint(apiKey)];
80
+ super(index_1.DOC_TYPE_RECEIPT, endpoints);
81
+ }
82
+ }
83
+ exports.ReceiptConfig = ReceiptConfig;
84
+ class FinancialDocConfig extends DocumentConfig {
85
+ constructor(apiKey) {
86
+ const endpoints = [
87
+ new api_1.InvoiceEndpoint(apiKey),
88
+ new api_1.ReceiptEndpoint(apiKey),
89
+ ];
90
+ super(index_1.DOC_TYPE_FINANCIAL, endpoints);
91
+ }
92
+ predictRequest(inputDoc, includeWords = false) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ let endpoint;
95
+ if (inputDoc.isPdf()) {
96
+ endpoint = this.endpoints[0];
97
+ }
98
+ else {
99
+ endpoint = this.endpoints[1];
100
+ }
101
+ return yield endpoint.predictRequest(inputDoc, includeWords);
102
+ });
103
+ }
104
+ }
105
+ exports.FinancialDocConfig = FinancialDocConfig;
106
+ class PassportConfig extends DocumentConfig {
107
+ constructor(apiKey) {
108
+ const endpoints = [new api_1.PassportEndpoint(apiKey)];
109
+ super(index_1.DOC_TYPE_PASSPORT, endpoints);
110
+ }
111
+ }
112
+ exports.PassportConfig = PassportConfig;
113
+ class CustomDocConfig extends DocumentConfig {
114
+ constructor({ documentType, accountName, version, apiKey, }) {
115
+ const endpoints = [
116
+ new api_1.CustomEndpoint(documentType, accountName, version, apiKey),
117
+ ];
118
+ super(documentType, endpoints);
119
+ }
120
+ }
121
+ exports.CustomDocConfig = CustomDocConfig;
@@ -0,0 +1,32 @@
1
+ import { Document, DocumentConstructorProps } from "./document";
2
+ import { TaxField, Field, Amount, Locale, Orientation, DateField as Date, CompanyRegistration } from "../fields";
3
+ export declare class FinancialDocument extends Document {
4
+ #private;
5
+ pageId: number | undefined;
6
+ locale: Locale;
7
+ totalIncl: Amount;
8
+ date: Date;
9
+ dueDate: Date;
10
+ category: Field;
11
+ time: Field;
12
+ orientation: Orientation | undefined;
13
+ taxes: TaxField[];
14
+ totalTax: Amount;
15
+ totalExcl: Amount;
16
+ supplier: Field;
17
+ supplierAddress: Field;
18
+ invoiceNumber: Field;
19
+ companyRegistration: CompanyRegistration[];
20
+ customerName: Field;
21
+ customerAddress: Field;
22
+ paymentDetails: Field[];
23
+ customerCompanyRegistration: CompanyRegistration[];
24
+ /**
25
+ * @param {Object} apiPrediction - Json parsed prediction from HTTP response
26
+ * @param {Input} inputFile - input file given to parse the document
27
+ * @param {number} pageId - Page ID for multi-page document
28
+ * @param {FullText} fullText - full OCR extracted text
29
+ */
30
+ constructor({ apiPrediction, inputFile, fullText, pageId, }: DocumentConstructorProps);
31
+ toString(): string;
32
+ }
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var _FinancialDocument_instances, _FinancialDocument_initFromApiPrediction, _FinancialDocument_checklist, _FinancialDocument_taxesMatchTotalIncl;
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.FinancialDocument = void 0;
10
+ const document_1 = require("./document");
11
+ const invoice_1 = require("./invoice");
12
+ const receipt_1 = require("./receipt");
13
+ const fields_1 = require("../fields");
14
+ class FinancialDocument extends document_1.Document {
15
+ /**
16
+ * @param {Object} apiPrediction - Json parsed prediction from HTTP response
17
+ * @param {Input} inputFile - input file given to parse the document
18
+ * @param {number} pageId - Page ID for multi-page document
19
+ * @param {FullText} fullText - full OCR extracted text
20
+ */
21
+ constructor({ apiPrediction, inputFile = undefined, fullText = undefined, pageId = undefined, }) {
22
+ super(inputFile, pageId, fullText);
23
+ _FinancialDocument_instances.add(this);
24
+ this.taxes = [];
25
+ this.companyRegistration = [];
26
+ this.paymentDetails = [];
27
+ this.customerCompanyRegistration = [];
28
+ __classPrivateFieldGet(this, _FinancialDocument_instances, "m", _FinancialDocument_initFromApiPrediction).call(this, apiPrediction, inputFile, pageId);
29
+ __classPrivateFieldGet(this, _FinancialDocument_instances, "m", _FinancialDocument_checklist).call(this);
30
+ }
31
+ toString() {
32
+ const outStr = `-----Financial document-----
33
+ Filename: ${this.filename}
34
+ Total amount: ${this.totalIncl.value}
35
+ Date: ${this.date.value}
36
+ Supplier: ${this.supplier.value}
37
+ Total taxes: ${this.totalTax.value}
38
+ ----------------------
39
+ `;
40
+ return FinancialDocument.cleanOutString(outStr);
41
+ }
42
+ }
43
+ exports.FinancialDocument = FinancialDocument;
44
+ _FinancialDocument_instances = new WeakSet(), _FinancialDocument_initFromApiPrediction = function _FinancialDocument_initFromApiPrediction(prediction, inputFile, pageNumber) {
45
+ if (Object.keys(prediction).includes("invoice_number")) {
46
+ const invoice = new invoice_1.Invoice({
47
+ apiPrediction: prediction,
48
+ inputFile,
49
+ pageId: pageNumber,
50
+ });
51
+ this.locale = invoice.locale;
52
+ this.totalIncl = invoice.totalIncl;
53
+ this.totalExcl = invoice.totalExcl;
54
+ this.date = invoice.date;
55
+ this.invoiceNumber = invoice.invoiceNumber;
56
+ this.dueDate = invoice.dueDate;
57
+ this.taxes = invoice.taxes;
58
+ this.supplier = invoice.supplier;
59
+ this.supplierAddress = invoice.supplierAddress;
60
+ this.paymentDetails = invoice.paymentDetails;
61
+ this.companyRegistration = invoice.customerCompanyRegistration;
62
+ this.orientation = invoice.orientation;
63
+ this.totalTax = invoice.totalTax;
64
+ this.time = new fields_1.Field({
65
+ prediction: { value: undefined, confidence: 0.0 },
66
+ });
67
+ this.customerName = invoice.customerName;
68
+ this.customerAddress = invoice.customerAddress;
69
+ this.customerCompanyRegistration = invoice.customerCompanyRegistration;
70
+ }
71
+ else {
72
+ const receipt = new receipt_1.Receipt({
73
+ apiPrediction: prediction,
74
+ inputFile,
75
+ pageId: pageNumber,
76
+ });
77
+ this.orientation = receipt.orientation;
78
+ this.date = receipt.date;
79
+ this.dueDate = receipt.date;
80
+ this.taxes = receipt.taxes;
81
+ this.locale = receipt.locale;
82
+ this.totalIncl = receipt.totalIncl;
83
+ this.totalExcl = receipt.totalExcl;
84
+ this.supplier = receipt.merchantName;
85
+ this.supplierAddress = new fields_1.Field({
86
+ prediction: { value: undefined, confidence: 0.0 },
87
+ });
88
+ this.time = receipt.time;
89
+ this.totalTax = receipt.totalTax;
90
+ this.invoiceNumber = new fields_1.Field({
91
+ prediction: { value: undefined, confidence: 0.0 },
92
+ });
93
+ this.customerName = new fields_1.Field({
94
+ prediction: { value: undefined, confidence: 0.0 },
95
+ });
96
+ this.customerAddress = new fields_1.Field({
97
+ prediction: { value: undefined, confidence: 0.0 },
98
+ });
99
+ }
100
+ }, _FinancialDocument_checklist = function _FinancialDocument_checklist() {
101
+ this.checklist = {
102
+ taxesMatchTotalIncl: __classPrivateFieldGet(this, _FinancialDocument_instances, "m", _FinancialDocument_taxesMatchTotalIncl).call(this),
103
+ };
104
+ }, _FinancialDocument_taxesMatchTotalIncl = function _FinancialDocument_taxesMatchTotalIncl() {
105
+ // Check taxes and total include exist
106
+ if (this.taxes.length === 0 || this.totalIncl.value === undefined)
107
+ return false;
108
+ // Reconstruct totalIncl from taxes
109
+ let totalVat = 0;
110
+ let reconstructedTotal = 0;
111
+ this.taxes.forEach((tax) => {
112
+ if (tax.value === undefined || !tax.rate)
113
+ return false;
114
+ totalVat += tax.value;
115
+ reconstructedTotal += tax.value + (100 * tax.value) / tax.rate;
116
+ });
117
+ // Sanity check
118
+ if (totalVat <= 0)
119
+ return false;
120
+ // Crate epsilon
121
+ const eps = 1 / (100 * totalVat);
122
+ if (this.totalIncl.value * (1 - eps) - 0.02 <= reconstructedTotal &&
123
+ reconstructedTotal <= this.totalIncl.value * (1 + eps) + 0.02) {
124
+ this.taxes = this.taxes.map((tax) => (Object.assign(Object.assign({}, tax), { confidence: 1.0 })));
125
+ this.totalTax.confidence = 1.0;
126
+ this.totalIncl.confidence = 1.0;
127
+ return true;
128
+ }
129
+ return false;
130
+ };
@@ -0,0 +1,12 @@
1
+ import { Invoice } from "./invoice";
2
+ import { Receipt } from "./receipt";
3
+ import { Passport } from "./passport";
4
+ import { FinancialDocument } from "./financialDocument";
5
+ import { CustomDocument } from "./custom";
6
+ export { Document, DocumentConstructorProps } from "./document";
7
+ export { Receipt, Invoice, FinancialDocument, Passport, CustomDocument };
8
+ export declare const DOC_TYPE_INVOICE: string;
9
+ export declare const DOC_TYPE_RECEIPT: string;
10
+ export declare const DOC_TYPE_PASSPORT: string;
11
+ export declare const DOC_TYPE_FINANCIAL: string;
12
+ export declare const DOC_TYPE_CUSTOM: string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOC_TYPE_CUSTOM = exports.DOC_TYPE_FINANCIAL = exports.DOC_TYPE_PASSPORT = exports.DOC_TYPE_RECEIPT = exports.DOC_TYPE_INVOICE = exports.CustomDocument = exports.Passport = exports.FinancialDocument = exports.Invoice = exports.Receipt = exports.Document = void 0;
4
+ const invoice_1 = require("./invoice");
5
+ Object.defineProperty(exports, "Invoice", { enumerable: true, get: function () { return invoice_1.Invoice; } });
6
+ const receipt_1 = require("./receipt");
7
+ Object.defineProperty(exports, "Receipt", { enumerable: true, get: function () { return receipt_1.Receipt; } });
8
+ const passport_1 = require("./passport");
9
+ Object.defineProperty(exports, "Passport", { enumerable: true, get: function () { return passport_1.Passport; } });
10
+ const financialDocument_1 = require("./financialDocument");
11
+ Object.defineProperty(exports, "FinancialDocument", { enumerable: true, get: function () { return financialDocument_1.FinancialDocument; } });
12
+ const custom_1 = require("./custom");
13
+ Object.defineProperty(exports, "CustomDocument", { enumerable: true, get: function () { return custom_1.CustomDocument; } });
14
+ var document_1 = require("./document");
15
+ Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return document_1.Document; } });
16
+ exports.DOC_TYPE_INVOICE = invoice_1.Invoice.name;
17
+ exports.DOC_TYPE_RECEIPT = receipt_1.Receipt.name;
18
+ exports.DOC_TYPE_PASSPORT = passport_1.Passport.name;
19
+ exports.DOC_TYPE_FINANCIAL = financialDocument_1.FinancialDocument.name;
20
+ exports.DOC_TYPE_CUSTOM = custom_1.CustomDocument.name;
@@ -0,0 +1,37 @@
1
+ import { Document, DocumentConstructorProps } from "./document";
2
+ import { BaseField, TaxField, PaymentDetails, Orientation, Locale, Amount, Field, DateField, CompanyRegistration } from "../fields";
3
+ export declare class Invoice extends Document {
4
+ #private;
5
+ locale: Locale;
6
+ documentType: BaseField;
7
+ totalIncl: Amount;
8
+ date: DateField;
9
+ dueDate: DateField;
10
+ time: Field;
11
+ orientation: Orientation;
12
+ totalTax: Amount;
13
+ totalExcl: Amount;
14
+ supplier: Field;
15
+ supplierAddress: Field;
16
+ invoiceNumber: Field;
17
+ companyRegistration: CompanyRegistration[];
18
+ customerName: Field;
19
+ customerAddress: Field;
20
+ taxes: TaxField[];
21
+ paymentDetails: PaymentDetails[];
22
+ customerCompanyRegistration: CompanyRegistration[];
23
+ /**
24
+ * @param {Object} apiPrediction - Json parsed prediction from HTTP response
25
+ * @param {Input} inputFile - input file given to parse the document
26
+ * @param {number} pageId - Page ID for multi-page document
27
+ * @param {FullText} fullText - full OCR extracted text
28
+ */
29
+ constructor({ apiPrediction, inputFile, fullText, pageId, }: DocumentConstructorProps);
30
+ toString(): string;
31
+ private taxesMatchTotalIncl;
32
+ /**
33
+ *
34
+ */
35
+ private taxesMatchTotalExcl;
36
+ private taxesAndTotalExclMatchTotalIncl;
37
+ }