export { isCancel } from './core'; export interface TextOptions { message: string; placeholder?: string; defaultValue?: string; initialValue?: string; validate?: (value: string) => string | void; } export declare const text: (opts: TextOptions) => Promise; export interface PasswordOptions { message: string; mask?: string; validate?: (value: string) => string | void; } export declare const password: (opts: PasswordOptions) => Promise; export interface ConfirmOptions { message: string; active?: string; inactive?: string; initialValue?: boolean; } export declare const confirm: (opts: ConfirmOptions) => Promise; type Primitive = Readonly; type Option = Value extends Primitive ? { value: Value; label?: string; hint?: string; } : { value: Value; label: string; hint?: string; }; export interface SelectOptions { message: string; options: Array>; initialValue?: Value; maxItems?: number; } export declare const select: (opts: SelectOptions) => Promise; export declare const selectKey: (opts: SelectOptions) => Promise; export interface MultiSelectOptions { message: string; options: Array>; initialValues?: Value[]; maxItems?: number; required?: boolean; cursorAt?: Value; } export declare const multiselect: (opts: MultiSelectOptions) => Promise; export interface GroupMultiSelectOptions { message: string; options: Record>>; initialValues?: Value[]; required?: boolean; cursorAt?: Value; selectableGroups?: boolean; spacedGroups?: boolean; } export declare const groupMultiselect: (opts: GroupMultiSelectOptions) => Promise; export declare const note: (message?: string, title?: string) => void; export declare const box: (message?: string, title?: string) => void; export declare const taskLog: (title: string) => { text: string; fail(message: string): void; success(message: string): void; }; export declare const cancel: (message?: string) => void; export declare const intro: (title?: string) => void; export declare const outro: (message?: string) => void; export type LogMessageOptions = { symbol?: string; }; export declare const log: { message: (message?: string, { symbol }?: LogMessageOptions) => void; info: (message: string) => void; success: (message: string) => void; step: (message: string) => void; warn: (message: string) => void; /** alias for `log.warn()`. */ warning: (message: string) => void; error: (message: string) => void; }; export declare const spinner: () => { start: (msg?: string) => void; stop: (msg?: string, code?: number) => void; message: (msg?: string) => void; }; export type PromptGroupAwaitedReturn = { [P in keyof T]: Exclude, symbol>; }; export interface PromptGroupOptions { /** * Control how the group can be canceled * if one of the prompts is canceled. */ onCancel?: (opts: { results: Prettify>>; }) => void; } type Prettify = { [P in keyof T]: T[P]; } & {}; export type PromptGroup = { [P in keyof T]: (opts: { results: Prettify>>>; }) => void | Promise; }; /** * Define a group of prompts to be displayed * and return a results of objects within the group */ export declare const group: (prompts: PromptGroup, opts?: PromptGroupOptions) => Promise>>; export type Task = { /** * Task title */ title: string; /** * Task function */ task: (message: (string: string) => void) => string | Promise | void | Promise; /** * If enabled === false the task will be skipped */ enabled?: boolean; }; /** * Define a group of tasks to be executed */ export declare const tasks: (tasks: Task[]) => Promise;