Files
gornodox.dev/src/lib/stores/bash/commands/testAsync.ts
T

48 lines
1.1 KiB
TypeScript

import type { KeyBind } from "$lib/stores/terminal/keybindRegistry";
import { mount } from "svelte";
import { type Bash, type Result } from "../bash";
import type { CommandArgs, CommandResultData, ICommand } from "../commandRegistry";
import { ExitCode } from "../metadata";
import Login from "../../../../modules/Login.svelte";
import Loading from "../../../../modules/Loading.svelte";
export const cmd_process = function(this: Bash, args: CommandArgs): Result {
let result: Result = { exitCode: ExitCode.ERROR, path: this.getCwd() };
const resultData: CommandResultData = { cmd: 'ls', data: null, args: args };
result.resultData = resultData;
result.exitCode = ExitCode.SUCCESS;
return result;
}
const test_keybind: KeyBind = [
{
key: 'a',
modifiers: [
'Shift'
]
}
];
function test(): void {
console.log("Keybind works");
}
const keybinds: Map<KeyBind, () => any> = new Map([
[test_keybind,test]
]);
export const testProcess: ICommand = {
method: cmd_process,
keybinds: keybinds,
flags: [] as string[],
help: 'PATH TO HELP.md',
root: false
};