Move file handling logic inside of client
This commit is contained in:
parent
db8e4bc2e7
commit
fde1fecbb6
7 changed files with 151 additions and 137 deletions
|
|
@ -0,0 +1,17 @@
|
|||
import { RelativePath } from "src/persistence/database";
|
||||
|
||||
export interface FileSystemOperations {
|
||||
listAllFiles(): Promise<RelativePath[]>;
|
||||
read(path: RelativePath): Promise<Uint8Array>;
|
||||
write(path: RelativePath, content: Uint8Array): Promise<void>;
|
||||
atomicUpdateText(
|
||||
path: RelativePath,
|
||||
updater: (currentContent: string) => string
|
||||
): Promise<string>;
|
||||
getFileSize(path: RelativePath): Promise<number>;
|
||||
getModificationTime(path: RelativePath): Promise<Date>;
|
||||
exists(path: RelativePath): Promise<boolean>;
|
||||
createDirectory(path: RelativePath): Promise<void>;
|
||||
delete(path: RelativePath): Promise<void>;
|
||||
rename(oldPath: RelativePath, newPath: RelativePath): Promise<void>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue