import { ZipWriterConstructorOptions } from './zip'; /** 文件 */ type TFile = File & { webkitRelativePath: string; }; /** * # 上传文件 * ## 注意:必须通过用户事件触发该函数,比如 click 事件 * ## 示例: * ```ts * import { uploadFile } from 'can-can-word-bug' * document.body.addEventListener('click', async () => { * const res = await uploadFile({ * 'accept': 'image/*', // 接受所有图片文件 * multiple: false, // 是否多选 * capture: 'camera', // 'camera' | 'camcorder' | 'microphone' * directory: false, // 是否允许选择文件夹 * mozFullPath: false, // 是否返回完整路径,仅 Firefox 支持 * webkitRelativePath: false, // 是否返回 webkitRelativePath,仅 WebKit 支持 * zipOpts: false, // 是否压缩文件 * maxSize: false, // 最大文件大小,单位:字节 * checkAllFileSize: false // 是否检查所有文件大小,单位:字节 * }) * console.log(res) * }) * ``` */ declare const uploadFile: (opts?: Opts) => Promise; export default uploadFile;