export type SegmenterResults = { image: CanvasImageSource; segmentationMask: CanvasImageSource; }; type SegmenterOptions = { selfieMode?: boolean; modelSelection?: number; }; export type Segmenter = { initialize(): Promise; setOptions(opts: SegmenterOptions): void; onResults(cb: (r: SegmenterResults) => void): void; send(input: { image: CanvasImageSource; }): Promise; close(): Promise; }; export declare const loadSegmenter: () => Promise; /** Most recent completed mask, or null before the first result. Non-blocking. */ export declare const getLatestMask: () => SegmenterResults | null; /** * Kick a new segmentation if none is in flight; returns immediately. The result * lands in `getLatestMask()` via the `onResults` handler registered at load. * No-op until the segmenter has finished loading. `inFlight` clears when `send` * settles, so a failed call cannot wedge the pipeline. */ export declare const requestMaskIfIdle: (image: CanvasImageSource) => void; export {}; //# sourceMappingURL=segmenter.d.ts.map