declare global { interface Window { cv: any; } } /** * OpenCV.js builds to try, in order. Both are single-file builds with the WASM embedded, * so no companion `.wasm` request is needed. * * Note: opencv.org only publishes rolling branch builds — pinned version paths such as * `/4.10.0/opencv.js` were removed upstream and now return 404. `5.x` is the current * development line and `4.x` the stable line; the 4.x entry is a fallback for the case * where the 5.x build is temporarily broken or unavailable. */ export declare const DEFAULT_OPENCV_URLS: string[]; /** * Overrides which OpenCV.js build(s) to load — e.g. to self-host instead of using the CDN. * Must be called before anything triggers a load; ignored once loading has started. */ export declare function configureOpenCV(urls: string | string[]): void; /** * Lazily loads OpenCV.js, trying each configured build in order. * Rejects only when every candidate fails. Callers read `window.cv`. * * IMPORTANT: this promise must never resolve *with* the OpenCV module. Emscripten's * module object has its own `.then` method, so it is thenable — resolving a promise * with it makes the promise machinery try to adopt it and call `.then` forever, which * wedges the whole tab in an infinite microtask loop. Always resolve with `undefined` * and let callers read `window.cv`. */ export declare function loadOpenCV(): Promise; interface UseOpenCVResult { cv: any | null; ready: boolean; error: Error | null; } /** Lazily loads OpenCV.js from CDN. Starts loading only when `enabled` is true. */ export declare function useOpenCV(enabled?: boolean): UseOpenCVResult; export {};