UNPKG

mindee

Version:

Mindee Client Library for Node.js

35 lines (34 loc) 1.52 kB
import { ApiSettingsV2 } from "./apiSettingsV2"; import { InferenceParameters } from "../clientV2"; import { InferenceResponse, JobResponse } from "../parsing/v2"; import { InputSource } from "../input"; export declare class MindeeApiV2 { #private; settings: ApiSettingsV2; constructor(apiKey?: string); /** * Sends a file to the inference queue. * @param inputSource Local file loaded as an input. * @param params {InferenceParameters} parameters relating to the enqueueing options. * @category V2 * @throws Error if the server's response contains one. * @returns a `Promise` containing a job response. */ reqPostInferenceEnqueue(inputSource: InputSource, params: InferenceParameters): Promise<JobResponse>; /** * Requests the job of a queued document from the API. * Throws an error if the server's response contains one. * @param inferenceId The document's ID in the queue. * @category Asynchronous * @returns a `Promise` containing either the parsed result, or information on the queue. */ reqGetInference(inferenceId: string): Promise<InferenceResponse>; /** * Requests the results of a queued document from the API. * Throws an error if the server's response contains one. * @param jobId The document's ID in the queue. * @category Asynchronous * @returns a `Promise` containing either the parsed result, or information on the queue. */ reqGetJob(jobId: string): Promise<JobResponse>; }