@termun/core - v0.0.0
    Preparing search index...

    Class MenuInputConfigs

    Index

    Constructors

    Methods

    • Returns true when the screen is cleared before rendering the input prompt.

      Returns boolean | undefined

    • Sets whether the screen is cleared before rendering the prompt.

      Parameters

      • v: NonNullable<boolean | undefined>

      Returns this

    • Returns true when Enter is not required to submit (submits on single character).

      Returns boolean | undefined

    • Sets whether the prompt submits on the first character typed.

      Parameters

      • v: NonNullable<boolean | undefined>

      Returns this

    • Returns true when the input is rendered inline (no full-screen takeover).

      Returns boolean | undefined

    • Sets whether the prompt is rendered inline.

      Parameters

      • v: NonNullable<boolean | undefined>

      Returns this

    • Returns a string with characters that should be blocked while typing, or undefined.

      Returns string | undefined

    • Sets characters that should be blocked while typing (e.g. a single space ' ').

      Parameters

      • v: string | undefined

      Returns this

    • Returns the validation function, or undefined if not configured.

      Returns ((value: string) => string | boolean) | undefined

    • Sets a custom validation function for the input value. Return true to accept, a string to display as error, or false to show the generic error label.

      Parameters

      • v: ((value: string) => string | boolean) | undefined

      Returns this

    • Returns the submission callback, or undefined if not configured.

      Returns
          | (
              (
                  data: {
                      menu: MenuInput;
                      value: string;
                      language?: string;
                      parent?: string;
                  },
              ) => Promise<void>
          )
          | undefined

    • Sets the callback invoked after successful submission.

      Parameters

      • v:
            | (
                (
                    data: {
                        menu: MenuInput;
                        value: string;
                        language?: string;
                        parent?: string;
                    },
                ) => Promise<void>
            )
            | undefined

        Async callback receiving the menu and submitted value.

      Returns this

    Properties

    clear: NonNullable<boolean | undefined> = true
    fastSubmit: NonNullable<boolean | undefined> = false
    inline: NonNullable<boolean | undefined> = false
    forbidChars?: string
    validate?: (value: string) => string | boolean
    callback?: (
        data: {
            menu: MenuInput;
            value: string;
            language?: string;
            parent?: string;
        },
    ) => Promise<void>