Files
ionic-framework/core/src/components/animation-controller/animation-controller.tsx
2018-09-14 18:47:00 +02:00

24 lines
659 B
TypeScript

import { Component, ComponentInterface, Method } from '@stencil/core';
import { Animation, AnimationBuilder, AnimationController } from '../../interface';
import { Animator } from './animator';
/** @hidden */
@Component({
tag: 'ion-animation-controller'
})
export class AnimationControllerImpl implements ComponentInterface, AnimationController {
/**
* Creates an animation instance
*/
@Method()
create(animationBuilder?: AnimationBuilder, baseEl?: any, opts?: any): Promise<Animation> {
if (animationBuilder) {
return animationBuilder(Animator as any, baseEl, opts);
}
return Promise.resolve(new Animator() as any);
}
}