import { E as ExportConfig, a as ExportRequest, b as ExportResult, c as ExportProgress, d as ExportFormat, F as Formatter } from '../types-BINlP9MK.js';
export { D as DataTransformer, f as ExportConfigError, g as ExportDataError, r as ExportError, t as ExportEvent, u as ExportEventListener, s as ExportEventType, m as ExportField, h as ExportFileError, p as ExportFilter, e as ExportServiceError, q as ExportSort, k as ExportStatus, j as FieldAlignment, v as FieldMapper, i as FieldType, l as GroupValueProcessing, o as GroupingConfig, n as GroupingField, G as GroupingMode, U as UniversalExportServiceConfig, V as Validator } from '../types-BINlP9MK.js';

/**
 * 通用导出服务客户端SDK
 *
 * 提供与后端API交互的客户端接口
 */

interface UniversalExportClientConfig {
    /** API基础URL */
    baseUrl?: string;
    /** 请求超时时间(毫秒) */
    timeout?: number;
    /** 自定义请求头 */
    headers?: Record<string, string>;
}
/**
 * 通用导出服务客户端
 */
declare class UniversalExportClient {
    private config;
    constructor(config?: UniversalExportClientConfig);
    /**
     * 获取模块的导出配置列表
     */
    getConfigsByModule(moduleId: string, businessId?: string): Promise<ExportConfig[]>;
    /**
     * 创建导出配置
     */
    createConfig(config: Omit<ExportConfig, 'id' | 'createdAt' | 'updatedAt'>): Promise<ExportConfig>;
    /**
     * 更新导出配置
     */
    updateConfig(configId: string, updates: Partial<ExportConfig>): Promise<ExportConfig>;
    /**
     * 删除导出配置
     */
    deleteConfig(configId: string): Promise<void>;
    /**
     * 触发数据导出
     */
    exportData(request: Omit<ExportRequest, 'callbacks'>): Promise<ExportResult>;
    /**
     * 查询导出进度
     */
    getExportProgress(exportId: string): Promise<ExportProgress>;
    /**
     * 下载导出文件
     */
    downloadExportFile(exportId: string): Promise<Blob>;
    /**
     * 获取请求头
     */
    private getHeaders;
    /**
     * 带超时的fetch请求
     */
    private fetchWithTimeout;
    /**
     * 转换API返回的配置数据
     */
    private transformConfigFromAPI;
    /**
     * 转换API返回的配置列表
     */
    private transformConfigsFromAPI;
    /**
     * 转换API返回的导出结果
     */
    private transformExportResultFromAPI;
    /**
     * 转换API返回的进度数据
     */
    private transformProgressFromAPI;
}
/**
 * 默认客户端实例
 */
declare const universalExportClient: UniversalExportClient;
/**
 * 创建自定义客户端实例
 */
declare function createExportClient(config?: UniversalExportClientConfig): UniversalExportClient;

/**
 * 通用导出服务常量定义
 */

/** 模块版本 */
declare const UNIVERSAL_EXPORT_VERSION = "1.0.0";
/** 模块名称 */
declare const UNIVERSAL_EXPORT_NAME = "@lyricnote/universal-export";
/** 默认导出格式 */
declare const DEFAULT_EXPORT_FORMAT: ExportFormat;
/** 默认CSV分隔符 */
declare const DEFAULT_CSV_DELIMITER = ",";
/** 默认编码格式 */
declare const DEFAULT_ENCODING = "utf-8";
/** 默认是否添加BOM */
declare const DEFAULT_ADD_BOM = true;
/** 默认最大文件大小(字节) - 100MB */
declare const DEFAULT_MAX_FILE_SIZE: number;
/** 默认最大行数限制 */
declare const DEFAULT_MAX_ROWS = 100000;
/** 默认并发导出数量 */
declare const DEFAULT_MAX_CONCURRENT_EXPORTS = 5;
/** 默认导出超时时间(毫秒) - 5分钟 */
declare const DEFAULT_EXPORT_TIMEOUT = 300000;
/** 默认配置缓存TTL(秒) - 1小时 */
declare const DEFAULT_CONFIG_CACHE_TTL = 3600;
/** 默认结果缓存TTL(秒) - 30分钟 */
declare const DEFAULT_RESULT_CACHE_TTL = 1800;
/** 导出格式对应的文件扩展名 */
declare const EXPORT_FORMAT_EXTENSIONS: Record<ExportFormat, string>;
/** 导出格式对应的MIME类型 */
declare const EXPORT_FORMAT_MIME_TYPES: Record<ExportFormat, string>;
/** API基础路径 */
declare const API_BASE_PATH = "/api/universal-export";
/** API端点 */
declare const API_ENDPOINTS: {
    /** 获取配置列表 */
    readonly GET_CONFIGS: "/api/universal-export/configs";
    /** 创建配置 */
    readonly CREATE_CONFIG: "/api/universal-export/configs";
    /** 更新配置 */
    readonly UPDATE_CONFIG: (configId: string) => string;
    /** 删除配置 */
    readonly DELETE_CONFIG: (configId: string) => string;
    /** 触发导出 */
    readonly EXPORT_DATA: "/api/universal-export/export";
    /** 查询导出进度 */
    readonly GET_PROGRESS: (exportId: string) => string;
    /** 下载导出文件 */
    readonly DOWNLOAD_FILE: (exportId: string) => string;
};
/** 错误代码 */
declare const ERROR_CODES: {
    /** 导出配置错误 */
    readonly EXPORT_CONFIG_ERROR: "EXPORT_CONFIG_ERROR";
    /** 导出数据错误 */
    readonly EXPORT_DATA_ERROR: "EXPORT_DATA_ERROR";
    /** 导出文件错误 */
    readonly EXPORT_FILE_ERROR: "EXPORT_FILE_ERROR";
    /** 网络错误 */
    readonly NETWORK_ERROR: "NETWORK_ERROR";
    /** 超时错误 */
    readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
    /** 未授权 */
    readonly UNAUTHORIZED: "UNAUTHORIZED";
    /** 服务器错误 */
    readonly SERVER_ERROR: "SERVER_ERROR";
};

