import { StringDict } from "../../../parsing/stringDict.js"; import { Page } from "./page.js"; import type { Prediction } from "./prediction.js"; import { Product } from "./product.js"; import { Extras } from "./extras/index.js"; /** * Generic base class for parsed v1 inference payloads. * * @typeParam DocT an extension of a `Prediction`. Is generic by default to * allow for easier optional `PageT` generic typing. * @typeParam PageT an extension of a `DocT` (`Prediction`). Should only be set * if a document's pages have specific implementation. */ export declare abstract class Inference { /** * A boolean denoting whether a given inference result was rotated. */ isRotationApplied?: boolean; /** * Name and version of a given product. */ product: Product; /** * Wrapper for a document's pages prediction. */ pages: Page[]; /** * A document's top-level `Prediction`. */ prediction: DocT; /** * Extraneous fields relating to specific tools for some APIs. */ extras?: Extras; /** * Name of a document's endpoint. Has a default value for OTS APIs. */ endpointName?: string; /** * A document's version. Has a default value for OTS APIs. */ endpointVersion?: string; constructor(rawPrediction: StringDict); /** * Default string representation. */ /** * Returns a human-readable representation of the inference payload. */ toString(): string; /** * Takes in an input string and replaces line breaks with `\n`. * @param outStr string to cleanup * @returns cleaned out string */ static cleanOutString(outStr: string): string; } /** * Factory to allow for static-like property access syntax in TypeScript. * Used to retrieve endpoint data for standard products. */ export declare class InferenceFactory { /** * Builds a blank product of the given type & sends back the endpointName & endpointVersion parameters of OTS classes. * Note: this is needed to avoid passing anything other than the class of the object to the parse()/enqueue() call. * @param inferenceClass Class of the product we are using * @returns {Inference} An empty instance of a given product. */ static getEndpoint(inferenceClass: new (httpResponse: StringDict) => T): [string, string]; }