/**
 * Import/export utilities for the Field Library
 * Handles validation, serialization, and format conversion
 */
import type { ElementRecord, ElementData } from '../types.js';
/**
 * Portable format for import/export (no DB metadata)
 */
export interface ExportElement {
    area: string;
    key: string;
    element: ElementData;
}
/**
 * Single validation error
 */
export interface ImportValidationError {
    index: number;
    field: string;
    message: string;
    snippet_parts?: {
        before: string;
        char: string;
        after: string;
    };
}
/**
 * Result of validating import data
 */
export interface ImportValidationResult {
    valid: boolean;
    elements: ExportElement[];
    errors: ImportValidationError[];
    warnings: string[];
    /** area.key values that already exist in the library */
    duplicates: string[];
}
/**
 * Export elements to portable JSON format
 */
export declare function export_elements(records: ElementRecord[]): ExportElement[];
/**
 * Export elements to JSON string
 */
export declare function export_to_json(records: ElementRecord[]): string;
/**
 * Validate raw JSON input for import
 */
export declare function validate_import(raw: unknown, existing_elements: ElementRecord[]): ImportValidationResult;
/**
 * Download a JSON string as a file
 */
export declare function download_json(json_string: string, filename: string): void;
//# sourceMappingURL=import_export.d.ts.map