Documentation
    Preparing search index...

    Represents the prompt ui.

    Type Parameters

    • T extends Answers = Answers

    Hierarchy

    • UI
      • Prompt
    Index

    Constructors

    • Initializes a new instance of the Prompt class.

      Type Parameters

      • T extends Answers = Answers

      Parameters

      • prompts: PromptCollection

        The prompts for the ui.

      • Optionaloptions: StreamOptions

        The input- and output-stream of the ui.

      Returns Prompt<T>

    Properties

    activePrompt: PromptBase

    Gets or sets the currently active prompt.

    answers: T

    Gets or sets the answers provided by the user.

    process: Observable<QuestionAnswer<T>>

    Gets or sets the event-flow of the process.

    Gets or sets the prompts of the ui.

    rl: Interface

    Gets or sets an object for performing read from and write to the console.

    Methods

    • Releases all unmanaged resources.

      Returns void

    • Fetches the answer to a question.

      Parameters

      Returns Observable<FetchedAnswer>

      The answer to the question.

    • Filters the question if it is runnable.

      Parameters

      • question: DistinctQuestion<T>

        The question to filter.

      Returns Observable<DistinctQuestion<T>>

      Either the event-flow of the question if it is runnable or an empty event-flow.

    • Finishes the process.

      Returns T

    • Handles a forced exit of the application.

      Returns void

    • Processes a question.

      Parameters

      • question: DistinctQuestion<T>

        The question to process.

      Returns Observable<FetchedAnswer>

      The answer to the question.

    • Runs the prompt-UI.

      Parameters

      • questions: DistinctQuestion<T>[]

        The questions to prompt the user to answer.

      Returns Promise<T>

      The answers provided by the user.

    • Sets the type of the question if no question-type is specified.

      Parameters

      • question: DistinctQuestion<T>

        The question to set the default type for.

      Returns Observable<DistinctQuestion<T>>

      The processed question.