menus module

Namespace to interact with the menu-specific part of the SDK. This object is used to show View Configuration, Action Menu and Navigation Bar Menu.

Classes

MenuItem

Represents information about menu item for Action Menu and Navigation Bar Menu.

Interfaces

ActionMenuParameters
ViewConfiguration

Represents information about item in View Configuration.

ViewData

Represents information about view to show on Navigation Bar Menu item selection

Enums

DisplayMode

Defines how a menu item should appear in the NavBar.

MenuListType

Represents information about type of list to display in Navigation Bar Menu.

Functions

initialize()
setNavBarMenu(MenuItem[], (id: string) => boolean)

Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.

setUpViews(ViewConfiguration[], (id: string) => boolean)

Registers list of view configurations and it's handler. Handler is responsible for listening selection of View Configuration.

showActionMenu(ActionMenuParameters, (id: string) => boolean)

Used to show Action Menu.

Function Details

initialize()

function initialize()

setNavBarMenu(MenuItem[], (id: string) => boolean)

Used to set menu items on the Navigation Bar. If icon is available, icon will be shown, otherwise title will be shown.

function setNavBarMenu(items: MenuItem[], handler: (id: string) => boolean)

Parameters

items

@microsoft/teams-js.@microsoft.teams-js.menus.MenuItem[]

List of MenuItems for Navigation Bar Menu.

handler

(id: string) => boolean

The handler to invoke when the user selects menu item.

setUpViews(ViewConfiguration[], (id: string) => boolean)

Registers list of view configurations and it's handler. Handler is responsible for listening selection of View Configuration.

function setUpViews(viewConfig: ViewConfiguration[], handler: (id: string) => boolean)

Parameters

viewConfig

@microsoft/teams-js.@microsoft.teams-js.menus.ViewConfiguration[]

List of view configurations. Minimum 1 value is required. *

handler

(id: string) => boolean

The handler to invoke when the user selects view configuration.

showActionMenu(ActionMenuParameters, (id: string) => boolean)

Used to show Action Menu.

function showActionMenu(params: ActionMenuParameters, handler: (id: string) => boolean)

Parameters

params

@microsoft/teams-js.@microsoft.teams-js.menus.ActionMenuParameters

Parameters for Menu Parameters

handler

(id: string) => boolean

The handler to invoke when the user selects menu item.