@stacksjs/cli
Version:
TypeScript framework for CLI artisans. Build beautiful console apps with ease.
52 lines (48 loc) • 1.93 kB
TypeScript
import type { State } from '@clack/core';
declare const unicode: (...args: any[]) => unknown;
declare const S_BAR_START: unknown;
declare const S_RADIO_ACTIVE: unknown;
declare const S_BAR_H: unknown;
declare function symbol(state: State): void;
declare interface LimitOptionsParams<TOption> {
options: TOption[]
maxItems: number | undefined
cursor: number
style: (option: TOption, active: boolean) => string
}
declare function limitOptions<TOption>(params: LimitOptionsParams<TOption>): string[];
export declare function text(opts: TextOptions): void;
export declare interface PasswordOptions {
message: string
mask?: string
validate?: (value: string) => string | void
}
export declare function password(opts: PasswordOptions): void;
export declare interface ConfirmOptions {
message: string
active?: string
inactive?: string
initialValue?: boolean
}
export declare function confirm(opts: ConfirmOptions): void;
declare type Primitive = Readonly<string | boolean | number>
type Option<Value> = Value extends Primitive
? { value: Value, label?: string, hint?: string }
: { value: Value, label: string, hint?: string }
export interface SelectOptions<Value> {
message: string
options: Option<Value>[]
initialValue?: Value
maxItems?: number
}
export declare function select<Value>(opts: SelectOptions<Value>): void;
export declare function selectKey<Value extends string>(opts: SelectOptions<Value>): void;
export declare function multiselect<Value>(opts: MultiSelectOptions<Value>): void;
export declare function groupMultiselect<Value>(opts: GroupMultiSelectOptions<Value>): void;
export declare function note(message, title): void;
export declare function cancel(message): void;
export declare function intro(title): void;
export declare function outro(message): void;
export declare function spinner(): Spinner;
declare function ansiRegex(): void;
export { isCancel } from '@clack/core'