Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DialogExt

Dialog type, extends from Dialog to add some events. Created by buildDialog and showDialog.

Dialog event list see on.

Hierarchy

  • EventEmitter
    • DialogExt

Index

Events

on

  • on(event: "positive", listener: (dialog: Dialog) => void): DialogExt
  • on(event: "neutral", listener: (dialog: Dialog) => void): DialogExt
  • on(event: "negative", listener: (dialog: Dialog) => void): DialogExt
  • on(event: "single_choice", listener: (index: number, text: null | string, dialog: Dialog) => void): DialogExt
  • on(event: "multi_choice", listener: (indices: number[], texts: string[], dialog: Dialog) => void): DialogExt
  • on(event: "item_select", listener: (index: number, text: null | string, dialog: Dialog) => void): DialogExt
  • on(event: "input_change", listener: (text: string, dialog: Dialog) => void): DialogExt
  • on(event: "input", listener: (text: string, dialog: Dialog) => void): DialogExt
  • on(event: "dismiss", listener: (dialog: Dialog) => void): DialogExt
  • on(event: "cancel", listener: (dialog: Dialog) => void): DialogExt
  • positive button click event.

    Parameters

    • event: "positive"
    • listener: (dialog: Dialog) => void
        • Parameters

          Returns void

    Returns DialogExt

  • neutral button click event.

    Parameters

    • event: "neutral"
    • listener: (dialog: Dialog) => void
        • Parameters

          Returns void

    Returns DialogExt

  • negative button click event.

    Parameters

    • event: "negative"
    • listener: (dialog: Dialog) => void
        • Parameters

          Returns void

    Returns DialogExt

  • When the dialog box with the single choice box is confirmed or canceled, the selection result is called back by this event. The index parameter is the index of the selected menu item, or -1 if the user deselected it; the text parameter is the text of the selected menu item, or null if the user deselected it.

    Parameters

    • event: "single_choice"
    • listener: (index: number, text: null | string, dialog: Dialog) => void
        • (index: number, text: null | string, dialog: Dialog): void
        • Parameters

          • index: number
          • text: null | string
          • dialog: Dialog

          Returns void

    Returns DialogExt

  • When a dialog box with a multi-select box is confirmed or canceled, the selection result is called back by this event. The indices parameter is the index array of the selected menu items, or an empty array if the user deselects; the texts parameter is the text array of the selected menu items, or an empty array if the user deselects.

    Parameters

    • event: "multi_choice"
    • listener: (indices: number[], texts: string[], dialog: Dialog) => void
        • (indices: number[], texts: string[], dialog: Dialog): void
        • Parameters

          • indices: number[]
          • texts: string[]
          • dialog: Dialog

          Returns void

    Returns DialogExt

  • When the dialog box with the selection menu is confirmed or canceled, the selection result is called back by this event. The index parameter is the index of the selected menu item, or -1 if the user deselected it; the text parameter is the text of the selected menu item, or null if the user deselected it.

    Parameters

    • event: "item_select"
    • listener: (index: number, text: null | string, dialog: Dialog) => void
        • (index: number, text: null | string, dialog: Dialog): void
        • Parameters

          • index: number
          • text: null | string
          • dialog: Dialog

          Returns void

    Returns DialogExt

  • This event is triggered when text in input box changes.

    Parameters

    • event: "input_change"
    • listener: (text: string, dialog: Dialog) => void
        • (text: string, dialog: Dialog): void
        • Parameters

          Returns void

    Returns DialogExt

  • Dialog with input box, will callback text parameter when user confirm or cancel. If user cancel, text will be null.

    Parameters

    • event: "input"
    • listener: (text: string, dialog: Dialog) => void
        • (text: string, dialog: Dialog): void
        • Parameters

          Returns void

    Returns DialogExt

  • dialog dismiss event.

    Parameters

    • event: "dismiss"
    • listener: (dialog: Dialog) => void
        • Parameters

          Returns void

    Returns DialogExt

  • dialog cancel event, e.g. triggered when click outside of the dialog.

    Parameters

    • event: "cancel"
    • listener: (dialog: Dialog) => void
        • Parameters

          Returns void

    Returns DialogExt

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): DialogExt
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DialogExt

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): DialogExt
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DialogExt

once

  • once(event: string | symbol, listener: (...args: any[]) => void): DialogExt
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DialogExt

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): DialogExt
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DialogExt

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): DialogExt
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DialogExt

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): DialogExt
  • Parameters

    • Optional event: string | symbol

    Returns DialogExt

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): DialogExt
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns DialogExt

setMaxListeners

  • Parameters

    • n: number

    Returns DialogExt