All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
export interface SelectOption<T = string> {
|
|
value: T;
|
|
label: string;
|
|
hint?: string;
|
|
}
|
|
|
|
export interface MultiSelectOption<T = string> extends SelectOption<T> {
|
|
selected?: boolean;
|
|
}
|
|
|
|
export interface ProgressHandle {
|
|
update(message: string): void;
|
|
stop(message?: string): void;
|
|
}
|
|
|
|
export interface WizardPrompter {
|
|
intro(message: string): void;
|
|
outro(message: string): void;
|
|
note(message: string, title?: string): void;
|
|
log(message: string): void;
|
|
warn(message: string): void;
|
|
|
|
text(opts: {
|
|
message: string;
|
|
placeholder?: string;
|
|
defaultValue?: string;
|
|
validate?: (value: string) => string | void;
|
|
}): Promise<string>;
|
|
|
|
confirm(opts: { message: string; initialValue?: boolean }): Promise<boolean>;
|
|
|
|
select<T>(opts: { message: string; options: SelectOption<T>[]; initialValue?: T }): Promise<T>;
|
|
|
|
multiselect<T>(opts: {
|
|
message: string;
|
|
options: MultiSelectOption<T>[];
|
|
required?: boolean;
|
|
}): Promise<T[]>;
|
|
|
|
groupMultiselect<T>(opts: {
|
|
message: string;
|
|
options: Record<string, MultiSelectOption<T>[]>;
|
|
required?: boolean;
|
|
}): Promise<T[]>;
|
|
|
|
spinner(): ProgressHandle;
|
|
|
|
separator(): void;
|
|
}
|