commanding
Version:
A simple yet practical command-Line application framework, written in TypeScript.
41 lines (40 loc) • 2.54 kB
TypeScript
/// <reference types="node" />
import { Presenter, Command, ArgRequirement, OptionRequirement } from '../interfaces';
export declare class AwesomePresenter implements Presenter {
protected colorEnabled: boolean;
protected output: NodeJS.WriteStream;
static readonly TABLE_PADDING = 6;
static readonly NEW_LINE_CHAR = "\n";
constructor(colorEnabled?: boolean, output?: NodeJS.WriteStream);
protected write(content: string): void;
protected writeWithLeftMargin(content: string, margin: number): void;
setColor(enabled: boolean): void;
protected colorizeIfEnabled(str: string, colorizer?: Function): any;
protected getExecutableRendering(executable: string): string;
protected getCommandNameRendering(name: string): string;
protected getRequiredArgNameRendering(name: string): string;
protected getOptionalArgNameRendering(name: string): string;
protected getArgNameRendering(argRequirement: ArgRequirement): string;
protected getOptionNameRendering(requirement: OptionRequirement): string;
protected getUsageArgRequirementsRendering(argRequirements: ArgRequirement[]): string;
protected getUsageExampleRendering(executable: string, argRequirements: ArgRequirement[], command?: Command): string;
protected getUsageExampleWithCommandRendering(name: string): string;
protected getRequiredRendering(required: boolean): string;
protected getArgRequirementsRendering(requirements: ArgRequirement[]): string;
protected getOptionRequirementsRendering(requirements: OptionRequirement[]): string;
protected getCommandRequirementsRendering(commands: Command[]): string;
getSectionNameRendering(name: string): string;
getApplicationNameRendering(name: string): string;
getApplicationVersionRendering(version: string): string;
protected getCommandArgumentsSectionRendering(command: Command): string;
protected getCommandOptionsSectionRendering(command: Command): string;
renderApplicationUsage(executable: string, commands: Command[], defaultCommand?: Command): void;
renderApplicationInfo(executable: string, name?: string | undefined, description?: string | undefined, version?: string | undefined): void;
renderCommandList(commands: Command[]): void;
renderCommandHelp(executable: string, command: Command): void;
renderGlobalOptions(globalOptionRequirements: OptionRequirement[]): void;
renderVersion(version?: string): void;
renderEnding(): void;
renderError(message: string): void;
renderSplit(): void;
}