1
0
silverbullet/packages/plugos-silverbullet-syscall/system.ts
2022-09-14 09:32:47 +02:00

25 lines
654 B
TypeScript

import type { CommandDef } from "@silverbulletmd/web/hooks/command";
import { syscall } from "./syscall";
export async function invokeFunction(
env: string,
name: string,
...args: any[]
): Promise<any> {
return syscall("system.invokeFunction", env, name, ...args);
}
// Only available on the client
export async function invokeCommand(name: string): Promise<any> {
return syscall("system.invokeCommand", name);
}
// Only available on the client
export async function listCommands(): Promise<{ [key: string]: CommandDef }> {
return syscall("system.listCommands");
}
export async function reloadPlugs() {
syscall("system.reloadPlugs");
}