import type { MainModule } from './WasmModule.js'; /** * Initializes the DsPdf WebAssembly module with flexible loading strategies. * * The initialization follows a priority order: * 1. Use DsPdfConfig.wasmFactory if available (highest priority) * 2. Load from DsPdfConfig.wasmUrl if specified * 3. Fallback to an embedded binary or the default '/assets/DsPdf.wasm' path * * The loader automatically chooses the most efficient method: * - If a WASM URL is provided, it relies on Emscripten's internal `instantiateAsync`, * which uses `WebAssembly.instantiateStreaming()` when possible (for caching and performance), * and falls back to `WebAssembly.instantiate()` otherwise. * - If a binary buffer is provided, it instantiates directly from memory. * * @returns {Promise} A fully initialized and ready-to-use WASM module instance. * @throws {Error} If the WASM loading or instantiation process fails. * * @example * // Default initialization * const module = await initDsPdfWasmModule(); * module.onRuntimeInitialized = () => { * // Module is ready for use * }; * * @example * // Custom URL initialization * DsPdfConfig.wasmUrl = '/assets/DsPdf.wasm'; * const module = await initDsPdfWasmModule(); */ export declare function initDsPdfWasmModule(): Promise;