type MkdirOptions = { NSURLIsExcludedFromBackupKey?: boolean // iOS only NSFileProtectionKey?: string // IOS only } type FileOptions = { NSFileProtectionKey?: string // IOS only } type ReadDirItem = { ctime: Date | undefined // The creation date of the file (iOS only) mtime: Date | undefined // The last modified date of the file name: string // The name of the item path: string // The absolute path to the item size: string // Size in bytes isFile: () => boolean // Is the file just a file? isDirectory: () => boolean // Is the file a directory? } type StatResult = { name: string | undefined // The name of the item TODO: why is this not documented? path: string // The absolute path to the item size: string // Size in bytes mode: number // UNIX file mode ctime: number // Created date mtime: number // Last modified date originalFilepath: string // In case of content uri this is the pointed file path, otherwise is the same as path isFile: () => boolean // Is the file just a file? isDirectory: () => boolean // Is the file a directory? } type FSInfoResult = { totalSpace: number // The total amount of storage space on the device (in bytes). freeSpace: number // The amount of available storage space on the device (in bytes). } export function mkdir(filepath: string, options?: MkdirOptions): Promise export function moveFile( filepath: string, destPath: string, options?: FileOptions ): Promise export function copyFile( filepath: string, destPath: string, options?: FileOptions ): Promise export function pathForBundle(bundleNamed: string): Promise export function pathForGroup(groupName: string): Promise export function getFSInfo(): Promise export function getAllExternalFilesDirs(): Promise export function unlink(filepath: string): Promise export function exists(filepath: string): Promise export function readDir(dirpath: string): Promise /** * Android-only */ export function scanFile(path: string): Promise /** * Android-only */ export function readDirAssets(dirpath: string): Promise /** * Android-only */ export function existsAssets(filepath: string): Promise /** * Android-only */ export function existsRes(filepath: string): Promise /** * Node style version (lowercase d). Returns just the names */ export function readdir(dirpath: string): Promise /** * Android-only */ export function setReadable( filepath: string, readable: boolean, ownerOnly: boolean ): Promise export function stat(filepath: string): Promise export function readFile( filepath: string, encodingOrOptions?: any ): Promise export function read( filepath: string, length?: number, position?: number, encodingOrOptions?: any ): Promise /** * Android only */ export function readFileAssets( filepath: string, encodingOrOptions?: any ): Promise /** * Android only */ export function readFileRes( filepath: string, encodingOrOptions?: any ): Promise export function hash(filepath: string, algorithm: string): Promise /** * Android only */ export function copyFileAssets( filepath: string, destPath: string ): Promise /** * Android only */ export function copyFileRes( filepath: string, destPath: string ): Promise /** * iOS only * Copies fotos from asset-library (camera-roll) to a specific location * with a given width or height * @see: https://developer.apple.com/reference/photos/phimagemanager/1616964-requestimageforasset */ export function copyAssetsFileIOS( imageUri: string, destPath: string, width: number, height: number, scale?: number, compression?: number, resizeMode?: string ): Promise /** * iOS only * Copies fotos from asset-library (camera-roll) to a specific location * with a given width or height * @see: https://developer.apple.com/reference/photos/phimagemanager/1616964-requestimageforasset */ export function copyAssetsVideoIOS( imageUri: string, destPath: string ): Promise export function writeFile( filepath: string, contents: string, encodingOrOptions?: any ): Promise export function appendFile( filepath: string, contents: string, encodingOrOptions?: string ): Promise export function write( filepath: string, contents: string, position?: number, encodingOrOptions?: any ): Promise export function touch( filepath: string, mtime?: Date, ctime?: Date ): Promise // not accurate on ios export function canOpenFile( filepath: string, scheme?: string, ): Promise export function openFile( filepath: string, scheme?: string, ): Promise export const MainBundlePath: string export const CachesDirectoryPath: string export const ExternalCachesDirectoryPath: string export const DownloadDirectoryPath: string export const DocumentDirectoryPath: string export const ExternalDirectoryPath: string export const ExternalStorageDirectoryPath: string export const TemporaryDirectoryPath: string export const LibraryDirectoryPath: string export const PicturesDirectoryPath: string export const FileProtectionKeys: string