import { type CanvasLike } from "ppu-ocv/web"; import type { FlattenedPaddleOcrResult, PaddleOcrResult } from "../core/base-paddle-ocr.service.js"; import { BasePaddleOcrService } from "../core/base-paddle-ocr.service.js"; import type { PaddleOptions, RecognizeOptions } from "../interface.js"; export type { FlattenedPaddleOcrResult, PaddleOcrResult }; /** * PaddleOcrService for Web/Browser environments. * Uses onnxruntime-web and ppu-ocv/web instead of their Node counterparts. */ export declare class PaddleOcrService extends BasePaddleOcrService { constructor(options?: PaddleOptions); protected initSessions(): Promise; /** * Loads a resource from a URL string, or the default URL. */ private _loadResource; /** * Initialize the OCR service by loading models, dictionary, and the OpenCV runtime. * * Must be called before `recognize()`. */ initialize(): Promise; isInitialized(): boolean; changeDetectionModel(model: ArrayBuffer | string): Promise; changeRecognitionModel(model: ArrayBuffer | string): Promise; changeTextDictionary(dictionary: ArrayBuffer | string): Promise; recognize(image: ArrayBuffer | CanvasLike, options: RecognizeOptions & { flatten: true; }): Promise; recognize(image: ArrayBuffer | CanvasLike, options?: RecognizeOptions & { flatten?: false; }): Promise; /** * Release all ONNX sessions and free resources. */ destroy(): Promise; } export default PaddleOcrService;