Constructors

Properties

chatWrappers: Record<string, ChatWrapper> = {}
feedbackForm?: FeedbackForm
lastEventId: string = ''
sheet?: Sheet
splashLoader: ExtendedHTMLElement
splashLoaderText: ExtendedHTMLElement
tabContentsWrapper: ExtendedHTMLElement
tabsWrapper: ExtendedHTMLElement

Methods

  • Adds a new item to the chat window

    Parameters

    • tabId: string

      Corresponding tab ID.

    • chatItem: ChatItem

    Returns void

  • Parameters

    Returns void

  • Converts a card to an ANSWER if it is an ANSWER_STREAM

    Parameters

    • tabId: string

      Corresponding tab ID.

    • messageId: string

      Corresponding tab ID.

    • Optional updateWith: Partial<ChatItem>

      Optional, if you like update the card while converting it to a normal ANSWER instead of a stream one, you can send a ChatItem object to update with.

    Returns CardRenderDetails

  • Parameters

    • tabId: string

    Returns void

  • This function returns the selected tab id if there is any, otherwise returns undefined

    Returns undefined | string

    string selectedTabId or undefined

  • Parameters

    • tabId: string

    Returns any

  • Simply creates and shows a notification

    Parameters

    • props: {
          content: string;
          duration?: number;
          onNotificationClick?: ((eventId) => void);
          onNotificationHide?: ((eventId) => void);
          title?: string;
          type?: NotificationType;
      }

      NotificationProps

      • content: string
      • Optional duration?: number

        -1 for infinite

      • Optional onNotificationClick?: ((eventId) => void)
          • (eventId): void
          • Parameters

            • eventId: string

            Returns void

      • Optional onNotificationHide?: ((eventId) => void)
          • (eventId): void
          • Parameters

            • eventId: string

            Returns void

      • Optional title?: string
      • Optional type?: NotificationType

    Returns void

  • Parameters

    • data: DetailedListSheetProps

    Returns {
        changeTarget: ((direction, snapOnLastAndFirst?) => void);
        close: (() => void);
        getTargetElementId: (() => undefined | string);
        update: ((data) => void);
    }

    • changeTarget: ((direction, snapOnLastAndFirst?) => void)
        • (direction, snapOnLastAndFirst?): void
        • Parameters

          • direction: "up" | "down"
          • Optional snapOnLastAndFirst: boolean

          Returns void

    • close: (() => void)
        • (): void
        • Returns void

    • getTargetElementId: (() => undefined | string)
        • (): undefined | string
        • Returns undefined | string

    • update: ((data) => void)
  • If exists, close the given tab

    Parameters

    • tabId: string

      Tab ID to switch to

    • eventId: string

      last action's user event ID passed from an event binded to mynahUI. Without user intent you cannot switch to a different tab

    Returns void

  • If exists, switch to a different tab

    Parameters

    • tabId: string

      Tab ID to switch to

    • Optional eventId: string

      last action's user event ID passed from an event binded to mynahUI. Without user intent you cannot switch to a different tab

    Returns void

  • Serialize all (non-empty) chat messages in a tab into a string

    Parameters

    • tabId: string

      Corresponding tab ID.

    • format: "markdown" | "html"

      Whether to serialize to markdown or HTML format

    Returns string

  • Simply creates and shows a custom form

    Parameters

    Returns void

  • Toggles the visibility of the splash loader screen

    Parameters

    • visible: boolean
    • Optional text: string

    Returns void

  • Updates the chat item with the given messageId

    Parameters

    • tabId: string

      Corresponding tab ID.

    • messageId: string

      Corresponding tab ID.

    • updateWith: Partial<ChatItem>

      ChatItem object to update with.

    Returns void

  • Updates the last ChatItemType.ANSWER_STREAM chat item

    Parameters

    • tabId: string

      Corresponding tab ID.

    • updateWith: Partial<ChatItem>

      ChatItem object to update with.

    Returns void

  • Updates only the UI with the given data for the given tab Send tab id as an empty string to open a new tab! If max tabs reached, will not return tabId

    Parameters

    Returns undefined | string