import { UploadFile, UploadProps } from 'antd'; type TAttachment = { id: string; url: string; type: string; name: string; size: number; width: number; height: number; }; /** * 用於 onChange 時,處理上傳功能的自定義 Hook * 與 antd Upload 搭配使用 * * 此 Hook 提供檔案上傳的狀態管理和處理邏輯,包括: * - 檔案列表管理 * - 上傳狀態追蹤 * - 附件 ID 管理 * - 整合 WordPress 媒體庫上傳 * * @param {Object} props - 配置選項 * @param {Function} [props.onUploading] - 上傳中的回調函數,參數為上傳中的檔案 * @param {Function} [props.onDone] - 上傳完成的回調函數,參數為上傳成功的附件資料 * @param {Function} [props.onError] - 上傳錯誤的回調函數,參數為錯誤的檔案 * @param {Function} [props.onRemoved] - 檔案被移除時的回調函數,參數為被移除的檔案 * @returns {Object} 上傳相關的狀態和方法 * @returns {UploadProps} returns.uploadProps - 合併後的 Upload 組件屬性 * @returns {UploadFile[]} returns.fileList - 當前上傳的檔案列表 * @returns {React.Dispatch>} returns.setFileList - 設置檔案列表的函數 * @returns {number|undefined} returns.attachmentId - 上傳的 WordPress 媒體庫中的附件 ID * @returns {boolean} returns.isUploading - 上傳狀態 */ export declare const useOnChangeUpload: (props?: { onUploading?: ((_file: UploadFile) => void) | undefined; onDone?: ((_file: UploadFile, _attachment: TAttachment) => void) | undefined; onError?: ((_file: UploadFile) => void) | undefined; onRemoved?: ((_file: UploadFile) => void) | undefined; } | undefined) => { uploadProps: UploadProps; fileList: UploadFile[]; setFileList: import('react').Dispatch[]>>; attachmentId: number | undefined; isUploading: boolean; }; export {};