react-native-fs-turbo
Version:
React-Native library for working with Android/iOS file system, written using JSI and C++ TurboModules
65 lines • 4.22 kB
TypeScript
import type { RNFSTurboInterface, OverloadedStatResult, OverloadedReadDirItem, Algorithms, MkdirOptions, OverloadedReadResult, DownloadFileOptions, DownloadResultFunc, DownloadErrorFunc, OverloadedDownloadResult, UploadFileOptions, UploadResultFunc, UploadErrorFunc, OverloadedUploadResult, FSInfoResult, ScanResultFunc, OverloadedScanResult, ReadOptions, WriteOptions, MoveCopyOptions } from "./Types";
/**
* A single RNFSTurbo instance.
*/
declare class RNFSTurbo implements RNFSTurboInterface {
private nativeInstance;
private functionCache;
private configuration;
/**
* Creates a new RNFSTurbo instance with the given Configuration.
* If no custom `id` is supplied, `'rnfsturbo'` will be used.
*/
constructor();
private getFunctionFromCache;
get MainBundlePath(): string;
get CachesDirectoryPath(): string;
get DocumentDirectoryPath(): string;
get TemporaryDirectoryPath(): string;
get LibraryDirectoryPath(): string;
get ExternalDirectoryPath(): string;
get ExternalStorageDirectoryPath(): string;
get ExternalCachesDirectoryPath(): string;
get DownloadDirectoryPath(): string;
get PicturesDirectoryPath(): string;
get RoamingDirectoryPath(): string;
stat<T extends boolean | undefined = false>(filepath: string, isNewFormat?: T): OverloadedStatResult<T>;
readDir<T extends boolean | undefined = false>(dirpath: string, isNewFormat?: T): OverloadedReadDirItem<T>[];
readDirAssets<T extends boolean | undefined = false>(dirpath: string, isNewFormat?: T): OverloadedReadDirItem<T>[];
readdir(dirpath: string): string[];
readFile<T extends ReadOptions = undefined>(filepath: string, options?: T): OverloadedReadResult<T>;
read<T extends ReadOptions = undefined>(filepath: string, length: number, position: number, options?: T): OverloadedReadResult<T>;
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<T extends DownloadResultFunc = undefined>(options: DownloadFileOptions, completeCallback?: T, errorCallback?: DownloadErrorFunc): OverloadedDownloadResult<T>;
stopDownload(jobId: number): void;
resumeDownload(jobId: number): void;
isResumable(jobId: number): boolean;
completeHandlerIOS(jobId: number): void;
uploadFiles<T extends UploadResultFunc = undefined>(options: UploadFileOptions, completeCallback?: T, errorCallback?: UploadErrorFunc): OverloadedUploadResult<T>;
stopUpload(jobId: number): void;
getFSInfo(): FSInfoResult;
scanFile<T extends ScanResultFunc = undefined>(path: string, completeCallback?: T): OverloadedScanResult<T>;
getAllExternalFilesDirs(): string[];
pathForGroup(groupIdentifier: string): string;
}
declare const RNFSTurboInstance: RNFSTurbo;
export default RNFSTurboInstance;
//# sourceMappingURL=RNFSTurbo.d.ts.map