UNPKG

mindee

Version:

Mindee Client Library for Node.js

33 lines (32 loc) 1.4 kB
import { StringDict, Prediction } from "../../parsing/common"; import { ClassificationField, ListField, CustomLines } from "../../parsing/custom"; /** * Document data for Custom builds. */ export declare class CustomV1Document implements Prediction { /** Map of fields for a Custom build. */ fields: Map<string, ListField>; /** Map of classification fields for a Custom build. */ classifications: Map<string, ClassificationField>; constructor(rawPrediction: StringDict, pageId?: number); /** * Sorts and sets fields between classification fields and regular fields. * Note: Currently, two types of fields possible in a custom API response: * fields having a list of values, and classification fields. * @param fieldName name of the field. * @param fieldValue value of the field. * @param pageId page the field was found on. */ protected setField(fieldName: string, fieldValue: any, pageId?: number): void; /** * Order column fields into line items. * @param anchorNames list of possible anchor fields. * @param fieldNames list of all column fields. * @param heightTolerance height tolerance to apply to lines. */ columnsToLineItems(anchorNames: string[], fieldNames: string[], heightTolerance?: number): CustomLines; /** * Default string representation. */ toString(): string; }