import type { CanvasLike } from "ppu-ocv/web"; import { BaseDocLayoutService } from "../core/base-doclayout.service.js"; import type { DocLayoutOptions, DocLayoutResult, DocLayoutResultWithMasks } from "../interface.js"; /** * Document layout analysis service for Web/Browser environments. * * Uses onnxruntime-web (WebAssembly) to run PP-DocLayout models * directly inside the browser. * * @example * ```ts * import { DocLayoutService } from "ppu-doclayout/web"; * * const service = new DocLayoutService(); * await service.initialize(); * const result = await service.analyze(imageBuffer); * console.log(result.boxes); * await service.destroy(); * ``` */ export declare class DocLayoutService extends BaseDocLayoutService { constructor(options?: DocLayoutOptions); protected initSessions(): Promise; /** * Loads a resource from a URL or ArrayBuffer. */ private _loadResource; /** * Initialize the service by loading the ONNX model. * Must be called before {@link analyze}. */ initialize(): Promise; /** Checks if the service has been initialized. */ isInitialized(): boolean; /** * Swap the ONNX model at runtime. * * @param model - New model as a URL string or ArrayBuffer. */ changeModel(model: ArrayBuffer | string): Promise; /** * Run layout analysis on an image. * * @param image - Source image as `ArrayBuffer` or `CanvasLike`. * @returns Layout analysis result with detected regions in reading order. */ analyze(image: ArrayBuffer | CanvasLike): Promise; /** Release the ONNX session and free resources. */ destroy(): Promise; } export default DocLayoutService;