import { Dir, IJson, File, Disk } from 'webos-disk'; export * from 'webos-disk'; export * from 'webos-module'; interface ICommandResult { success: boolean; error?: any; message: string; commandName: string; args: string[]; result: any; } declare type ISubCommandFunc = (this: Command, args: string[]) => Promise; interface ISubCommandObject { hint?: 'custom' | 'file' | 'command' | 'none'; hintArray?: string[]; help?: string; main(this: Command, args: string[], sub: ISubCommandObject): Promise; init?(this: Command, sub: ISubCommandObject): Promise; } declare type ISubCommands = IJson; declare abstract class Command { term: Term; commandName: string; args: string[]; subCommands: ISubCommands; get subNames(): string[]; get curDir(): Dir; get curPath(): string; get container(): HTMLElement; desc: string; hint: 'custom' | 'file' | 'command' | 'none'; hintArray: string[]; softwareDir: Dir; files: IJson; constructor(term: Term); get help(): string; init(): Promise; run(args: string[]): Promise; abstract main(args: string[]): Promise; success(result?: any): ICommandResult; fail(message?: string, error?: null): ICommandResult; noMainCommand(): ICommandResult; createSoftwareDir(name?: string): Promise; createSoftwareFile(name: string): Promise; initSubCommands(): void; readSubJson(name: string): IJson | null; appendSubJson(name: string, key: string, value: any): Promise; writeSubJson(name: string, json: object): Promise; getSub(name: string): ISubCommandObject; } declare class CommandManager { static List: CommandManager[]; private commands; private commandList; term: Term; constructor(term: Term); getCommand(name: string): Command; destory(): void; addNewCommand(command: typeof Command): Command; getCommandInfos(): { commandName: string; help: string; desc: string; }[]; getCommandNames(): string[]; handleCommand(value: string): Promise; executeCommand(command: string): Promise; static installCommand(command: typeof Command): void; static getAllCommands(): (typeof Command)[]; } declare function createGlobalData(): { userName: any; currentDirName: any; inputContent: any; Hint: { readonly text: any; readonly enabled: any; readonly list: any; setHint(v: string, list: string[]): void; hideHint(): void; }; Edit: { readonly enabled: any; readonly content: any; readonly filepath: any; readonly touch: any; enterEdit(path: string, content: string, touch?: boolean): void; quitEdit(): void; }; }; declare class UI { container: HTMLElement; constructor(container: string | HTMLElement, term: Term); } declare type TGlobalData = ReturnType; interface ITermOptions { container?: string | HTMLElement; } declare class Term { static List: Term[]; disk: Disk; currentDir: Dir; global: TGlobalData; ui: UI; commands: CommandManager; private containerOptions; constructor({ container }?: ITermOptions); get container(): HTMLElement; destory(): void; execute(command: string): Promise; init(): Promise; get currentPath(): string; } declare function createTerm(options?: ITermOptions): Promise; export { Term, createTerm };