Basic syncing in the plugin

This commit is contained in:
Andras Schmelczer 2024-12-15 15:47:08 +00:00
parent dfdf1d016b
commit d088d42a65
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
17 changed files with 560 additions and 178 deletions

View file

@ -0,0 +1,18 @@
import { RelativePath } from "src/database/document-metadata";
export interface FileOperations {
read(path: RelativePath): Promise<Uint8Array>;
create(path: RelativePath, newContent: Uint8Array): Promise<void>;
// Writes new content to the file at the given path. If the file's content has changed since the expectedContent was read, the write will merge the changes.
write(
path: RelativePath,
expectedContent: Uint8Array,
newContent: Uint8Array
): Promise<Uint8Array>;
remove(path: RelativePath): Promise<void>;
move(oldPath: RelativePath, newPath: RelativePath): Promise<void>;
}