update typings for menu controller

This commit is contained in:
Liam DeBeasi
2019-07-30 10:57:21 -04:00
parent c1b4347590
commit b46717ad36
2 changed files with 5 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ import {
FrameworkDelegate,
HeaderFn,
InputChangeEventDetail,
IonicAnimation,
ItemHeightFn,
ItemRenderFn,
ItemReorderEventDetail,
@@ -1387,7 +1388,7 @@ export namespace Components {
/**
* Registers a new animation that can be used with any `ion-menu` by passing the name of the animation in its `type` property.
*/
'registerAnimation': (name: string, animation: any) => Promise<void>;
'registerAnimation': (name: string, animation: IonicAnimation | AnimationBuilder) => Promise<void>;
/**
* Enable or disable the ability to swipe open the menu.
*/

View File

@@ -1,7 +1,7 @@
import { Build, Component, Method } from '@stencil/core';
import { config } from '../../global/config';
import { AnimationBuilder, MenuControllerI, MenuI } from '../../interface';
import { AnimationBuilder, IonicAnimation, MenuControllerI, MenuI } from '../../interface';
import { menuOverlayAnimation } from './animations/overlay';
import { menuPushAnimation } from './animations/push';
@@ -14,7 +14,7 @@ import { menuRevealAnimation } from './animations/reveal';
export class MenuController implements MenuControllerI {
private menus: MenuI[] = [];
private menuAnimations = new Map<string, AnimationBuilder>();
private menuAnimations = new Map<string, IonicAnimation | AnimationBuilder>();
constructor() {
this.registerAnimation('reveal', menuRevealAnimation);
@@ -226,7 +226,7 @@ export class MenuController implements MenuControllerI {
* @param animation The animation function to register.
*/
@Method()
async registerAnimation(name: string, animation: any) {
async registerAnimation(name: string, animation: IonicAnimation | AnimationBuilder) {
this.menuAnimations.set(name, animation);
}