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