1 | import React, { Component } from 'react';
|
2 | import Dragger from './Dragger';
|
3 | import { UploadChangeParam, UploadFile, UploadLocale, UploadProps, UploadState } from './interface';
|
4 | import { T } from './utils';
|
5 | export { UploadProps };
|
6 | export default class Upload extends Component<UploadProps, UploadState> {
|
7 | static displayName: string;
|
8 | static Dragger: typeof Dragger;
|
9 | static defaultProps: {
|
10 | type: string;
|
11 | multiple: boolean;
|
12 | action: string;
|
13 | data: {};
|
14 | accept: string;
|
15 | beforeUpload: typeof T;
|
16 | showUploadList: boolean;
|
17 | listType: string;
|
18 | className: string;
|
19 | disabled: boolean;
|
20 | supportServerRender: boolean;
|
21 | };
|
22 | recentUploadStatus: boolean | PromiseLike<any>;
|
23 | progressTimer: any;
|
24 | private upload;
|
25 | constructor(props: UploadProps);
|
26 | componentWillUnmount(): void;
|
27 | onStart: (file: UploadFile) => void;
|
28 | autoUpdateProgress(_: any, file: UploadFile): void;
|
29 | onSuccess: (response: any, file: UploadFile) => void;
|
30 | onProgress: (e: {
|
31 | percent: number;
|
32 | }, file: UploadFile) => void;
|
33 | onError: (error: Error, response: any, file: UploadFile) => void;
|
34 | handleRemove(file: UploadFile): void;
|
35 | handleManualRemove: (file: UploadFile) => void;
|
36 | /**
|
37 | * 拖拽触发回调
|
38 | * @param uploadFiles 拖拽后文件列表
|
39 | */
|
40 | onDragEnd: (uploadFiles: UploadFile[]) => false | undefined;
|
41 | onChange: (info: UploadChangeParam) => void;
|
42 | componentWillReceiveProps(nextProps: UploadProps): void;
|
43 | onFileDrop: (e: React.DragEvent<HTMLDivElement>) => void;
|
44 | beforeUpload: (file: UploadFile, uploadFiles: UploadFile[]) => boolean | PromiseLike<any>;
|
45 | clearProgressTimer(): void;
|
46 | saveUpload: (node: any) => void;
|
47 | renderUploadList: (uploadLocale: UploadLocale) => JSX.Element;
|
48 | render(): JSX.Element;
|
49 | }
|