1 | export declare enum FileSystemSessionType {
|
2 | BACKGROUND = 0,
|
3 | FOREGROUND = 1
|
4 | }
|
5 | export declare enum FileSystemUploadType {
|
6 | BINARY_CONTENT = 0,
|
7 | MULTIPART = 1
|
8 | }
|
9 | export declare type DownloadOptions = {
|
10 | md5?: boolean;
|
11 | cache?: boolean;
|
12 | headers?: Record<string, string>;
|
13 | sessionType?: FileSystemSessionType;
|
14 | };
|
15 | export declare type FileSystemHttpResult = {
|
16 | headers: Record<string, string>;
|
17 | status: number;
|
18 | mimeType: string | null;
|
19 | };
|
20 | export declare type FileSystemDownloadResult = FileSystemHttpResult & {
|
21 | uri: string;
|
22 | md5?: string;
|
23 | };
|
24 |
|
25 |
|
26 |
|
27 | export declare type DownloadResult = FileSystemDownloadResult;
|
28 | export declare type FileSystemUploadOptions = ({
|
29 | uploadType?: FileSystemUploadType.BINARY_CONTENT;
|
30 | } | {
|
31 | uploadType: FileSystemUploadType.MULTIPART;
|
32 | fieldName?: string;
|
33 | mimeType?: string;
|
34 | parameters?: Record<string, string>;
|
35 | }) & {
|
36 | headers?: Record<string, string>;
|
37 | httpMethod?: FileSystemAcceptedUploadHttpMethod;
|
38 | sessionType?: FileSystemSessionType;
|
39 | };
|
40 | export declare type FileSystemUploadResult = FileSystemHttpResult & {
|
41 | body: string;
|
42 | };
|
43 | export declare type DownloadProgressCallback = (data: DownloadProgressData) => void;
|
44 | export declare type DownloadProgressData = {
|
45 | totalBytesWritten: number;
|
46 | totalBytesExpectedToWrite: number;
|
47 | };
|
48 | export declare type DownloadPauseState = {
|
49 | url: string;
|
50 | fileUri: string;
|
51 | options: DownloadOptions;
|
52 | resumeData?: string;
|
53 | };
|
54 | export declare type FileInfo = {
|
55 | exists: true;
|
56 | uri: string;
|
57 | size: number;
|
58 | isDirectory: boolean;
|
59 | modificationTime: number;
|
60 | md5?: string;
|
61 | } | {
|
62 | exists: false;
|
63 | uri: string;
|
64 | size: undefined;
|
65 | isDirectory: false;
|
66 | modificationTime: undefined;
|
67 | md5: undefined;
|
68 | };
|
69 | export declare enum EncodingType {
|
70 | UTF8 = "utf8",
|
71 | Base64 = "base64"
|
72 | }
|
73 | export declare type FileSystemAcceptedUploadHttpMethod = 'POST' | 'PUT' | 'PATCH';
|
74 | export declare type ReadingOptions = {
|
75 | encoding?: EncodingType | 'utf8' | 'base64';
|
76 | position?: number;
|
77 | length?: number;
|
78 | };
|
79 | export declare type WritingOptions = {
|
80 | encoding?: EncodingType | 'utf8' | 'base64';
|
81 | };
|
82 | export declare type ProgressEvent = {
|
83 | uuid: string;
|
84 | data: {
|
85 | totalBytesWritten: number;
|
86 | totalBytesExpectedToWrite: number;
|
87 | };
|
88 | };
|
89 | declare type PlatformMethod = (...args: any[]) => Promise<any>;
|
90 | export interface ExponentFileSystemModule {
|
91 | readonly name: 'ExponentFileSystem';
|
92 | readonly documentDirectory: string | null;
|
93 | readonly cacheDirectory: string | null;
|
94 | readonly bundledAssets: string | null;
|
95 | readonly bundleDirectory: string | null;
|
96 | readonly getInfoAsync?: PlatformMethod;
|
97 | readonly readAsStringAsync?: PlatformMethod;
|
98 | readonly writeAsStringAsync?: PlatformMethod;
|
99 | readonly deleteAsync?: PlatformMethod;
|
100 | readonly moveAsync?: PlatformMethod;
|
101 | readonly copyAsync?: PlatformMethod;
|
102 | readonly makeDirectoryAsync?: PlatformMethod;
|
103 | readonly readDirectoryAsync?: PlatformMethod;
|
104 | readonly downloadAsync?: PlatformMethod;
|
105 | readonly uploadAsync?: PlatformMethod;
|
106 | readonly downloadResumableStartAsync?: PlatformMethod;
|
107 | readonly downloadResumablePauseAsync?: PlatformMethod;
|
108 | readonly getContentUriAsync?: PlatformMethod;
|
109 | readonly getFreeDiskStorageAsync?: PlatformMethod;
|
110 | readonly getTotalDiskCapacityAsync?: PlatformMethod;
|
111 | startObserving?: () => void;
|
112 | stopObserving?: () => void;
|
113 | addListener: (eventName: string) => void;
|
114 | removeListeners: (count: number) => void;
|
115 | }
|
116 | export {};
|