iRealNirmal 3a6af8e629 fix(platform-browser): update started state on reset (#41608)
This commit fixes the state of variable _started on call of reset method.

Earlier behaviour was on call of `reset()` method we are not setting back
`_started` flag's value to false and it created various issue for end user
which were expecting this behaviour as per name of method.

We provided end user `reset()` method, but it was empty method and on call
of it wasn't doing anything. As end user/developer were not able to
reuse animation not animation after call of reset method.

In this PR on call of `reset()` method we are setting flag `_started` value to false
which can be accessed by `hasStarted()`.

Resolves #18140

PR Close #41608
2021-05-25 20:28:41 +00:00

36 lines
1.2 KiB
TypeScript

export declare class MockAnimationDriver implements AnimationDriver {
animate(element: any, keyframes: {
[key: string]: string | number;
}[], duration: number, delay: number, easing: string, previousPlayers?: any[]): MockAnimationPlayer;
computeStyle(element: any, prop: string, defaultValue?: string): string;
containsElement(elm1: any, elm2: any): boolean;
matchesElement(element: any, selector: string): boolean;
query(element: any, selector: string, multi: boolean): any[];
validateStyleProperty(prop: string): boolean;
static log: AnimationPlayer[];
}
export declare class MockAnimationPlayer extends NoopAnimationPlayer {
currentSnapshot: ɵStyleData;
delay: number;
duration: number;
easing: string;
element: any;
keyframes: {
[key: string]: string | number;
}[];
previousPlayers: any[];
previousStyles: {
[key: string]: string | number;
};
constructor(element: any, keyframes: {
[key: string]: string | number;
}[], duration: number, delay: number, easing: string, previousPlayers: any[]);
beforeDestroy(): void;
destroy(): void;
finish(): void;
hasStarted(): boolean;
play(): void;
reset(): void;
}