zy-react-library/components/Upload/index.d.ts

33 lines
977 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import type { UploadProps as AntUploadProps, UploadFile } from "antd/es/upload";
import type { FC, ReactNode } from "react";
/**
* Upload 组件属性
*/
export interface UploadProps extends Omit<AntUploadProps, "fileList"> {
/** 文件列表 */
value?: UploadFile[];
/** 图片分辨率限制,如 "1920*1080" */
ratio?: `${number}*${number}`;
/** 是否显示提示,默认 true */
showTip?: boolean;
/** 文件大小限制单位MB */
size?: number;
/** 自定义提示内容 */
tipContent?: ReactNode;
/** listType 为 text 时上传按钮文本 */
uploadButtonText?: string;
/** 要上传的文件类型,默认为 image */
fileType?: "image" | "video" | "document";
/** 获取上传过服务器删除的附件 */
onGetRemoveFile?: (file: UploadFile) => void;
}
/**
* 文件上传组件
* 支持文件格式、大小、分辨率验证,支持图片预览
*/
declare const Upload: FC<UploadProps>;
export default Upload;