import { Plug } from "../../plugos/plug.ts"; import { FileMeta } from "../types.ts"; export type FileEncoding = "string" | "arraybuffer" | "dataurl"; export type FileData = ArrayBuffer | string; export interface SpacePrimitives { // Pages fetchFileList(): Promise; readFile( name: string, encoding: FileEncoding ): Promise<{ data: FileData; meta: FileMeta }>; getFileMeta(name: string): Promise; writeFile( name: string, encoding: FileEncoding, data: FileData, selfUpdate?: boolean ): Promise; deleteFile(name: string): Promise; // Plugs proxySyscall(plug: Plug, name: string, args: any[]): Promise; invokeFunction( plug: Plug, env: string, name: string, args: any[] ): Promise; }