mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 21:59:41 +08:00
23dd825afd
* Fixes for supporting TypeScript 2.0.3 * Fixes for supporting TypeScript 2.0.3. Issue is #3358
58 lines
1.4 KiB
TypeScript
Executable File
58 lines
1.4 KiB
TypeScript
Executable File
import React from 'react';
|
|
|
|
export type UploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed'
|
|
|
|
export interface HttpRequestHeader {
|
|
[key: string]: string;
|
|
}
|
|
|
|
export interface File {
|
|
uid: number;
|
|
size: number;
|
|
name: string;
|
|
lastModifiedDate?: Date;
|
|
url?: string;
|
|
status?: UploadFileStatus;
|
|
percent?: number;
|
|
thumbUrl?: string;
|
|
originFileObj?: File;
|
|
}
|
|
|
|
export interface UploadChangeParam {
|
|
file: File;
|
|
fileList: Array<File>;
|
|
event?: { percent: number };
|
|
}
|
|
|
|
export interface UploadProps {
|
|
type?: 'drag' | 'select';
|
|
name?: string;
|
|
defaultFileList?: Array<File>;
|
|
fileList?: Array<File>;
|
|
action: string;
|
|
data?: Object | ((file: File) => any);
|
|
headers?: HttpRequestHeader;
|
|
showUploadList?: boolean;
|
|
multiple?: boolean;
|
|
accept?: string;
|
|
beforeUpload?: (file: File) => boolean | PromiseLike<any>;
|
|
onChange?: (info: UploadChangeParam) => void;
|
|
listType?: 'text' | 'picture' | 'picture-card';
|
|
className?: string;
|
|
onPreview?: (file: File) => void;
|
|
onRemove?: (file: File) => void;
|
|
supportServerRender?: boolean;
|
|
style?: React.CSSProperties;
|
|
disabled?: boolean;
|
|
prefixCls?: string;
|
|
}
|
|
|
|
export interface UploadListProps {
|
|
listType?: 'text' | 'picture' | 'picture-card';
|
|
onPreview?: (file: File) => void;
|
|
onRemove?: (file: File) => void;
|
|
items?: Array<File>;
|
|
progressAttr?: Object;
|
|
prefixCls?: string;
|
|
}
|