/** * @description 图片相关的配置 * @author wangfupeng */ import Editor from '../editor/index' import { EMPTY_FN } from '../utils/const' import { ResType } from '../menus/img/upload-img' export type UploadVideoHooksType = { before?: ( xhr: XMLHttpRequest, editor: Editor, files: File[] ) => { prevent: boolean; msg: string } | void success?: (xhr: XMLHttpRequest, editor: Editor, result: ResType) => void fail?: (xhr: XMLHttpRequest, editor: Editor, err: ResType | string) => void error?: (xhr: XMLHttpRequest, editor: Editor) => void timeout?: (xhr: XMLHttpRequest, editor: Editor) => void customInsert?: ( inserImg: (this: Editor, src: string) => void, result: ResType, editor: Editor ) => void } export default { // 显示“插入视频” showLinkVideo: true, // 插入视频成功之后的回调函数 linkVideoCallback: EMPTY_FN, // 上传视频自定义参数 uploadVideoParams: {}, // 钩子函数 uploadVideoHooks: {}, // 上传视频超时时间 ms uploadVideoTimeout: 30 * 1000, // 自定义上传 customUploadVideo: null, }