mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
update typings for menu controller
This commit is contained in:
3
core/src/components.d.ts
vendored
3
core/src/components.d.ts
vendored
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user