Class PromptBuilder

Hierarchy

  • Base
    • PromptBuilder

Constructors

Properties

_input_default?: string
_input_transform: ((input) => string) = ...

Type declaration

    • (input): string
    • Parameters

      • input: string

      Returns string

_input_validation: ((input) => boolean) = ...

Type declaration

    • (input): boolean
    • Parameters

      • input: string

      Returns boolean

_message: string = ""
rl: Interface = ...

Methods

  • Returns void

  • Parameters

    • message: string = ""

    Returns Promise<string>

  • Sets the default value. If none is provided, the user will be prompted until they provide a valid input

    Returns

    The current instance of the builder

    Parameters

    • default_value: string

      The default value to use

    Returns PromptBuilder

  • Sets the transform function

    Returns

    The current instance of the builder

    Parameters

    • transform: ((input) => string)

      The transform function to use

        • (input): string
        • Parameters

          • input: string

          Returns string

    Returns PromptBuilder

  • Sets the validation function that will be used to validate the user's input

    Returns

    The current instance of the builder

    Parameters

    • validation: ((input) => boolean)

      The validation function to use

        • (input): boolean
        • Parameters

          • input: string

          Returns boolean

    Returns PromptBuilder

Generated using TypeDoc