MCPcopy Create free account
hub / github.com/alpha0010/react-native-file-access / Spec

Interface Spec

src/NativeFileAccess.ts:65–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65export interface Spec extends TurboModule {
66 readonly onFetchProgress: CodegenTypes.EventEmitter<FetchProgressEvent>;
67 readonly onFetchError: CodegenTypes.EventEmitter<FetchErrorEvent>;
68 readonly onFetchComplete: CodegenTypes.EventEmitter<FetchCompleteEvent>;
69
70 appendFile(path: string, data: string, encoding: string): Promise<void>;
71 cancelFetch(requestId: CodegenTypes.Int32): Promise<void>;
72 concatFiles(source: string, target: string): Promise<number>;
73 cp(source: string, target: string): Promise<void>;
74 /**
75 * `type` only used on Android.
76 */
77 cpAsset(asset: string, target: string, type: string): Promise<void>;
78 cpExternal(source: string, targetName: string, dir: string): Promise<void>;
79 df(): Promise<FsStat>;
80 exists(path: string): Promise<boolean>;
81 /**
82 * Listen to `onFetch*` events from the `requestId`.
83 */
84 fetch(requestId: CodegenTypes.Int32, resource: string, init: FetchInit): void;
85 /**
86 * Only defined on iOS & MacOS.
87 */
88 getAppGroupDir(groupName: string): Promise<string>;
89 getConstants(): {
90 CacheDir: string;
91 DatabaseDir?: string;
92 DocumentDir: string;
93 LibraryDir?: string;
94 MainBundleDir: string;
95 SDCardDir?: string;
96 };
97 hardlink(source: string, target: string): Promise<void>;
98 hash(path: string, algorithm: string): Promise<string>;
99 isDir(path: string): Promise<boolean>;
100 ls(path: string): Promise<string[]>;
101 mkdir(path: string): Promise<string>;
102 mv(source: string, target: string): Promise<void>;
103 readFile(path: string, encoding: string): Promise<string>;
104 readFileChunk(
105 path: string,
106 offset: CodegenTypes.Int32,
107 length: CodegenTypes.Int32,
108 encoding: string
109 ): Promise<string>;
110 stat(path: string): Promise<FileStat>;
111 statDir(path: string): Promise<FileStat[]>;
112 symlink(source: string, target: string): Promise<void>;
113 unlink(path: string): Promise<void>;
114 unzip(source: string, target: string): Promise<void>;
115 writeFile(path: string, data: string, encoding: string): Promise<void>;
116}
117
118export default TurboModuleRegistry.getEnforcing<Spec>('FileAccess');

Callers 67

FsDemoFunction · 0.65
FsDemoFunction · 0.65
appendFileFunction · 0.65
fetchManagedFunction · 0.65
FsDemoFunction · 0.65
FsDemoFunction · 0.65
concatFilesFunction · 0.65
FsDemoFunction · 0.65
FsDemoFunction · 0.65
cpFunction · 0.65
FsDemoFunction · 0.65
FsDemoFunction · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…