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

88 lines
2.1 KiB
TypeScript
Raw Normal View History

2024-11-10 07:01:22 +00:00
import { IBaseProps } from '../_base';
export type Status = 'uploading' | 'done' | 'error'
export interface File {
/**
* @description
*/
uid?: string;
/**
* @description
*/
url: string;
/**
* @description
*/
status?: Status;
}
export interface LocalFile {
path: string;
size?: number;
}
export interface IUploaderProps extends IBaseProps {
/**
* @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'] | ['album', 'camera'];
/**
* @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>;
}
export declare const UploaderDefaultProps: Partial<IUploaderProps>;