Sync engine (#298)

Fixes #261
This commit is contained in:
Zef Hemel
2023-01-13 15:41:29 +01:00
committed by GitHub
parent de6f531e91
commit a56e14bff1
51 changed files with 1033 additions and 1418 deletions
+3 -2
View File
@@ -1,10 +1,10 @@
import { Plug } from "../../plugos/plug.ts";
import { FileMeta } from "../types.ts";
export type FileEncoding = "string" | "arraybuffer" | "dataurl";
export type FileEncoding = "utf8" | "arraybuffer" | "dataurl";
export type FileData = ArrayBuffer | string;
export interface SpacePrimitives {
// Pages
// Returns a list of file meta data as well as the timestamp of this snapshot
fetchFileList(): Promise<FileMeta[]>;
readFile(
name: string,
@@ -15,6 +15,7 @@ export interface SpacePrimitives {
name: string,
encoding: FileEncoding,
data: FileData,
// Used to decide whether or not to emit change events
selfUpdate?: boolean,
): Promise<FileMeta>;
deleteFile(name: string): Promise<void>;