UNPKG

1.02 kBTypeScriptView Raw
1import type { PromptAnswers, PromptQuestion as PromptQuestionApi } from '@yeoman/types';
2import type Storage from './util/storage.js';
3
4export type { PromptAnswers } from '@yeoman/types';
5
6/**
7 * Represents a question.
8 */
9export type PromptQuestion<T extends PromptAnswers = PromptAnswers> = PromptQuestionApi<T> & {
10 name: string;
11
12 /**
13 * The storage to store the answer.
14 */
15 storage?: Storage;
16
17 /**
18 * A value indicating whether to store the user's previous answer for others projects.
19 */
20 store?: boolean;
21};
22
23/**
24 * Provides options for registering a prompt.
25 */
26export type QuestionRegistrationOptions<T extends PromptAnswers = PromptAnswers> = PromptQuestion<T> & {
27 /**
28 * A value indicating whether an option should be exported for this question.
29 */
30 exportOption?: boolean | Record<string, unknown>;
31};
32
33/**
34 * Provides a set of questions.
35 */
36export type PromptQuestions<A extends PromptAnswers = PromptAnswers> = PromptQuestion<A> | Array<PromptQuestion<A>>; // | Observable<Question<A>>;