/**
 * Import/Export Utilities
 *
 * Utilities for importing and exporting data in various formats (CSV, JSON).
 * Handles file validation, data processing, and bulk operations.
 */
import type { UploadedFile, ImportOptions, ExportOptions, ImportResult, ExportResult } from '../types/index.js';
export type { UploadedFile, ImportOptions, ExportOptions, ImportResult, ExportResult };
/**
 * Import/Export utilities object
 */
declare const importUtils: {
    /**
     * Validate file type
     * @param file - Uploaded file
     * @param allowedTypes - Array of allowed MIME types
     * @returns True if valid
     */
    validateFileType(file: UploadedFile, allowedTypes: string[]): boolean;
    /**
     * Parse CSV file
     * @param fileBuffer - File buffer
     * @param options - CSV parse options
     * @returns Parsed data array
     */
    parseCSV(fileBuffer: Buffer, options?: {
        delimiter?: string;
        columns?: boolean | string[];
        skip_empty_lines?: boolean;
        trim?: boolean;
    }): any[];
    /**
     * Parse JSON file
     * @param fileBuffer - File buffer
     * @returns Parsed data
     */
    parseJSON(fileBuffer: Buffer): any;
    /**
     * Process CSV-specific field types
     * Handles special conversions needed for CSV data
     * @param value - Field value
     * @param fieldType - Target field type
     * @returns Processed value
     */
    processCSVSpecificFields(value: any, fieldType: string): any;
    /**
     * Process JSON-specific field types
     * JSON data usually has better type preservation than CSV
     * @param value - Field value
     * @param fieldType - Target field type
     * @returns Processed value
     */
    processJSONSpecificFields(value: any, fieldType: string): any;
    /**
     * Validate import data row
     * @param row - Data row
     * @param collection - Collection name
     * @param skipValidation - Skip validation
     * @returns Validation result
     */
    validateRow(row: Record<string, any>, collection: string, skipValidation?: boolean): {
        valid: boolean;
        errors: string[];
    };
    /**
     * Apply field mapping to data row
     * @param row - Data row
     * @param mapping - Field name mapping (source -> target)
     * @returns Mapped row
     */
    applyMapping(row: Record<string, any>, mapping?: Record<string, string>): Record<string, any>;
    /**
     * Process import data - type conversion and validation
     * @param data - Array of data rows
     * @param collection - Collection name
     * @param format - Data format
     * @param mapping - Field mapping
     * @param skipValidation - Skip validation
     * @returns Processed data and errors
     */
    processImportData(data: any[], collection: string, format: "csv" | "json", mapping?: Record<string, string>, skipValidation?: boolean): {
        processed: any[];
        errors: Array<{
            row: number;
            error: string;
            data: any;
        }>;
    };
    /**
     * Export data to CSV
     * @param data - Data array
     * @param fields - Fields to include
     * @returns CSV string
     */
    exportToCSV(data: any[], fields?: string[]): string;
    /**
     * Export data to JSON
     * @param data - Data array
     * @param fields - Fields to include
     * @returns JSON string
     */
    exportToJSON(data: any[], fields?: string[]): string;
    /**
     * Chunk array into smaller batches
     * @param array - Array to chunk
     * @param size - Chunk size
     * @returns Array of chunks
     */
    chunkArray<T>(array: T[], size: number): T[][];
    /**
     * Get file extension
     * @param filename - Filename
     * @returns Extension without dot
     */
    getFileExtension(filename: string): string;
    /**
     * Detect format from file
     * @param file - Uploaded file
     * @returns Detected format or null
     */
    detectFormat(file: UploadedFile): "csv" | "json" | null;
};
export declare function validateFileType(file: any, expectedExtensions: string[], expectedMimeTypes: string[], fileTypeName: string): any;
export declare function processCSVSpecificFields(row: any, table: any): any;
export declare function processJSONSpecificFields(item: any, table: any): any;
export default importUtils;
//# sourceMappingURL=importUtils.d.ts.map