import {Menu} from './menu';
import {MenuType} from './menu-types';
/**
* @name MenuController
* @description
* The MenuController is a provider which makes it easy to control a [Menu](../Menu).
* Its methods can be used to display the menu, enable the menu, toggle the menu, and more.
* The controller will grab a reference to the menu by the `side`, `id`, or, if neither
* of these are passed to it, it will grab the first menu it finds.
*
*
* @usage
*
* Add a basic menu component to start with. See the [Menu](../Menu) API docs
* for more information on adding menu components.
*
* ```html
*
*
*
* ...
*
*
*
*
*
* ```
*
* To call the controller methods, inject the `MenuController` provider
* into the page. Then, create some methods for opening, closing, and
* toggling the menu.
*
* ```ts
* import{Page, MenuController} from 'ionic-angular';
*
* @Page({...})
* export class MyPage {
*
* constructor(private menu: MenuController) {
*
* }
*
* openMenu() {
* this.menu.open();
* }
*
* closeMenu() {
* this.menu.close();
* }
*
* toggleMenu() {
* this.menu.toggle();
* }
*
* }
* ```
*
* Since only one menu exists, the `MenuController` will grab the
* correct menu and call the correct method for each.
*
*
* ### Multiple Menus on Different Sides
*
* For applications with both a left and right menu, the desired menu can be
* grabbed by passing the `side` of the menu. If nothing is passed, it will
* default to the `"left"` menu.
*
* ```html
* ...
* ...
*
* ```
*
* ```ts
* toggleLeftMenu() {
* this.menu.toggle();
* }
*
* toggleRightMenu() {
* this.menu.toggle('right');
* }
* ```
*
*
* ### Multiple Menus on the Same Side
*
* An application can have multiple menus on the same side. In order to determine
* the menu to control, an `id` should be passed. In the example below, the menu
* with the `authenticated` id will be enabled, and the menu with the `unauthenticated`
* id will be disabled.
*
* ```html
* ...
* ...
*
* ```
*
* ```ts
* enableAuthenticatedMenu() {
* this.menu.enable(true, 'authenticated');
* this.menu.enable(false, 'unauthenticated');
* }
* ```
*
* Note: if an app only has one menu, there is no reason to pass an `id`.
*
*
* @demo /docs/v2/demos/menu/
*
* @see {@link /docs/v2/components#menus Menu Component Docs}
* @see {@link ../Menu Menu API Docs}
*
*/
export class MenuController {
private _menus: Array