import type { Result, ShellError } from "./result"; import type { ShellState } from "./shell_state"; type CommandFn = (state: ShellState, flags: string[], args: string[]) => CommandOutput; export interface CommandDescriptor { fn: CommandFn; name: string; flags?: readonly FlagDescriptor[]; requresRoot?: boolean; description?: string; keybinds?: readonly string[]; } export interface FlagDescriptor { name: string; takesValue?: boolean; } export interface CommandOutput { readonly state: ShellState; readonly result: Result; }