//#region ../infra/src/wasm/warmup.d.ts /** * All available ML pipelines in the SDK. * - 'selfie' - Face detection for selfie capture (default 4-model bundle) * - 'onDeviceSelfie' - Face detection + on-device liveness + age estimation * (6-model bundle for the on-device face-results submission flow). Mutually * exclusive with 'selfie' for a given session — both use FaceProcessingApi. * - 'idCapture' - Document detection for ID capture * - 'videoSelfie' - Face detection tuned for the video-selfie flow * (frame-aggregation best-shot; same 4-model bundle as 'selfie'). * - 'videoSelfieId' - Document detection tuned for the video-selfie flow * (simplified ID capture, no capturing-manager timer). */ type WasmPipeline = 'selfie' | 'onDeviceSelfie' | 'idCapture' | 'videoSelfie' | 'videoSelfieId'; interface WarmupConfig { /** * Self-hosted WASM root directory. When set, resolves standard filenames * (`webLib.wasm`, `webLib.js`, `models/`, etc.) under this path. * Individual path fields override values derived from `basePath`. * Pin a specific ml-wasm-kit version here when self-hosting so SDK updates * do not change which binaries your app loads. */ basePath?: string; wasmPath: string; wasmSimdPath?: string; glueCodePath: string; /** * Path to the SIMD-optimized WASM glue code (paired with `wasmSimdPath`). * If omitted, defaults to a sibling `.js` derived from `wasmSimdPath`. */ glueCodeSimdPath?: string; useSimd?: boolean; pipelines?: readonly WasmPipeline[]; /** * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`. * If not provided, models are expected to be in the same directory as the WASM files. */ modelsBasePath?: string; /** * Custom model files per pipeline. If not provided, uses default models. * Keys are pipeline names, values are arrays of model file names. */ pipelineModels?: Partial>; /** * On-device mode. When true, the native WASM module skips full fingerprint * collection on init and keeps only the device-detection DTO. Applied just * before the WASM module initializes. Omit to leave the current setting * (e.g. one already set via setup()'s `fingerprint` option) unchanged. */ onDeviceMode?: boolean; } /** * Preloads WASM binary and ML models at app startup. * Runs asynchronously - app can continue while WASM loads in background. * * Model files are automatically loaded based on the pipeline type. * By default, models are expected in a 'models' subdirectory relative to the WASM binary. * * @param config - Configuration for WASM warmup * @returns Promise that resolves when WASM is ready * * @example * ```ts * // Basic usage - models loaded from /wasm/v2/models/ * warmupWasm({ * wasmPath: '/wasm/v2/ml-wasm.wasm', * glueCodePath: '/wasm/v2/ml-wasm.js', * pipelines: ['selfie', 'idCapture'], * }); * * // With explicit models path * warmupWasm({ * wasmPath: '/wasm/v2/ml-wasm.wasm', * glueCodePath: '/wasm/v2/ml-wasm.js', * modelsBasePath: 'https://cdn.example.com/wasm/v2/models', * pipelines: ['selfie'], * }); * ``` */ declare function warmupWasm(config: WarmupConfig): Promise; //#endregion export { WasmPipeline as n, warmupWasm as r, WarmupConfig as t };