import { Manifest } from "../../common/manifest"; import { Plug } from "../../plugos/plug"; import { PageMeta } from "../../common/types"; export type SpaceEvents = { pageCreated: (meta: PageMeta) => void; pageChanged: (meta: PageMeta) => void; pageDeleted: (name: string) => void; pageListUpdated: (pages: Set) => void; plugLoaded: (plugName: string, plug: Manifest) => void; plugUnloaded: (plugName: string) => void; }; export interface Space { // Pages fetchPageList(): Promise<{ pages: Set; nowTimestamp: number }>; readPage(name: string): Promise<{ text: string; meta: PageMeta }>; getPageMeta(name: string): Promise; writePage( name: string, text: string, selfUpdate?: boolean, lastModified?: number ): Promise; deletePage(name: string): Promise; // Plugs proxySyscall(plug: Plug, name: string, args: any[]): Promise; invokeFunction( plug: Plug, env: string, name: string, args: any[] ): Promise; }