UNPKG

argumental

Version:

Framework for building CLI apps with Node.js

73 lines (72 loc) 2.34 kB
import { Argumental } from '../types'; export declare class Logger { private readonly PADDING; /** Detected application name. */ private _appName; /** Controls colored logging. */ private _colors; /** Holds custom help renderer function. */ private _customHelp; /** * Returns the options signature of a command. * @param command A command definition. */ private _getOptionsSignature; /** * Returns a list of named argument signatures. * @param command A command definition. */ private _getArgumentsSignatureList; /** * Determines if any arguments are defined for any command. * @param definitions List of command declarations. */ private _doArgumentsExist; /** * Returns the longest string length. * @param strings Array of strings. */ private _getLongest; /** * Returns padding based on logger configuration and level. * @param level The padding level. */ private _pad; /** * Returns option syntax from definition. * @param option The option definition. */ private _getOptionSyntax; /** * Determines if command has any multi options. * @param command The command definition. */ private _hasMultiOption; /** * Determines whether requirements differ between components (option declarations, argument declarations, etc.). * @param components An array of components. */ private _doesRequirementsDiffer; /** * Determines if there are any required declarations in a set of components (option declarations, argument declarations, etc.). * @param components An array of components. */ private _anyRequired; /** Application name setter. */ set appName(name: string); /** Log colors setter. */ set colors(value: boolean); /** Custom help renderer function setter. */ set customHelpRenderer(renderer: Function); /** * Logs an error. * @param messages An array of string and/or error messages. */ error(...messages: Array<string | Error>): void; /** * Displays application help in the console. * @param definitions Command definitions list. * @param cmd The invoked command name. */ help(definitions: Argumental.List<Argumental.CommandDeclaration>, cmd: string): void; }