forked from odysseyscience/react-s3-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
52 lines (45 loc) · 1.47 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
declare module 'react-s3-uploader' {
import { Component } from 'react';
export interface S3Response {
signedUrl: string;
publicUrl: string;
filename: string;
fileKey: string;
}
export interface ReactS3UploaderProps {
signingUrl?: string;
signingUrlMethod?: 'GET' | 'POST';
getSignedUrl?: (file: File, callback: (params: { signedUrl: string; }) => any) => any;
accept?: string;
s3path?: string;
preprocess?: (file: File, next: (file: File) => any) => any;
onSignedUrl?: (response: S3Response) => any;
onProgress?: (percent: number, status: string, file: File) => any;
onError?: (message: string) => any;
onFinish?: (result: S3Response, file: File) => any;
signingUrlHeaders?: {
additional: object;
};
signingUrlQueryParams?: {
additional: object;
};
signingUrlWithCredentials?: boolean;
uploadRequestHeaders?: object;
contentDisposition?: string;
server?: string;
inputRef?: (ref: HTMLInputElement) => any;
autoUpload?: boolean;
scrubFilename?: (filename: string) => string;
[key: string]: any;
}
class ReactS3Uploader extends React.Component<ReactS3UploaderProps, any> { }
export default ReactS3Uploader;
}
declare module 'react-s3-uploader/s3upload' {
import { ReactS3UploaderProps } from 'react-s3-uploader';
class S3Upload {
constructor(options: ReactS3UploaderProps);
uploadFile: (file: File) => Promise<S3Response>;
}
export default S3Upload;
}