/**
 * 通用导出服务工具函数
 */

/**
 * 生成导出文件名
 */
declare function generateExportFileName(template: string, format: ExportFormat): string;
/**
 * 验证文件名是否合法
 */
declare function validateFileName(fileName: string): boolean;
/**
 * 清理文件名，移除非法字符
 */
declare function sanitizeFileName(fileName: string): string;
/**
 * 转义CSV字段
 */
declare function escapeCSVField(value: string, delimiter?: string): string;
/**
 * 解析CSV字段
 */
declare function parseCSVField(field: string): string;
/**
 * 内置格式化器集合
 */
declare const DEFAULT_FORMATTERS: Record<string, Formatter>;
/**
 * 应用格式化器
 */
declare function applyFormatter(value: any, formatter?: Formatter, type?: string): string;
/**
 * 验证导出配置
 */
declare function validateExportConfig(config: any): {
    valid: boolean;
    errors: string[];
};
/**
 * 验证导出请求
 */
declare function validateExportRequest(request: any): {
    valid: boolean;
    errors: string[];
};
/**
 * 格式化文件大小
 */
declare function formatFileSize(bytes: number): string;
/**
 * 格式化持续时间
 */
declare function formatDuration(milliseconds: number): string;
/**
 * 计算预计完成时间
 */
declare function estimateEndTime(startTime: Date, processedRows: number, totalRows: number): Date | undefined;
/**
 * 获取嵌套对象的值
 */
declare function getNestedValue(obj: any, path: string): any;
/**
 * 设置嵌套对象的值
 */
declare function setNestedValue(obj: any, path: string, value: any): void;
/**
 * 创建导出错误对象
 */
declare function createExportError(code: string, message: string, details?: Record<string, any>): {
    code: string;
    message: string;
    details?: Record<string, any>;
    timestamp: Date;
};
/**
 * 格式化错误消息
 */
declare function formatErrorMessage(error: unknown): string;

export { API_BASE_PATH, API_ENDPOINTS, DEFAULT_ADD_BOM, DEFAULT_CONFIG_CACHE_TTL, DEFAULT_CSV_DELIMITER, DEFAULT_ENCODING, DEFAULT_EXPORT_FORMAT, DEFAULT_EXPORT_TIMEOUT, DEFAULT_FORMATTERS, DEFAULT_MAX_CONCURRENT_EXPORTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_ROWS, DEFAULT_RESULT_CACHE_TTL, ERROR_CODES, EXPORT_FORMAT_EXTENSIONS, EXPORT_FORMAT_MIME_TYPES, ExportConfig, ExportFormat, ExportProgress, ExportRequest, ExportResult, Formatter, UNIVERSAL_EXPORT_NAME, UNIVERSAL_EXPORT_VERSION, UniversalExportClient, type UniversalExportClientConfig, applyFormatter, createExportClient, createExportError, escapeCSVField, estimateEndTime, formatDuration, formatErrorMessage, formatFileSize, generateExportFileName, getNestedValue, parseCSVField, sanitizeFileName, setNestedValue, universalExportClient, validateExportConfig, validateExportRequest, validateFileName };
