1
0
silverbullet/common/spaces/space_primitives.ts

26 lines
684 B
TypeScript
Raw Normal View History

2022-04-07 13:21:30 +00:00
import { Plug } from "../../plugos/plug";
import { PageMeta } from "../types";
2022-04-07 13:21:30 +00:00
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>;
}