UNPKG

my-uniapp-tools

Version:

一个简洁稳定的 uni-app 开发工具库,提供剪贴板、本地存储、导航、系统信息等常用功能

45 lines (44 loc) 1.82 kB
/** * 上传模块常量配置 * @description * 将魔法数字和硬编码字符串提取为常量,提升代码可维护性和可读性 */ /** 性能配置 */ export declare const PERFORMANCE: { /** 进度Toast节流间隔(毫秒) */ readonly THROTTLE_MS: 200; }; /** 提示消息模板 */ export declare const MESSAGES: { readonly UPLOADING: "上传中"; readonly UPLOAD_SUCCESS: "上传成功"; readonly UPLOAD_FAILED: "上传失败"; readonly UPLOAD_CANCELED: "已取消上传"; readonly SELECT_FAILED: "选择文件失败"; readonly USER_CANCELED: "用户取消选择"; readonly NO_FILES_SELECTED: "未选择任何文件"; readonly FILE_TOO_LARGE: (maxMB: number) => string; readonly PART_FILES_TOO_LARGE: (maxMB: number) => string; readonly UNSUPPORTED_TYPE: (extensions: string[]) => string; readonly NO_FILES_ALLOWED: "当前不允许选择文件"; readonly ENV_NOT_SUPPORT_SELECT: "当前环境不支持文件选择"; readonly PLATFORM_NOT_SUPPORT_SELECT: "当前平台不支持文件选择"; readonly ENV_NOT_SUPPORT_UPLOAD: "当前环境不支持文件上传"; readonly UPLOAD_TIMEOUT: (timeoutMs: number) => string; readonly UPLOAD_URL_REQUIRED: "上传地址不能为空"; readonly H5_FILE_MISSING: "H5 环境缺少原生文件对象"; readonly BEFORE_UPLOAD_FAILED: (msg: string) => string; readonly UPLOAD_REQUEST_FAILED: (msg: string) => string; readonly STATUS_CODE_ERROR: (code: number) => string; }; /** 默认配置值 */ export declare const DEFAULTS: { /** 默认表单字段名 */ readonly FIELD_NAME: "file"; /** 默认选择文件类型 */ readonly FILE_TYPE: "image"; /** 默认选择数量 */ readonly COUNT: 1; /** 是否显示Toast */ readonly SHOW_TOAST: true; };