Initial implementation of command link arguments (#573)

Initial implementation of command link arguments

---------

Co-authored-by: prcrst <p-github@prcr.st>
Co-authored-by: Zef Hemel <zef@zef.me>
This commit is contained in:
prcrst
2023-11-25 18:57:00 +01:00
committed by GitHub
co-authored by prcrst Zef Hemel
parent a03b211dad
commit e6f77b12af
15 changed files with 105 additions and 17 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ export type CommandDef = {
export type AppCommand = {
command: CommandDef;
run: () => Promise<void>;
run: (args?: string[]) => Promise<void>;
};
export type CommandHookT = {
@@ -43,8 +43,8 @@ export class CommandHook extends EventEmitter<CommandHookEvents>
const cmd = functionDef.command;
this.editorCommands.set(cmd.name, {
command: cmd,
run: () => {
return plug.invoke(name, [cmd]);
run: (args?: string[]) => {
return plug.invoke(name, [cmd, ...args??[]]);
},
});
}