/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments.js"; import * as core from "../../../../core/index.js"; import * as Mercoa from "../../../index.js"; export declare namespace Ocr { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token: core.Supplier; /** Override the X-API-Version header */ xApiVersion?: "2024-08-01"; /** Additional headers to include in requests. */ headers?: Record | undefined>; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Additional query string parameters to include in the request. */ queryParams?: Record; /** Additional headers to include in the request. */ headers?: Record | undefined>; /** Override the X-API-Version header */ xApiVersion?: "2024-08-01"; } } export declare class Ocr { protected readonly _options: Ocr.Options; constructor(_options: Ocr.Options); /** * Run OCR on an Base64 encoded image or PDF. This endpoint will block until the OCR is complete. * * @param {Mercoa.OcrRequest} request * @param {Ocr.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Mercoa.BadRequest} * @throws {@link Mercoa.Unauthorized} * @throws {@link Mercoa.Forbidden} * @throws {@link Mercoa.NotFound} * @throws {@link Mercoa.Conflict} * @throws {@link Mercoa.InternalServerError} * @throws {@link Mercoa.Unimplemented} * * @example * await client.ocr.ocr({ * vendorNetwork: "entity", * entityId: "ent_8f86116b-3b4d-4ded-99ef-3bc929d8c33c", * mimeType: "image/png", * image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII" * }) */ ocr(request: Mercoa.OcrRequest, requestOptions?: Ocr.RequestOptions): core.HttpResponsePromise; private __ocr; /** * Run OCR on an Base64 encoded image or PDF. This endpoint will return immediately and the OCR will be processed asynchronously. * * @param {Mercoa.OcrRequest} request * @param {Ocr.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Mercoa.BadRequest} * @throws {@link Mercoa.Unauthorized} * @throws {@link Mercoa.Forbidden} * @throws {@link Mercoa.NotFound} * @throws {@link Mercoa.Conflict} * @throws {@link Mercoa.InternalServerError} * @throws {@link Mercoa.Unimplemented} * * @example * await client.ocr.runAsyncOcr({ * vendorNetwork: "entity", * entityId: "ent_8f86116b-3b4d-4ded-99ef-3bc929d8c33c", * mimeType: "image/png", * image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII" * }) */ runAsyncOcr(request: Mercoa.OcrRequest, requestOptions?: Ocr.RequestOptions): core.HttpResponsePromise; private __runAsyncOcr; /** * Get the status and results of an asynchronous OCR job. * * @param {string} jobId * @param {Ocr.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Mercoa.BadRequest} * @throws {@link Mercoa.Unauthorized} * @throws {@link Mercoa.Forbidden} * @throws {@link Mercoa.NotFound} * @throws {@link Mercoa.Conflict} * @throws {@link Mercoa.InternalServerError} * @throws {@link Mercoa.Unimplemented} * * @example * await client.ocr.getAsyncOcr("ocr_8f86116b-3b4d-4ded-99ef-3bc929d8c33c") */ getAsyncOcr(jobId: string, requestOptions?: Ocr.RequestOptions): core.HttpResponsePromise; private __getAsyncOcr; protected _getAuthorizationHeader(): Promise; }