import type { Rectangle } from './ocr-engine'; import type { OcrWorker } from './ocr-worker'; /** * High-level async API for performing document image layout analysis and * OCR. */ export declare class OcrScheduler { private _workers; private _runningWorkers; constructor(workers: OcrWorker[]); private getWorker; destroy(): Promise; /** * Load a trained model for a specific language. This can be specified either * as a URL to fetch or a buffer containing an already-loaded model. */ loadModel(model: string | ArrayBuffer): Promise; /** * Perform layout analysis and text recognition on the current image, if * not already done, and return the image's text as a string. */ recognizeText(image: ImageBitmap | ImageData, rectangle?: Rectangle): Promise; /** * Set the value of a Tesseract configuration variable. * * For a list of configuration variables, see * https://github.com/tesseract-ocr/tesseract/blob/677f5822f247ccb12b4e026265e88b959059fb59/src/ccmain/tesseractclass.cpp#L53 * * If you have Tesseract installed locally, executing `tesseract --print-parameters` * will also display a list of configuration variables. */ setParameters(parameters: Record): Promise; }