From b46717ad36f7fde811da5c5b2df27c8bad7f2a7b Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Tue, 30 Jul 2019 10:57:21 -0400 Subject: [PATCH] update typings for menu controller --- core/src/components.d.ts | 3 ++- core/src/components/menu-controller/menu-controller.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 18b0009930..cc1c715a68 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -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; + 'registerAnimation': (name: string, animation: IonicAnimation | AnimationBuilder) => Promise; /** * Enable or disable the ability to swipe open the menu. */ diff --git a/core/src/components/menu-controller/menu-controller.ts b/core/src/components/menu-controller/menu-controller.ts index f80633a7a5..9358972b79 100644 --- a/core/src/components/menu-controller/menu-controller.ts +++ b/core/src/components/menu-controller/menu-controller.ts @@ -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(); + private menuAnimations = new Map(); 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); }