jiaqingjiayi-xiaochengxu/甲情_甲意/miniprogram/node_modules/antd-mini/es/ImageUpload/props.d.ts

81 lines
2.5 KiB
TypeScript
Raw Normal View History

2024-12-01 11:56:54 +00:00
import { IBaseProps } from '../_util/base';
export type Status = 'uploading' | 'done' | 'error';
2024-11-10 07:01:22 +00:00
export interface File {
2024-12-01 11:56:54 +00:00
/**
* @description
*/
uid?: string;
/**
* @description
*/
url: string;
/**
* @description
*/
status?: Status;
2024-11-10 07:01:22 +00:00
}
export interface LocalFile {
2024-12-01 11:56:54 +00:00
path: string;
size?: number;
2024-11-10 07:01:22 +00:00
}
export interface IUploaderProps extends IBaseProps {
2024-12-01 11:56:54 +00:00
/**
* @description
* @default []
*/
defaultFileList: File[];
/**
* @description
*/
fileList: File[];
/**
* @description
*/
maxCount: number;
/**
* @description
* @default 'scaleToFill'
*/
imageMode: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'widthFix' | 'heightFix' | 'top' | 'bottom' | 'center' | 'left' | 'right' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
/**
* @description
* @default ['album', 'camera']
*/
sourceType: ['album'] | ['camera'] | ['camera', 'album'];
/**
* @description false Promise
*/
onBeforeUpload?: (localFileList: LocalFile[]) => boolean | Promise<LocalFile[]>;
/**
* @description
*/
onChooseImageError?: (err: any) => void;
/**
* @description
*/
onChange?: (v: Array<File>) => void;
/**
* @description false Promise
*/
onRemove?: (v: File) => boolean | Promise<boolean>;
/**
* @description
*/
onPreview?: (v: Array<File>) => void;
/**
* @description action字段时生效
*/
onUpload?: (localFile: LocalFile) => Promise<string>;
/**
* @description
* @default "上传中……"
*/
uploadingText?: string;
/**
* @description
* @default "上传失败"
*/
uploadfailedText?: string;
2024-11-10 07:01:22 +00:00
}
export declare const UploaderDefaultProps: Partial<IUploaderProps>;