/**
 * WASM Type Adapter
 *
 * This module provides type adapters for converting between JavaScript/TypeScript
 * types and WASM-compatible types, handling File/Blob conversions, config normalization,
 * and result parsing.
 *
 * @example File Conversion
 * ```typescript
 * import { fileToUint8Array } from '@kreuzberg/wasm/adapters/wasm-adapter';
 *
 * const file = event.target.files[0];
 * const bytes = await fileToUint8Array(file);
 * const result = await extractBytes(bytes, file.type);
 * ```
 *
 * @example Config Normalization
 * ```typescript
 * import { configToJS } from '@kreuzberg/wasm/adapters/wasm-adapter';
 *
 * const config = {
 *   ocr: { backend: 'tesseract', language: 'eng' },
 *   chunking: { maxChars: 1000 }
 * };
 * const normalized = configToJS(config);
 * ```
 */
import type { ExtractionConfig, ExtractionResult } from "../types.d.ts";
/**
 * Convert a File or Blob to Uint8Array
 *
 * Handles both browser File API and server-side Blob-like objects,
 * providing a unified interface for reading binary data.
 *
 * @param file - The File or Blob to convert
 * @returns Promise resolving to the byte array
 * @throws {Error} If the file cannot be read or exceeds size limit
 *
 * @example
 * ```typescript
 * const file = document.getElementById('input').files[0];
 * const bytes = await fileToUint8Array(file);
 * const result = await extractBytes(bytes, 'application/pdf');
 * ```
 */
export declare function fileToUint8Array(file: File | Blob): Promise<Uint8Array>;
/**
 * Normalize ExtractionConfig for WASM processing
 *
 * Converts TypeScript configuration objects to a WASM-compatible format,
 * handling null values, undefined properties, and nested structures.
 *
 * @param config - The extraction configuration or null
 * @returns Normalized configuration object suitable for WASM
 *
 * @example
 * ```typescript
 * const config: ExtractionConfig = {
 *   ocr: { backend: 'tesseract' },
 *   chunking: { maxChars: 1000 }
 * };
 * const wasmConfig = configToJS(config);
 * ```
 */
export declare function configToJS(config: ExtractionConfig | null): Record<string, unknown>;
/**
 * Parse WASM extraction result and convert to TypeScript type
 *
 * Handles conversion of WASM-returned objects to proper ExtractionResult types,
 * including proper array conversions and type assertions for tables, chunks, and images.
 *
 * @param jsValue - The raw WASM result value
 * @returns Properly typed ExtractionResult
 * @throws {Error} If the result structure is invalid
 *
 * @example
 * ```typescript
 * const wasmResult = await wasmExtract(bytes, mimeType, config);
 * const result = jsToExtractionResult(wasmResult);
 * console.log(result.content);
 * ```
 */
export declare function jsToExtractionResult(jsValue: unknown): ExtractionResult;
/**
 * Wrap and format WASM errors with context
 *
 * Converts WASM error messages to JavaScript Error objects with proper context
 * and stack trace information when available.
 *
 * @param error - The error from WASM
 * @param context - Additional context about what operation failed
 * @returns A formatted Error object
 *
 * @internal
 *
 * @example
 * ```typescript
 * try {
 *   await wasmExtract(bytes, mimeType);
 * } catch (error) {
 *   throw wrapWasmError(error, 'extracting document');
 * }
 * ```
 */
export declare function wrapWasmError(error: unknown, context: string): Error;
/**
 * Validate that a WASM-returned value conforms to ExtractionResult structure
 *
 * Performs structural validation without full type checking,
 * useful for runtime validation of WASM output.
 *
 * @param value - The value to validate
 * @returns True if value appears to be a valid ExtractionResult
 *
 * @internal
 */
export declare function isValidExtractionResult(value: unknown): value is ExtractionResult;
//# sourceMappingURL=wasm-adapter.d.ts.map