import * as RNFileSystem from 'react-native-fs' ; export namespace FileSystem { export type DownloadResult = RNFileSystem . DownloadResult ; } export class FileSystemAdapter { private fileSystem : typeof RNFileSystem ; public readonly CachesDirectoryPath = RNFileSystem . CachesDirectoryPath ; public readonly DocumentDirectoryPath = RNFileSystem . DocumentDirectoryPath ; public constructor ( fileSystem ) { this . fileSystem = fileSystem ; } public mkdir ( dir ) { return this . fileSystem . mkdir ( dir ) ; } public exists ( path ) { return this . fileSystem . exists ( path ) ; } public unlink ( path ) { return this . fileSystem . unlink ( path ) ; } public downloadFile ( options ) { return this . fileSystem . downloadFile ( options ) ; } }