import { InferenceSession } from "onnxruntime-web"; import "../models/encoder.onnx"; import "../models/sam.onnx"; export type ClickType = "include" | "exclude"; export interface Click { x: number; y: number; type: ClickType; } type SessionOptions = InferenceSession.SessionOptions; export declare function initSegmentation(opts?: { encoderModelPath?: string; samModelPath?: string; sessionOptions?: SessionOptions; }): Promise; export declare class SegmentationSession { private sessionId; private imageKey; constructor(image: HTMLImageElement | HTMLCanvasElement); addClick(x: number, y: number, type?: ClickType): this; removeLastClick(): this; reset(): this; getClicks(): Click[]; getClickCount(): number; segment(image: HTMLImageElement | HTMLCanvasElement): Promise; getLastMask(): ImageData | null; dispose(): void; } export declare function createSession(image: HTMLImageElement | HTMLCanvasElement): SegmentationSession; export declare function segment(params: { image: HTMLImageElement | HTMLCanvasElement; clicks: Array<{ x: number; y: number; clickType: 0 | 1; }>; }): Promise; export declare function clearEmbeddingCache(): void; export declare function clearAllSessions(): void; /** * Precompute and cache the embedding for an image. * Use this function to prepare an image before making it available for user interaction. * * @param image The image to process * @returns A promise that resolves with the image key when embedding is complete */ export declare function precomputeEmbedding(image: HTMLImageElement | HTMLCanvasElement): Promise; export {};