Skip to content

Commit

Permalink
Merge pull request ant-design#16851 from ant-design/fix/uploadFile-ty…
Browse files Browse the repository at this point in the history
…pe-again

fix: fix type of action and RcFile
  • Loading branch information
afc163 authored Jun 2, 2019
2 parents 7c0fd87 + c7bc6b7 commit 18d3dee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/upload/interface.tsx
Original file line number Diff line number Diff line change
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;
}

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

0 comments on commit 18d3dee

Please sign in to comment.