@adonisjs/ace
Version:
A CLI framework for Node.js
40 lines (39 loc) • 1.14 kB
TypeScript
import { type Flag, type UIPrimitives } from '../types.ts';
/**
* The flag formatter formats a flag as per the http://docopt.org/ specification
*
* @example
* ```ts
* const formatter = new FlagFormatter(flag, colors)
* const formatted = formatter.formatOption() // '--connection[=CONNECTION]'
* const description = formatter.formatDescription() // 'Database connection'
* ```
*/
export declare class FlagFormatter {
#private;
/**
* Create a new flag formatter
*
* @param flag - The flag configuration to format
* @param colors - Color utilities for output formatting
*/
constructor(flag: Flag, colors: UIPrimitives['colors']);
/**
* Returns formatted description for the flag
*
* @example
* ```ts
* formatter.formatDescription() // 'Database connection [default: mysql]'
* ```
*/
formatDescription(): string;
/**
* Returns a formatted version of the flag name and aliases
*
* @example
* ```ts
* formatter.formatOption() // '--connection[=CONNECTION]' or '--force, -f'
* ```
*/
formatOption(): string;
}