import { IUploadFileSuccessFile } from './upload';
/**
 * OBS全局配置
 */
interface IGlobalOptions {
    /**
     * OBS为每个区域提供了一个Endpoint，用于处理该区域的访问请求。
     */
    readonly getToken: () => string;
    /**
     * 单文件上传和分片上传的文件大小分隔线，单位为字节，默认为 5MB（即 1024 * 1024 * 5）。当文件大小超过该阈值时，将使用分片上传；否则使用单文件上传。
     */
    fileSplitThreshold?: number;
}
/**
 * 上传选项接口
 */
interface IUploadOptions {
    /**
     * 要上传的文件。
     */
    sourceFile: File;
    /**
     * 文件分片大小，单位为字节。
     * 默认为5MB。
     */
    partSize?: number;
    /**
     * 上传开始的回调函数
     */
    onStart?: () => void;
    /**
     * 上传进度回调
     * @param event - 包含上传进度信息的对象
     * @param event.percent - 上传进度百分比
     */
    onProgress?: (event: {
        percent: number;
    }) => void;
    /**
     * 上传完成回调
     * @param event - 包含上传结果信息的对象
     * @param event.sourceFile - 文件对象
     * @param event.fileInfo - 文件上传信息
     */
    onSuccess?: (event: {
        sourceFile: File;
        fileInfo: IUploadFileSuccessFile;
    }) => void;
    /**
     * 上传失败回调
     * @param error - 错误对象
     */
    onError?: (error: Error) => void;
    /**
     * 取消上传回调
     */
    onAbort?: () => void;
    /**
     * 上传结束回调，无论成功或失败都会触发
     */
    onFinally?: () => void;
}
export type { IGlobalOptions, IUploadOptions };
