Massive restructure of plugin API

This commit is contained in:
Zef Hemel
2022-10-14 15:11:33 +02:00
parent 982623fc38
commit 7d28b53b75
70 changed files with 826 additions and 969 deletions
+24
View File
@@ -0,0 +1,24 @@
import type { CommandDef } from "../../web/hooks/command.ts";
import { syscall } from "./syscall.ts";
export function invokeFunction(
env: string,
name: string,
...args: any[]
): Promise<any> {
return syscall("system.invokeFunction", env, name, ...args);
}
// Only available on the client
export function invokeCommand(name: string): Promise<any> {
return syscall("system.invokeCommand", name);
}
// Only available on the client
export function listCommands(): Promise<{ [key: string]: CommandDef }> {
return syscall("system.listCommands");
}
export function reloadPlugs() {
syscall("system.reloadPlugs");
}