Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix type of action and RcFile #16851

Merged
merged 2 commits into from Jun 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions components/upload/interface.tsx
Expand Up @@ -8,7 +8,12 @@ export interface HttpRequestHeader {

export interface RcFile extends File {
uid: string;
lastModifiedDate: Date;
readonly name: string;
readonly type: string;
readonly lastModified: number;
readonly lastModifiedDate: Date;
readonly size: number;
readonly webkitRelativePath: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只有webkitRelativePath 是需要加的 重复定义了 像name, type, lastModified, size都是 File 里本身就有的

}

export interface UploadFile {
Expand All @@ -27,7 +32,6 @@ export interface UploadFile {
error?: any;
linkProps?: any;
type: string;
webkitRelativePath?: string;
}

export interface UploadChangeParam<T extends object = UploadFile> {
Expand Down Expand Up @@ -59,7 +63,7 @@ export interface UploadProps {
name?: string;
defaultFileList?: Array<UploadFile>;
fileList?: Array<UploadFile>;
action?: string | ((file: UploadFile) => string) | ((file: UploadFile) => PromiseLike<string>);
action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
directory?: boolean;
data?: Object | ((file: UploadFile) => any);
headers?: HttpRequestHeader;
Expand Down