export type StatResult = { path: string; ctime: T; mtime: T; size: number; mode: number; originalFilepath: string; isFile: S; isDirectory: S; }; export type ReadDirItem = { ctime: T; mtime: T; name: string; path: string; size: string; isFile: S; isDirectory: S; }; export type DownloadFileOptions = { fromUrl: string; toFile: string; headers?: { [key: string]: string | number; }; background?: boolean; discretionary?: boolean; cacheable?: boolean; progressInterval?: number; progressDivider?: number; begin?: (res: DownloadBeginCallbackResult) => void; progress?: (res: DownloadProgressCallbackResult) => void; resumable?: () => void; connectionTimeout?: number; readTimeout?: number; backgroundTimeout?: number; }; export type DownloadResult = { jobId: number; statusCode: number; bytesWritten: number; }; export type DownloadError = { jobId: number; errorMessage: string; }; export type DownloadBeginCallbackResult = { jobId: number; statusCode: number; contentLength: number; headers: { [key: string]: string | number; }; }; export type DownloadProgressCallbackResult = { jobId: number; contentLength: number; bytesWritten: number; }; export type UploadFileOptions = { toUrl: string; binaryStreamOnly?: boolean; files: UploadFileItem[]; headers?: { [key: string]: string | number; }; fields?: { [key: string]: string | number; }; method?: string; begin?: (res: UploadBeginCallbackResult) => void; progress?: (res: UploadProgressCallbackResult) => void; }; export type UploadFileItem = { name: string; filename: string; filepath: string; filetype: string; }; export type UploadResult = { jobId: number; statusCode: number; headers: { [key: string]: string | number; }; body: string; }; export type UploadError = { jobId: number; errorMessage: string; }; export type UploadBeginCallbackResult = { jobId: number; }; export type UploadProgressCallbackResult = { jobId: number; totalBytesExpectedToSend: number; totalBytesSent: number; }; export type FSInfoResult = { totalSpace: number; freeSpace: number; totalSpaceEx?: number; freeSpaceEx?: number; encryptionEnabled: boolean; }; export type ScanResult = { jobId: number; path: string; }; export type ScanError = { jobId: number; errorMessage: string; }; export type Algorithms = "md5" | "sha1" | "sha224" | "sha256" | "sha384" | "sha512"; export type DownloadResultFunc = ((res: DownloadResult) => void) | undefined; export type DownloadErrorFunc = ((res: DownloadError) => void) | undefined; export type UploadResultFunc = ((res: UploadResult) => void) | undefined; export type UploadErrorFunc = ((res: UploadError) => void) | undefined; export type ScanResultFunc = ((res: ScanResult) => void) | undefined; export type OverloadedStatResult = S extends false | undefined ? StatResult<() => boolean, Date> : StatResult; export type OverloadedReadDirItem = T extends false | undefined ? ReadDirItem<() => boolean, Date> : ReadDirItem; export type OverloadedReadResult = T extends "uint8" | "uint16" | "uint32" | "float32" | Partial<{ encoding: "uint8" | "uint16" | "uint32" | "float32"; }> ? number[] : string; export type OverloadedDownloadResult = T extends undefined ? { jobId: number; promise: Promise; } : { jobId: number; }; export type OverloadedUploadResult = T extends undefined ? { jobId: number; promise: Promise; } : { jobId: number; }; export type OverloadedScanResult = T extends undefined ? Promise : { jobId: number; }; export type EncodingType = "utf8" | "base64" | "uint8" | "uint16" | "uint32" | "float32" | "ascii"; export type IOSProtectionTypes = "NSFileProtectionNone" | "NSFileProtectionComplete" | "NSFileProtectionCompleteUnlessOpen" | "NSFileProtectionCompleteUntilFirstUserAuthentication" | "NSFileProtectionCompleteWhenUserInactive"; export type ReadOptions = EncodingType | { encoding?: EncodingType; encrypted?: boolean; passphrase?: string | number[]; iv?: string | number[]; mode?: "ecb" | "cbc" | "cfb"; padding?: "ansi_x9.23" | "iso/iec_7816-4" | "pkcs5/pkcs7" | "zero" | "no"; } | undefined; export type WriteOptions = EncodingType | { encoding?: EncodingType; NSFileProtectionKey?: IOSProtectionTypes; encrypted?: boolean; passphrase?: string | number[]; iv?: string | number[]; mode?: "ecb" | "cbc" | "cfb"; padding?: "ansi_x9.23" | "iso/iec_7816-4" | "pkcs5/pkcs7" | "zero" | "no"; } | undefined; export type MoveCopyOptions = { NSFileProtectionKey?: IOSProtectionTypes; NSURLIsExcludedFromBackupKey?: boolean; } | undefined; export type MkdirOptions = { NSFileProtectionKey?: IOSProtectionTypes; NSURLIsExcludedFromBackupKey?: boolean; } | undefined; /** * Represents a single RNFSTurbo instance. */ export interface RNFSTurboInterface { readonly MainBundlePath: string; readonly CachesDirectoryPath: string; readonly DocumentDirectoryPath: string; readonly TemporaryDirectoryPath: string; readonly LibraryDirectoryPath: string; readonly ExternalDirectoryPath: string; readonly ExternalStorageDirectoryPath: string; readonly ExternalCachesDirectoryPath: string; readonly DownloadDirectoryPath: string; readonly PicturesDirectoryPath: string; readonly RoamingDirectoryPath: string; stat(filepath: string, isNewFormat?: T): OverloadedStatResult; readDir(dirpath: string, isNewFormat?: T): OverloadedReadDirItem[]; readDirAssets(dirpath: string, isNewFormat?: T): OverloadedReadDirItem[]; readdir(dirpath: string): string[]; readFile(filepath: string, options?: T): OverloadedReadResult; read(filepath: string, length: number, position: number, options?: T): OverloadedReadResult; readFileAssets(filepath: string, options?: ReadOptions): string[]; readFileRes(filepath: string, options?: ReadOptions): string[]; writeFile(filepath: string, contents: string | number[], options?: WriteOptions): void; appendFile(filepath: string, contents: string | number[], options?: WriteOptions): void; write(filepath: string, contents: string | number[], position?: number, options?: WriteOptions): void; moveFile(filepath: string, destPath: string, options?: MoveCopyOptions): void; copyFolder(srcFolderPath: string, destFolderPath: string, options?: MoveCopyOptions): void; copyFile(filepath: string, destPath: string, options?: MoveCopyOptions): void; copyFileAssets(filepath: string, destPath: string): void; copyFileRes(filepath: string, destPath: string): void; copyAssetsFileIOS(imageUri: string, destPath: string, width: number, height: number, scale?: number, compression?: number, resizeMode?: string): string | undefined; copyAssetsVideoIOS(videoUri: string, destPath: string): string | undefined; unlink(filepath: string, checkExistence?: boolean): void; exists(filepath: string): boolean; existsAssets(filepath: string): boolean; existsRes(filepath: string): boolean; hash(filepath: string, algorithm: Algorithms): string; touch(filepath: string, mtime?: Date | number, ctime?: Date | number): number; mkdir(filepath: string, options?: MkdirOptions): void; downloadFile(options: DownloadFileOptions, completeCallback?: T, errorCallback?: DownloadErrorFunc): OverloadedDownloadResult; stopDownload(jobId: number): void; resumeDownload(jobId: number): void; isResumable(jobId: number): boolean; completeHandlerIOS(jobId: number): void; uploadFiles(options: UploadFileOptions, completeCallback?: T, errorCallback?: UploadErrorFunc): OverloadedUploadResult; stopUpload(jobId: number): void; getFSInfo(): FSInfoResult; scanFile(path: string, completeCallback?: T): OverloadedScanResult; getAllExternalFilesDirs(): string[]; pathForGroup(groupIdentifier: string): string; } //# sourceMappingURL=Types.d.ts.map