SerenityJS
    Preparing search index...

    Hierarchy (View Summary)

    • Form<boolean>
      • MessageForm
    Index

    Constructors

    • Create a new server-sided message form.

      Parameters

      • title: string

        The title of the form.

      • Optionalcontent: string

        The content of the form; defaults to an empty string.

      • Optionalbutton1: string

        The text of the first button; defaults to "OK".

      • Optionalbutton2: string

        The text of the second button; defaults to "Cancel".

      Returns MessageForm

    Properties

    button1: string

    The text of the first button.

    button2: string

    The text of the second button.

    content: string

    The content of the form.

    formId: number = ++Form.formId

    The form id of the form.

    title: string

    The title of the form.

    type: Message = ModalFormType.Message

    The type of form.

    formId: number = 0

    The next form id to use when creating a new form.

    Methods

    • Show the form synchronously to a player.

      Parameters

      • player: Player

        The player to show the form to.

      • result: FormResult<boolean>

        The result callback to call when the form is submitted.

      Returns void

    • Show the form asynchronously to a player.

      Parameters

      • player: Player

        The player to show the form to.

      Returns Promise<boolean | Error>

      A promise that resolves with the form response or an error.

      If the form is cancelled, it resolves with an error.

      If the form is submitted, it resolves with the form response.