mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
refactor(animation): rename AnimationOnFinishOptions to AnimationCallbackOptions (#19551)
This commit is contained in:
@ -210,7 +210,7 @@ export interface Animation {
|
|||||||
* Add a callback to be run
|
* Add a callback to be run
|
||||||
* upon the animation ending
|
* upon the animation ending
|
||||||
*/
|
*/
|
||||||
onFinish(callback: AnimationLifecycle, opts?: AnimationOnFinishOptions): Animation;
|
onFinish(callback: AnimationLifecycle, opts?: AnimationCallbackOptions): Animation;
|
||||||
|
|
||||||
/** @deprecated */
|
/** @deprecated */
|
||||||
playAsync(): Promise<void>;
|
playAsync(): Promise<void>;
|
||||||
@ -220,7 +220,7 @@ export interface Animation {
|
|||||||
|
|
||||||
export type AnimationLifecycle = (currentStep: 0 | 1, animation: Animation) => void;
|
export type AnimationLifecycle = (currentStep: 0 | 1, animation: Animation) => void;
|
||||||
|
|
||||||
export interface AnimationOnFinishOptions {
|
export interface AnimationCallbackOptions {
|
||||||
oneTimeCallback: boolean;
|
oneTimeCallback: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
import { raf } from '../helpers';
|
import { raf } from '../helpers';
|
||||||
|
|
||||||
import { Animation, AnimationDirection, AnimationFill, AnimationKeyFrame, AnimationKeyFrames, AnimationLifecycle, AnimationOnFinishOptions, AnimationPlayOptions } from './animation-interface';
|
import { Animation, AnimationCallbackOptions, AnimationDirection, AnimationFill, AnimationKeyFrame, AnimationKeyFrames, AnimationLifecycle, AnimationPlayOptions } from './animation-interface';
|
||||||
import { addClassToArray, animationEnd, createKeyframeStylesheet, generateKeyframeName, generateKeyframeRules, removeStyleProperty, setStyleProperty } from './animation-utils';
|
import { addClassToArray, animationEnd, createKeyframeStylesheet, generateKeyframeName, generateKeyframeRules, removeStyleProperty, setStyleProperty } from './animation-utils';
|
||||||
|
|
||||||
interface AnimationOnFinishCallback {
|
interface AnimationOnFinishCallback {
|
||||||
c: AnimationLifecycle;
|
c: AnimationLifecycle;
|
||||||
o?: AnimationOnFinishOptions;
|
o?: AnimationCallbackOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AnimationInternal extends Animation {
|
interface AnimationInternal extends Animation {
|
||||||
@ -101,7 +101,7 @@ export const createAnimation = (): Animation => {
|
|||||||
cleanUpStyleSheets();
|
cleanUpStyleSheets();
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFinish = (callback: AnimationLifecycle, opts?: AnimationOnFinishOptions) => {
|
const onFinish = (callback: AnimationLifecycle, opts?: AnimationCallbackOptions) => {
|
||||||
const callbacks = (opts && opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
|
const callbacks = (opts && opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
|
||||||
callbacks.push({ c: callback, o: opts });
|
callbacks.push({ c: callback, o: opts });
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user