choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
58 lines (57 loc) • 2.23 kB
TypeScript
import React, { Component } from 'react';
import Dragger from './Dragger';
import { UploadChangeParam, UploadFile, UploadLocale, UploadProps, UploadState, UploadType } from './interface';
import { T } from './utils';
import ConfigContext, { ConfigContextValue } from '../config-provider/ConfigContext';
export { UploadProps };
export default class Upload extends Component<UploadProps, UploadState> {
static displayName: string;
static get contextType(): typeof ConfigContext;
static Dragger: typeof Dragger;
static defaultProps: {
type: UploadType;
multiple: boolean;
action: string;
data: {};
accept: string;
beforeUpload: typeof T;
showUploadList: boolean;
listType: string;
className: string;
disabled: boolean;
supportServerRender: boolean;
showFileSize: boolean;
};
context: ConfigContextValue;
recentUploadStatus: boolean | PromiseLike<any>;
progressTimer: any;
upload: any;
constructor(props: UploadProps);
componentWillUnmount(): void;
onStart: (file: UploadFile) => void;
autoUpdateProgress(_: any, file: UploadFile): void;
onSuccess: (response: any, file: UploadFile) => void;
onProgress: (e: {
percent: number;
}, file: UploadFile) => void;
onError: (error: Error, response: any, file: UploadFile) => void;
handleRemove(file: UploadFile): void;
handleManualRemove: (file: UploadFile) => void;
defaultReUpload(file: UploadFile): void;
/**
* 拖拽触发回调
* @param uploadFiles 拖拽后文件列表
*/
onDragEnd: (uploadFiles: UploadFile[]) => false | undefined;
onChange: (info: UploadChangeParam) => void;
componentWillReceiveProps(nextProps: UploadProps): void;
onFileDrop: (e: React.DragEvent<HTMLDivElement>) => void;
beforeUpload: (file: UploadFile, uploadFiles: UploadFile[]) => boolean | PromiseLike<any>;
clearProgressTimer(): void;
saveUpload: (node: any) => void;
getUpload: () => any;
setReplaceReuploadItem: (file: UploadFile) => void;
getPrefixCls(): string;
renderUploadList: (uploadLocale: UploadLocale) => JSX.Element;
render(): JSX.Element;
}