@adonisjs/ace
Version:
A CLI framework for Node.js
49 lines (48 loc) • 1.43 kB
TypeScript
import { type Argument, type UIPrimitives } from '../types.ts';
/**
* The argument formatter formats an argument as per the http://docopt.org/ specification
*
* @example
* ```ts
* const formatter = new ArgumentFormatter(argument, colors)
* const formatted = formatter.formatOption() // '<entity>'
* const listOption = formatter.formatListOption() // ' entity '
* ```
*/
export declare class ArgumentFormatter {
#private;
/**
* Create a new argument formatter
*
* @param argument - The argument configuration to format
* @param colors - Color utilities for output formatting
*/
constructor(argument: Argument, colors: UIPrimitives['colors']);
/**
* Returns formatted description for the argument
*
* @example
* ```ts
* formatter.formatDescription() // 'The entity name [default: user]'
* ```
*/
formatDescription(): string;
/**
* Returns a formatted version of the argument name to be displayed inside a list
*
* @example
* ```ts
* formatter.formatListOption() // ' entity ' or ' [entity] ' for optional
* ```
*/
formatListOption(): string;
/**
* Returns a formatted version of the argument name to be displayed next to usage
*
* @example
* ```ts
* formatter.formatOption() // '<entity>' or '[<entity>]' for optional
* ```
*/
formatOption(): string;
}