2017-01-26 11:16:51 -08:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
2017-02-22 15:14:49 -08:00
|
|
|
import {ɵStyleData} from '@angular/animations';
|
|
|
|
import {AnimationEngineInstruction, AnimationTransitionInstructionType} from '../render/animation_engine_instruction';
|
2017-01-26 11:16:51 -08:00
|
|
|
import {AnimationTimelineInstruction} from './animation_timeline_instruction';
|
|
|
|
|
|
|
|
export interface AnimationTransitionInstruction extends AnimationEngineInstruction {
|
|
|
|
triggerName: string;
|
|
|
|
isRemovalTransition: boolean;
|
2017-02-22 15:14:49 -08:00
|
|
|
fromState: string;
|
|
|
|
fromStyles: ɵStyleData;
|
|
|
|
toState: string;
|
|
|
|
toStyles: ɵStyleData;
|
2017-01-26 11:16:51 -08:00
|
|
|
timelines: AnimationTimelineInstruction[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export function createTransitionInstruction(
|
2017-02-22 15:14:49 -08:00
|
|
|
triggerName: string, fromState: string, toState: string, isRemovalTransition: boolean,
|
|
|
|
fromStyles: ɵStyleData, toStyles: ɵStyleData,
|
2017-01-26 11:16:51 -08:00
|
|
|
timelines: AnimationTimelineInstruction[]): AnimationTransitionInstruction {
|
|
|
|
return {
|
|
|
|
type: AnimationTransitionInstructionType.TransitionAnimation,
|
|
|
|
triggerName,
|
|
|
|
isRemovalTransition,
|
2017-02-22 15:14:49 -08:00
|
|
|
fromState,
|
2017-01-26 11:16:51 -08:00
|
|
|
fromStyles,
|
2017-02-22 15:14:49 -08:00
|
|
|
toState,
|
2017-01-26 11:16:51 -08:00
|
|
|
toStyles,
|
|
|
|
timelines
|
|
|
|
};
|
|
|
|
}
|