Tons of refactoring, moving commands and slash commands into hooks

This commit is contained in:
Zef Hemel
2022-03-29 11:21:32 +02:00
parent bf32d6d0bd
commit b89aee97d7
42 changed files with 330 additions and 224 deletions
+10 -20
View File
@@ -1,24 +1,14 @@
import * as plugos from "../plugos/types";
import { EndpointHook } from "../plugos/feature/endpoint";
import { CronHook } from "../plugos/feature/node_cron";
import { EventHook } from "../plugos/feature/event";
import { EndpointHookT } from "../plugos/hooks/endpoint";
import { CronHookT } from "../plugos/hooks/node_cron";
import { EventHookT } from "../plugos/hooks/event";
import { CommandHookT } from "../webapp/hooks/command";
import { SlashCommandHookT } from "../webapp/hooks/slash_command";
export type CommandDef = {
name: string;
// Bind to keyboard shortcut
key?: string;
mac?: string;
// If to show in slash invoked menu and if so, with what label
// should match slashCommandRegexp
slashCommand?: string;
};
export type SilverBulletHooks = {
command?: CommandDef | CommandDef[];
} & EndpointHook &
CronHook &
EventHook;
export type SilverBulletHooks = CommandHookT &
SlashCommandHookT &
EndpointHookT &
CronHookT &
EventHookT;
export type Manifest = plugos.Manifest<SilverBulletHooks>;