@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
45 lines (44 loc) • 1.78 kB
TypeScript
import { type SoloLogger } from './logging.js';
import type * as yargs from 'yargs';
import { type CommandFlag } from '../types/flag_types.js';
import { type ListrTaskWrapper } from 'listr2';
/**
* ConfigManager cache command flag values so that user doesn't need to enter the same values repeatedly.
*
* For example, 'namespace' is usually remains the same across commands once it is entered, and therefore user
* doesn't need to enter it repeatedly. However, user should still be able to specify the flag explicitly for any command.
*/
export declare class ConfigManager {
private readonly logger?;
config: Record<string, any>;
constructor(logger?: SoloLogger);
/** Reset config */
reset(): void;
/**
* Apply the command flags precedence
*
* It uses the below precedence for command flag values:
* 1. User input of the command flag
* 2. Default value of the command flag if the command is not 'init'.
*/
applyPrecedence(argv: yargs.Argv<any>, aliases: any): yargs.Argv<any>;
/** Update the config using the argv */
update(argv?: object | any): void;
/** Check if a flag value is set */
hasFlag(flag: CommandFlag): boolean;
/**
* Return the value of the given flag
* @returns value of the flag or undefined if flag value is not available
*/
getFlag<T>(flag: CommandFlag): undefined | T;
/** Set value for the flag */
setFlag<T>(flag: CommandFlag, value: T): void;
/** Get package version */
getVersion(): string;
/**
* Run prompts for the given set of flags
* @param task task object from listr2
* @param flagList list of flag objects
*/
executePrompt(task: ListrTaskWrapper<any, any, any>, flagList?: CommandFlag[]): Promise<void>;
}