ionic-framework
Version:
150 lines (149 loc) • 4.05 kB
TypeScript
import { ElementRef } from 'angular2/core';
import { Ion } from '../ion';
import { IonicApp } from '../app/app';
import { Config } from '../../config/config';
import { Platform } from '../../platform/platform';
import { Keyboard } from '../../util/keyboard';
/**
* _For basic Menu usage, see the [Menu section](../../../../components/#menus)
* of the Component docs._
*
* Menu is a side-menu navigation that can be dragged out or toggled to show.
*
* In order to use Menu, you must specify a [reference](https://angular.io/docs/ts/latest/guide/user-input.html#local-variables)
* to the content element that Menu should listen on for drag events, using the
* `content` property:
* ```html
* <ion-menu [content]="contentRef">
* <ion-content>
* <ion-list>
* ...
* </ion-list>
* </ion-content>
* </ion-menu>
*
* <ion-nav #content-ref [root]="rootPage"></ion-nav>
* ```
*
* By default, Menus are on the left, but this can be overriden with the `side`
* property:
* ```html
* <ion-menu [content]="contentRef" side="right"></ion-menu>
* ```
*
* Menus can optionally be given an `id` attribute which allows the app to
* to get ahold of menu references. If no `id` is given then the menu
* automatically receives an `id` created from the side it is on, such as
* `leftMenu` or `rightMenu`. When using more than one menu it is always
* recommended to give each menu a unique `id`. Additionally menu-toggle and
* menu-close directives should be given menu id values of their respective
* menu.
*
* Menu supports two display styles: overlay, and reveal. Overlay
* is the traditional Android drawer style, and Reveal is the traditional iOS
* style. By default, Menu will adjust to the correct style for the platform,
* but this can be overriden using the `type` property:
* ```html
* <ion-menu [content]="contentRef" type="overlay"></ion-menu>
* ```
* @see {@link /docs/v2/components#menus Menu Component Docs}
* @see {@link /docs/v2/components#navigation Navigation Component Docs}
* @see {@link ../../nav/Nav Nav API Docs}
*
*/
export declare class Menu extends Ion {
constructor(app: IonicApp, elementRef: ElementRef, config: Config, platform: Platform, keyboard: Keyboard);
/**
* @private
*/
ngOnInit(): void;
/**
* @private
*/
_initGesture(): void;
/**
* @private
*/
_initType(type: any): void;
/**
* @private
*/
_getType(): any;
/**
* Sets the state of the Menu to open or not.
* @param {boolean} isOpen If the Menu is open or not.
* @return {Promise} TODO
*/
setOpen(shouldOpen: any): any;
/**
* @private
*/
setProgressStart(): void;
/**
* @private
*/
setProgess(value: any): void;
/**
* @private
*/
setProgressEnd(shouldComplete: any): void;
/**
* @private
*/
_before(): void;
/**
* @private
*/
_after(isOpen: any): void;
/**
* @private
*/
_prevent(): void;
/**
* @private
*/
_isPrevented(): boolean;
/**
* TODO
* @return {TODO} TODO
*/
open(): any;
/**
* TODO
* @return {TODO} TODO
*/
close(): any;
/**
* TODO
* @return {TODO} TODO
*/
toggle(): any;
/**
* Used to enable or disable a menu. For example, there could be multiple
* left menus, but only one of them should be able to be dragged open.
* @param {boolean} shouldEnable True if it should be enabled, false if not.
* @return {Menu} Returns the instance of the menu, which is useful for chaining.
*/
enable(shouldEnable: any): this;
/**
* @private
*/
getMenuElement(): any;
/**
* @private
*/
getContentElement(): any;
/**
* @private
*/
getBackdropElement(): any;
/**
* @private
*/
static register(name: any, cls: any): void;
/**
* @private
*/
ngOnDestroy(): void;
static getById(app: any, menuId: any): any;
}