import { StringDict } from "../../../parsing/stringDict.js"; /** * @property {object} prediction - Prediction object from HTTP response. * @property {string} valueKey - Key to use in the prediction dict. * @property {boolean} reconstructed - Is the object reconstructed (not extracted by the API). * @property {number} pageId - Page ID for multi-page document. */ /** * Constructor payload shared by standard v1 fields. */ export interface BaseFieldConstructor { /** * Raw field payload from API response. */ prediction: StringDict; /** * Key to read from `prediction` as field value. */ valueKey?: string; /** * Whether the field was reconstructed locally. */ reconstructed?: boolean; /** * Optional page identifier for multi-page documents. */ pageId?: number; } /** * Base class for most fields. */ export declare class BaseField { /** * The value. */ value?: string | number | boolean; /** * `true` when the field was reconstructed or computed using other fields. */ reconstructed: boolean; /** * Page ID for multi-page document. */ pageId?: number; /** * @param {BaseFieldConstructor} constructor Constructor parameters. */ constructor({ prediction, valueKey, reconstructed, pageId, }: BaseFieldConstructor); /** * Compares two field values for semantic equality. */ compare(other: BaseField): boolean; /** * @param {BaseField[]} array - Array of Fields * @returns {number} Sum of all the Fields values in the array */ static arraySum(array: BaseField[]): number; /** * Default string representation. */ toString(): string; }