* Refactored server to use spaces

* Other cleanup
This commit is contained in:
Zef Hemel
2022-04-08 17:46:09 +02:00
parent e10f41031c
commit 6ebf8e7f15
24 changed files with 256 additions and 160 deletions
+25
View File
@@ -0,0 +1,25 @@
import { Plug } from "../../plugos/plug";
import { PageMeta } from "../types";
export interface SpacePrimitives {
// Pages
fetchPageList(): Promise<{ pages: Set<PageMeta>; nowTimestamp: number }>;
readPage(name: string): Promise<{ text: string; meta: PageMeta }>;
getPageMeta(name: string): Promise<PageMeta>;
writePage(
name: string,
text: string,
selfUpdate?: boolean,
lastModified?: number
): Promise<PageMeta>;
deletePage(name: string): Promise<void>;
// Plugs
proxySyscall(plug: Plug<any>, name: string, args: any[]): Promise<any>;
invokeFunction(
plug: Plug<any>,
env: string,
name: string,
args: any[]
): Promise<any>;
}