MCPcopy Create free account
hub / github.com/cactus-compute/cactus-react-native / CactusFileSystem

Class CactusFileSystem

src/native/CactusFileSystem.ts:4–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import type { CactusFileSystem as CactusFileSystemSpec } from '../specs/CactusFileSystem.nitro';
3
4export class CactusFileSystem {
5 private static readonly hybridCactusFileSystem =
6 NitroModules.createHybridObject<CactusFileSystemSpec>('CactusFileSystem');
7
8 public static getCactusDirectory(): Promise<string> {
9 return this.hybridCactusFileSystem.getCactusDirectory();
10 }
11
12 public static fileExists(path: string): Promise<boolean> {
13 return this.hybridCactusFileSystem.fileExists(path);
14 }
15
16 public static writeFile(path: string, content: string): Promise<void> {
17 return this.hybridCactusFileSystem.writeFile(path, content);
18 }
19
20 public static readFile(path: string): Promise<string> {
21 return this.hybridCactusFileSystem.readFile(path);
22 }
23
24 public static deleteFile(path: string): Promise<void> {
25 return this.hybridCactusFileSystem.deleteFile(path);
26 }
27
28 public static modelExists(model: string): Promise<boolean> {
29 return this.hybridCactusFileSystem.modelExists(model);
30 }
31
32 public static getModelPath(model: string): Promise<string> {
33 return this.hybridCactusFileSystem.getModelPath(model);
34 }
35
36 public static getIndexPath(name: string): Promise<string> {
37 return this.hybridCactusFileSystem.getIndexPath(name);
38 }
39
40 public static downloadModel(
41 model: string,
42 url: string,
43 onProgress?: (progress: number) => void
44 ): Promise<void> {
45 return this.hybridCactusFileSystem.downloadModel(model, url, onProgress);
46 }
47
48 public static deleteModel(model: string): Promise<void> {
49 return this.hybridCactusFileSystem.deleteModel(model);
50 }
51}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected