forked from owenmullings/react-native-file-picker
-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.d.ts
42 lines (34 loc) · 860 Bytes
/
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
export interface FilePickerOptions {
title?: string;
chooseFileButtonTitle?: string;
}
export type FilePickerFile = {
fileName: string;
type: string;
path: string;
uri: string;
};
export type FilePickerCancel = {
didCancel: boolean;
};
export type FilePickerError = {
error: Error;
};
export type FilePickerResult =
FilePickerCancel &
FilePickerError &
FilePickerFile;
declare class FilePickerManager {
public static showFilePicker(
callback: (result: FilePickerResult) => void
): void;
public static showFilePicker(
options: FilePickerOptions,
callback: (result: FilePickerResult) => void
): void;
public static showFilePicker(
optionsOrCallback: FilePickerOptions | ((result: FilePickerResult) => void),
callback?: (result: FilePickerResult) => void
): void;
}
export default FilePickerManager;