import { ISiDevice, ISiDeviceDriverData } from 'sportident/lib/SiDevice/ISiDevice'; import { ISiExternalApplication } from './ISiExternalApplication'; export interface ShellUserInterface { getChar: () => number | undefined; putChar: (char: number) => void; } export interface ShellCommand { autocomplete: (args: string[]) => string[]; validateArgs: (context: ShellCommandContext) => boolean; run: (context: ShellCommandContext) => Promise; printUsage: (context: ShellCommandContext) => void; } export interface ShellCommandContext { args: string[]; getChar: () => number | undefined; waitChar: () => Promise; putChar: (char: number) => void; getLine: () => Promise; putString: (line: string) => void; env: ShellEnv; } export interface AllShellOptions { prompt: string; initialEnv: ShellEnv; } export interface ShellOptions { prompt?: string; initialEnv?: ShellEnv; } type ShellEnv = { [varName: string]: unknown; } & { externalApplication?: { new (url: string): ISiExternalApplication; }; device?: ISiDevice>; }; type ShellInputParser = (contentSoFar: T, newChar: number, ui: ShellUserInterface) => [boolean, T]; export declare class Shell { ui: ShellUserInterface; private commands; private env; private options; constructor(ui: ShellUserInterface, commands: { [commandName: string]: ShellCommand; }, options?: ShellOptions); run(): Promise; getCommandContext(args: string[]): ShellCommandContext; getLine(autocomplete?: (commandStr: string) => [boolean, string]): Promise; autocompleteCommand(commandStr: string): [boolean, string]; autocompleteCommandName(arg: string): string[]; parseInput(parser: ShellInputParser, init: () => T): Promise; waitChar(): Promise; putString(strToPut: string): void; } export {}; //# sourceMappingURL=Shell.d.ts.map