1export declare enum FileSystemSessionType { 2 BACKGROUND = 0, 3 FOREGROUND = 1 4} 5export declare enum FileSystemUploadType { 6 BINARY_CONTENT = 0, 7 MULTIPART = 1 8} 9export declare type DownloadOptions = { 10 md5?: boolean; 11 cache?: boolean; 12 headers?: Record<string, string>; 13 sessionType?: FileSystemSessionType; 14}; 15export declare type FileSystemHttpResult = { 16 headers: Record<string, string>; 17 status: number; 18 mimeType: string | null; 19}; 20export declare type FileSystemDownloadResult = FileSystemHttpResult & { 21 uri: string; 22 md5?: string; 23}; 24/** 25 * @deprecated Use `FileSystemDownloadResult` instead. 26 */ 27export declare type DownloadResult = FileSystemDownloadResult; 28export 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}; 40export declare type FileSystemUploadResult = FileSystemHttpResult & { 41 body: string; 42}; 43export declare type FileSystemNetworkTaskProgressCallback<T extends DownloadProgressData | UploadProgressData> = (data: T) => void; 44/** 45 * @deprecated use `NetworkTaskProgressCallback<DownloadProgressData>` instead 46 */ 47export declare type DownloadProgressCallback = FileSystemNetworkTaskProgressCallback<DownloadProgressData>; 48export declare type DownloadProgressData = { 49 totalBytesWritten: number; 50 totalBytesExpectedToWrite: number; 51}; 52export declare type UploadProgressData = { 53 totalByteSent: number; 54 totalBytesExpectedToSend: number; 55}; 56export declare type DownloadPauseState = { 57 url: string; 58 fileUri: string; 59 options: DownloadOptions; 60 resumeData?: string; 61}; 62export declare type FileInfo = { 63 exists: true; 64 uri: string; 65 size: number; 66 isDirectory: boolean; 67 modificationTime: number; 68 md5?: string; 69} | { 70 exists: false; 71 uri: string; 72 size: undefined; 73 isDirectory: false; 74 modificationTime: undefined; 75 md5: undefined; 76}; 77export declare enum EncodingType { 78 UTF8 = "utf8", 79 Base64 = "base64" 80} 81export declare type FileSystemAcceptedUploadHttpMethod = 'POST' | 'PUT' | 'PATCH'; 82export declare type ReadingOptions = { 83 encoding?: EncodingType | 'utf8' | 'base64'; 84 position?: number; 85 length?: number; 86}; 87export declare type WritingOptions = { 88 encoding?: EncodingType | 'utf8' | 'base64'; 89}; 90export declare type ProgressEvent<T> = { 91 uuid: string; 92 data: T; 93}; 94export declare type FileSystemRequestDirectoryPermissionsResult = { 95 granted: true; 96 directoryUri: string; 97} | { 98 granted: false; 99}; 100declare type PlatformMethod = (...args: any[]) => Promise<any>; 101export interface ExponentFileSystemModule { 102 readonly name: 'ExponentFileSystem'; 103 readonly documentDirectory: string | null; 104 readonly cacheDirectory: string | null; 105 readonly bundledAssets: string | null; 106 readonly bundleDirectory: string | null; 107 readonly getInfoAsync?: PlatformMethod; 108 readonly readAsStringAsync?: PlatformMethod; 109 readonly writeAsStringAsync?: PlatformMethod; 110 readonly deleteAsync?: PlatformMethod; 111 readonly moveAsync?: PlatformMethod; 112 readonly copyAsync?: PlatformMethod; 113 readonly makeDirectoryAsync?: PlatformMethod; 114 readonly readDirectoryAsync?: PlatformMethod; 115 readonly downloadAsync?: PlatformMethod; 116 readonly uploadAsync?: PlatformMethod; 117 readonly downloadResumableStartAsync?: PlatformMethod; 118 readonly downloadResumablePauseAsync?: PlatformMethod; 119 readonly getContentUriAsync?: PlatformMethod; 120 readonly getFreeDiskStorageAsync?: PlatformMethod; 121 readonly getTotalDiskCapacityAsync?: PlatformMethod; 122 readonly requestDirectoryPermissionsAsync?: PlatformMethod; 123 readonly readSAFDirectoryAsync?: PlatformMethod; 124 readonly makeSAFDirectoryAsync?: PlatformMethod; 125 readonly createSAFFileAsync?: PlatformMethod; 126 readonly networkTaskCancelAsync?: PlatformMethod; 127 readonly uploadTaskStartAsync?: PlatformMethod; 128 startObserving?: () => void; 129 stopObserving?: () => void; 130 addListener: (eventName: string) => void; 131 removeListeners: (count: number) => void; 132} 133export {}; 134//# sourceMappingURL=FileSystem.types.d.ts.map