/**
 * WASM Module Loader
 *
 * Handles WASM module loading, initialization, and state management.
 * Provides a clean interface for loading the Kreuzberg WASM module
 * with support for concurrent initialization calls.
 */
/**
 * Options for initializing the WASM module.
 */
export interface InitWasmOptions {
    /**
     * A pre-loaded WebAssembly.Module for the Kreuzberg WASM binary.
     *
     * Required in restricted edge environments (Cloudflare Workers, Vercel Edge,
     * Supabase edge functions) where the runtime cannot fetch `file://` URLs.
     * Import the `.wasm` file as a static import and pass it here.
     *
     * @example Cloudflare Workers
     * ```typescript
     * import wasmModule from '@kreuzberg/wasm/kreuzberg_wasm_bg.wasm';
     * import { initWasm } from '@kreuzberg/wasm';
     *
     * export default {
     *   async fetch(request: Request): Promise<Response> {
     *     await initWasm({ wasmModule });
     *     // ... use extraction functions
     *   }
     * };
     * ```
     *
     * @example Supabase Edge Functions (Deno)
     * ```typescript
     * import wasmModule from '@kreuzberg/wasm/kreuzberg_wasm_bg.wasm';
     * import { initWasm, extractBytes } from '@kreuzberg/wasm';
     *
     * Deno.serve(async (req: Request) => {
     *   await initWasm({ wasmModule });
     *   // ... use extraction functions
     * });
     * ```
     */
    wasmModule?: WebAssembly.Module;
}
import { getInitializationError, getWasmModule, isInitialized, type ModuleInfo, type WasmModule } from "./state.d.ts";
export type { ModuleInfo, WasmModule };
/**
 * Get the loaded WASM module
 *
 * @returns The WASM module instance or null if not loaded
 * @internal
 */
/**
 * Check if WASM module is initialized
 *
 * @returns True if WASM module is initialized, false otherwise
 */
/**
 * Get initialization error if module failed to load
 *
 * @returns The error that occurred during initialization, or null if no error
 * @internal
 */
export { getInitializationError, getWasmModule, isInitialized };
/**
 * Get WASM module version
 *
 * @throws {Error} If WASM module is not initialized
 * @returns The version string of the WASM module
 */
export declare function getVersion(): string;
/**
 * Initialize the WASM module
 *
 * This function must be called once before using any extraction functions.
 * It loads and initializes the WASM module in the current runtime environment,
 * automatically selecting the appropriate WASM variant for the detected runtime.
 *
 * Multiple calls to initWasm() are safe and will return immediately if already initialized.
 *
 * @param options - Optional configuration for WASM initialization
 * @throws {Error} If WASM module fails to load or is not supported in the current environment
 *
 * @example Basic Usage (Node.js / Browser)
 * ```typescript
 * import { initWasm } from '@kreuzberg/wasm';
 *
 * async function main() {
 *   await initWasm();
 *   // Now you can use extraction functions
 * }
 *
 * main().catch(console.error);
 * ```
 *
 * @example Cloudflare Workers
 * ```typescript
 * import wasmModule from '@kreuzberg/wasm/kreuzberg_wasm_bg.wasm';
 * import { initWasm, extractBytes } from '@kreuzberg/wasm';
 *
 * export default {
 *   async fetch(request: Request): Promise<Response> {
 *     await initWasm({ wasmModule });
 *     const bytes = new Uint8Array(await request.arrayBuffer());
 *     const result = await extractBytes(bytes, 'application/pdf');
 *     return new Response(JSON.stringify(result));
 *   }
 * };
 * ```
 *
 * @example With Error Handling
 * ```typescript
 * import { initWasm, getWasmCapabilities } from '@kreuzberg/wasm';
 *
 * async function initializeKreuzberg() {
 *   const caps = getWasmCapabilities();
 *   if (!caps.hasWasm) {
 *     throw new Error('WebAssembly is not supported in this environment');
 *   }
 *
 *   try {
 *     await initWasm();
 *     console.log('Kreuzberg initialized successfully');
 *   } catch (error) {
 *     console.error('Failed to initialize Kreuzberg:', error);
 *     throw error;
 *   }
 * }
 * ```
 */
export declare function initWasm(options?: InitWasmOptions): Promise<void>;
//# sourceMappingURL=wasm-loader.d.ts.map