1
0
silverbullet/packages/plugos-silverbullet-syscall/system.ts

25 lines
654 B
TypeScript
Raw Normal View History

2022-09-06 12:36:06 +00:00
import type { CommandDef } from "@silverbulletmd/web/hooks/command";
2022-04-01 15:07:08 +00:00
import { syscall } from "./syscall";
2022-04-05 15:02:17 +00:00
export async function invokeFunction(
env: string,
2022-04-01 15:07:08 +00:00
name: string,
...args: any[]
): Promise<any> {
return syscall("system.invokeFunction", env, name, ...args);
2022-04-01 15:07:08 +00:00
}
2022-04-26 17:04:36 +00:00
2022-09-06 12:36:06 +00:00
// Only available on the client
2022-07-11 07:08:22 +00:00
export async function invokeCommand(name: string): Promise<any> {
return syscall("system.invokeCommand", name);
}
2022-09-06 12:36:06 +00:00
// Only available on the client
export async function listCommands(): Promise<{ [key: string]: CommandDef }> {
return syscall("system.listCommands");
}
2022-04-26 17:04:36 +00:00
export async function reloadPlugs() {
2022-04-26 18:31:31 +00:00
syscall("system.reloadPlugs");
2022-04-26 17:04:36 +00:00
}