UNPKG

@capgo/cli

Version:

A CLI to upload to capgo servers

42 lines (41 loc) 1.45 kB
export declare const CANCEL: symbol; type SpinnerTone = 'success' | 'neutral' | 'error'; type PromptResult<T> = Promise<T | symbol>; interface ConfirmOptions { message: string; initialValue?: boolean; } interface TextOptions { message: string; placeholder?: string; validate?: (value: string | undefined) => string | undefined; } interface SelectOption<T extends string = string> { value: T; label: string; hint?: string; } interface SelectOptions<T extends string = string> { message: string; options: SelectOption<T>[]; } interface SpinnerController { start: (message: string) => void; stop: (message?: string, tone?: SpinnerTone) => void; message: (message: string) => void; } export declare function intro(_message: string): void; export declare function outro(message: string): void; export declare function cancel(message: string): void; export declare function isCancel(value: unknown): value is symbol; export declare const log: { info(message: string): void; warn(message: string): void; error(message: string): void; success(message: string): void; }; export declare function confirm(options: ConfirmOptions): PromptResult<boolean>; export declare function text(options: TextOptions): PromptResult<string>; export declare function select<T extends string = string>(options: SelectOptions<T>): PromptResult<T>; export declare function spinner(): SpinnerController; export {};