import type { CodegenTypes, TurboModule } from 'react-native'; export type FileStat = { /** * Filename does not include the path. */ filename: string; lastModified: number; path: string; /** * File size in bytes. */ size: number; type: 'directory' | 'file'; }; /** * Values are in bytes. */ export type FsStat = { internal_free: number; internal_total: number; external_free?: number; external_total?: number; }; export type NetworkType = 'any' | 'unmetered'; export type FetchInit = { body?: string; headers?: { [key: string]: string; }; method?: string; /** * Allowed connection. Throws if specified connection is unavailable. */ network?: NetworkType; /** * Output path. */ path?: string; }; export type FetchProgressEvent = { requestId: number; bytesRead: number; contentLength: number; done: boolean; }; export type FetchErrorEvent = { requestId: number; message: string; }; export type FetchCompleteEvent = { requestId: number; headers: { [key: string]: string; }; ok: boolean; redirected: boolean; status: number; statusText: string; url: string; }; export interface Spec extends TurboModule { readonly onFetchProgress: CodegenTypes.EventEmitter; readonly onFetchError: CodegenTypes.EventEmitter; readonly onFetchComplete: CodegenTypes.EventEmitter; appendFile(path: string, data: string, encoding: string): Promise; cancelFetch(requestId: CodegenTypes.Int32): Promise; concatFiles(source: string, target: string): Promise; cp(source: string, target: string): Promise; /** * `type` only used on Android. */ cpAsset(asset: string, target: string, type: string): Promise; cpExternal(source: string, targetName: string, dir: string): Promise; df(): Promise; exists(path: string): Promise; /** * Listen to `onFetch*` events from the `requestId`. */ fetch(requestId: CodegenTypes.Int32, resource: string, init: FetchInit): void; /** * Only defined on iOS & MacOS. */ getAppGroupDir(groupName: string): Promise; getConstants(): { CacheDir: string; DatabaseDir?: string; DocumentDir: string; LibraryDir?: string; MainBundleDir: string; SDCardDir?: string; }; hardlink(source: string, target: string): Promise; hash(path: string, algorithm: string): Promise; isDir(path: string): Promise; ls(path: string): Promise; mkdir(path: string): Promise; mv(source: string, target: string): Promise; readFile(path: string, encoding: string): Promise; readFileChunk(path: string, offset: CodegenTypes.Int32, length: CodegenTypes.Int32, encoding: string): Promise; stat(path: string): Promise; statDir(path: string): Promise; symlink(source: string, target: string): Promise; unlink(path: string): Promise; unzip(source: string, target: string): Promise; writeFile(path: string, data: string, encoding: string): Promise; } declare const _default: Spec; export default _default; //# sourceMappingURL=NativeFileAccess.d.ts.map