1
0
silverbullet/webapp/syscalls/system.ts
2022-03-28 15:25:05 +02:00

14 lines
409 B
TypeScript

import { SysCallMapping } from "../../plugos/system";
import { Space } from "../space";
export function systemSyscalls(space: Space): SysCallMapping {
return {
async invokeFunctionOnServer(ctx, name: string, ...args: any[]) {
if (!ctx.plug) {
throw Error("No plug associated with context");
}
return space.wsCall("invokeFunction", ctx.plug.name, name, ...args);
},
};
}