UNPKG

xph-form

Version:

This is a configurable form component that supports React

28 lines (27 loc) 952 B
import React from "react"; import { UploadProps, UploadFile } from "antd"; type IFileList = Array<UploadFile>; declare const returnTypeMap: { String: string; "String[]": string; "File[]": string; FileList: string; }; export interface IAutoUploadProps extends UploadProps { /** 上传服务器的api,有api证明默认是上传服务器,否者默认返回File[] */ api?: (...args: any[]) => Promise<IFileList>; /** 上传的最大数量 */ maxCount?: number; /** 上传的最大大小,单位为M */ maxSize?: number; /** 返回类型(也就是表单获取到的类型) */ returnType?: keyof typeof returnTypeMap; /** 是否开启裁剪 */ openCrop?: boolean; /** 改变表单值事件 */ onChange?: (...args: any[]) => void; /** 默认文件列表(默认都是value字段) */ value: any; } declare const AutoUpload: React.FC<IAutoUploadProps>; export default AutoUpload;