Basic syncing in the plugin
This commit is contained in:
parent
dfdf1d016b
commit
d088d42a65
17 changed files with 560 additions and 178 deletions
18
plugin/src/file-operations/file-operations.ts
Normal file
18
plugin/src/file-operations/file-operations.ts
Normal 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>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue