import 'reflect-metadata'; import { CoreModels } from './core-models'; export declare namespace UtilsTerminal { export interface SelectChoice { /** * Title of the choice */ name?: string; disabled?: boolean; } export interface SelectChoiceValue extends SelectChoice { value?: T; } type SelectActionChoice = { [choice: string]: SelectChoice & { /** * Action to execute */ action?: () => any; }; }; export const wait: (second: number) => Promise; export const waitMilliseconds: (milliseconds: number) => Promise; /** * Check if cli is running in verbose mode * @returns true if cli is running with arugment -verbose */ export const isVerboseModeTaon: () => boolean; export const waitForUserAnyKey: (callback: () => void | Promise, options?: { /** * by default, the action is only triggered once when a key is pressed. * if this option is set, the action will be triggered on every key press. * (Promise will not be resolved until process is killed) */ triggerActionEveryKeypress?: boolean; }) => Promise; export const getTerminalHeight: () => number; export const clearConsole: () => void; export const multiselect: (options: { question?: string; /** * If true, then only one choice can be selected * @deprecated use select instead */ onlyOneChoice?: boolean; choices: SelectChoiceValue[] | { [choice: string]: SelectChoice; }; autocomplete?: boolean; /** * at least one choice must be selected */ required?: boolean; defaultSelected?: string[]; }) => Promise; /** * Similar to select but executes action if provided * @returns selected and executed value */ export const multiselectActionAndExecute: (choices: CHOICE, options?: { question?: string; autocomplete?: boolean; defaultSelected?: string; hint?: string; executeActionsOnDefault?: boolean; }) => Promise<{ selected: (keyof CHOICE)[]; actionResults: unknown[]; /** * object containing all selected actions */ actions: (() => any)[]; }>; /** * Similar to select but executes action if provided * @returns selected and executed value */ export const selectActionAndExecute: (choices: CHOICE, options?: { question?: string; autocomplete?: boolean; defaultSelected?: string; hint?: string; executeActionOnDefault?: boolean; }) => Promise<{ selected: any; action: () => Promise; actionResult?: undefined; } | { selected: keyof CHOICE; actionResult: unknown; action: () => Promise; }>; export const select: (options: { question?: string; choices: SelectChoiceValue[] | { [choice: string]: SelectChoice; }; autocomplete?: boolean; defaultSelected?: string; hint?: string; }) => Promise; export const pipeEnterToStdin: () => void; export const input: ({ defaultValue, question, required, validate, }: { defaultValue?: string; question: string; required?: boolean; validate?: (value: string) => boolean; }) => Promise; export const confirm: (options?: { /** * default: Are you sure? */ message?: string; callbackTrue?: () => any; callbackFalse?: () => any; /** * default: true */ defaultValue?: boolean; engine?: "inquirer-toggle" | "prompts" | "enquirer" | "@inquirer/prompts"; }) => Promise; export const pressAnyKeyToContinueAsync: (options?: { message?: string; }) => Promise; /** * @deprecated use UtilsTerminal.pressAnyKey */ export const pressKeyAndContinueSync: (message?: string) => void; /** * @returns true if user wants to try again, false otherwise */ export const pressAnyKeyToTryAgainErrorOccurred: (error: unknown) => Promise; /** * @deprecated use UtilsTerminal.pressAnyKeyToContinueAsync() */ export const pressAnyKey: (options?: { message?: string; }) => void; export const previewLongList: (list: string | string[], listName?: string) => Promise; /** * Displays a long list in the console using a pager like `less`. * Returns a Promise that resolves when the user exits the pager. * * @param {string} list - The long string content to display. * @returns {Promise} A Promise that resolves when the pager exits. */ export const previewLongListGitLogLike: (list: string | string[]) => Promise; export const drawBigText: (text: string, options?: { skipDrawing?: boolean; align?: CoreModels.CfontAlign; style?: CoreModels.CfontStyle; }) => Promise; export const drawLine: (col?: number) => void; export {}; }