1
0
silverbullet/webapp/syscalls/system.ts

18 lines
423 B
TypeScript

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