UNPKG

5.13 kBSource Map (JSON)View Raw
1{"version":3,"file":"FileSystem.types.js","sourceRoot":"","sources":["../src/FileSystem.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,qBAYX;AAZD,WAAY,qBAAqB;IAC/B;;;;OAIG;IACH,6EAAc,CAAA;IACd;;;OAGG;IACH,6EAAc,CAAA;AAChB,CAAC,EAZW,qBAAqB,KAArB,qBAAqB,QAYhC;AAED,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,mFAAkB,CAAA;IAClB,yEAAa,CAAA;AACf,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAgFD,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB","sourcesContent":["export enum FileSystemSessionType {\n /*\n * Using this mode means that the downloading/uploading session on the native side will work even if the application is moved to background.\n *\n * If the task completes while the application is in background, the Promise will be either resolved immediately or (if the application execution has already been stopped) once the app is moved to foreground again.\n */\n BACKGROUND = 0,\n /*\n * Using this mode means that downloading/uploading session on the native side will be terminated once the application becomes inactive (e.g. when it goes to background).\n * Bringing the application to foreground again would trigger Promise rejection.\n */\n FOREGROUND = 1,\n}\n\nexport enum FileSystemUploadType {\n BINARY_CONTENT = 0,\n MULTIPART = 1,\n}\n\nexport type DownloadOptions = {\n md5?: boolean;\n cache?: boolean;\n headers?: Record<string, string>;\n /*\n * iOS only\n */\n sessionType?: FileSystemSessionType;\n};\n\nexport type FileSystemHttpResult = {\n headers: Record<string, string>;\n status: number;\n mimeType: string | null;\n};\n\nexport type FileSystemDownloadResult = FileSystemHttpResult & {\n uri: string;\n md5?: string;\n};\n\n/**\n * @deprecated Use `FileSystemDownloadResult` instead.\n */\nexport type DownloadResult = FileSystemDownloadResult;\n\nexport type FileSystemUploadOptions = (\n | {\n uploadType?: FileSystemUploadType.BINARY_CONTENT;\n }\n | {\n uploadType: FileSystemUploadType.MULTIPART;\n fieldName?: string;\n mimeType?: string;\n parameters?: Record<string, string>;\n }\n) & {\n headers?: Record<string, string>;\n httpMethod?: FileSystemAcceptedUploadHttpMethod;\n sessionType?: FileSystemSessionType;\n};\n\nexport type FileSystemUploadResult = FileSystemHttpResult & {\n body: string;\n};\n\nexport type DownloadProgressCallback = (data: DownloadProgressData) => void;\n\nexport type DownloadProgressData = {\n totalBytesWritten: number;\n totalBytesExpectedToWrite: number;\n};\n\nexport type DownloadPauseState = {\n url: string;\n fileUri: string;\n options: DownloadOptions;\n resumeData?: string;\n};\n\nexport type FileInfo =\n | {\n exists: true;\n uri: string;\n size: number;\n isDirectory: boolean;\n modificationTime: number;\n md5?: string;\n }\n | {\n exists: false;\n uri: string;\n size: undefined;\n isDirectory: false;\n modificationTime: undefined;\n md5: undefined;\n };\n\nexport enum EncodingType {\n UTF8 = 'utf8',\n Base64 = 'base64',\n}\n\nexport type FileSystemAcceptedUploadHttpMethod = 'POST' | 'PUT' | 'PATCH';\n\nexport type ReadingOptions = {\n encoding?: EncodingType | 'utf8' | 'base64';\n position?: number;\n length?: number;\n};\n\nexport type WritingOptions = {\n encoding?: EncodingType | 'utf8' | 'base64';\n};\n\nexport type ProgressEvent = {\n uuid: string;\n data: {\n totalBytesWritten: number;\n totalBytesExpectedToWrite: number;\n };\n};\n\nexport type FileSystemRequestDirectoryPermissionsResult =\n | {\n granted: true;\n directoryUri: string;\n }\n | {\n granted: false;\n };\n\ntype PlatformMethod = (...args: any[]) => Promise<any>;\n\nexport interface ExponentFileSystemModule {\n readonly name: 'ExponentFileSystem';\n readonly documentDirectory: string | null;\n readonly cacheDirectory: string | null;\n readonly bundledAssets: string | null;\n readonly bundleDirectory: string | null;\n readonly getInfoAsync?: PlatformMethod;\n readonly readAsStringAsync?: PlatformMethod;\n readonly writeAsStringAsync?: PlatformMethod;\n readonly deleteAsync?: PlatformMethod;\n readonly moveAsync?: PlatformMethod;\n readonly copyAsync?: PlatformMethod;\n readonly makeDirectoryAsync?: PlatformMethod;\n readonly readDirectoryAsync?: PlatformMethod;\n readonly downloadAsync?: PlatformMethod;\n readonly uploadAsync?: PlatformMethod;\n readonly downloadResumableStartAsync?: PlatformMethod;\n readonly downloadResumablePauseAsync?: PlatformMethod;\n readonly getContentUriAsync?: PlatformMethod;\n readonly getFreeDiskStorageAsync?: PlatformMethod;\n readonly getTotalDiskCapacityAsync?: PlatformMethod;\n readonly requestDirectoryPermissionsAsync?: PlatformMethod;\n readonly readSAFDirectoryAsync?: PlatformMethod;\n readonly makeSAFDirectoryAsync?: PlatformMethod;\n readonly createSAFFileAsync?: PlatformMethod;\n startObserving?: () => void;\n stopObserving?: () => void;\n addListener: (eventName: string) => void;\n removeListeners: (count: number) => void;\n}\n"]}
\No newline at end of file