import { FilePreview } from '../components/AiChat.types'; import { AIChatLocale } from '../i18n'; /** * 文件上传验证结果 */ export interface FileValidationResult { valid: boolean; rejectedFiles: File[]; errors: string[]; } export type ValidationMessageKey = 'fileCountExceeded' | 'fileTypeNotAllowed' | 'totalSizeExceeded' | 'totalSizeExceededWithExisting'; /** * 校验选项:传入 locale 使用内置三语文案,或传入 getValidationMessage 自定义 */ export interface ValidateFileUploadOptions { locale?: AIChatLocale; getValidationMessage?: (key: ValidationMessageKey, params: Record) => string; } /** * 验证文件上传 * @param newFiles 新上传的文件列表 * @param existingFiles 已存在的文件列表 * @param config 上传配置 * @param options 可选,locale 或 getValidationMessage 用于 i18n 错误文案 * @returns 验证结果 */ export declare function validateFileUpload(newFiles: File[], existingFiles: FilePreview[], config?: { upload_size_limit?: number; upload_number_limit?: number; upload_file_type_limit?: string[]; upload_limit_message?: string; }, options?: ValidateFileUploadOptions): FileValidationResult; /** * 显示文件验证错误提示 * @param result 验证结果 */ export declare function showValidationErrors(result: FileValidationResult): void;