refactor(animations): ensure compatibility with noImplicitOverride (#42512)

Adds the `override` keyword to the `animations` sources to ensure
 compatibility with `noImplicitOverride`.

PR Close #42512
This commit is contained in:
Paul Gschwendtner 2021-06-07 21:00:45 +02:00 committed by Andrew Kushnir
parent 907363348a
commit 73137563d5
4 changed files with 13 additions and 13 deletions

View File

@ -825,18 +825,18 @@ class SubTimelineBuilder extends TimelineBuilder {
public timings: AnimateTimings;
constructor(
driver: AnimationDriver, public element: any, public keyframes: ɵStyleData[],
driver: AnimationDriver, element: any, public keyframes: ɵStyleData[],
public preStyleProps: string[], public postStyleProps: string[], timings: AnimateTimings,
private _stretchStartingKeyframe: boolean = false) {
super(driver, element, timings.delay);
this.timings = {duration: timings.duration, delay: timings.delay, easing: timings.easing};
}
containsAnimation(): boolean {
override containsAnimation(): boolean {
return this.keyframes.length > 1;
}
buildKeyframes(): AnimationTimelineInstruction {
override buildKeyframes(): AnimationTimelineInstruction {
let keyframes = this.keyframes;
let {delay, duration, easing} = this.timings;
if (this._stretchStartingKeyframe && delay) {

View File

@ -18,7 +18,7 @@ export class DirectStylePlayer extends NoopAnimationPlayer {
this._styles = hypenatePropsObject(styles);
}
init() {
override init() {
if (this.__initialized || !this._startingStyles) return;
this.__initialized = true;
Object.keys(this._styles).forEach(prop => {
@ -27,7 +27,7 @@ export class DirectStylePlayer extends NoopAnimationPlayer {
super.init();
}
play() {
override play() {
if (!this._startingStyles) return;
this.init();
Object.keys(this._styles)
@ -35,7 +35,7 @@ export class DirectStylePlayer extends NoopAnimationPlayer {
super.play();
}
destroy() {
override destroy() {
if (!this._startingStyles) return;
Object.keys(this._startingStyles).forEach(prop => {
const value = this._startingStyles![prop];

View File

@ -122,7 +122,7 @@ class SuffixNormalizer extends AnimationStyleNormalizer {
}
class SuperMockDriver extends MockAnimationDriver {
computeStyle(element: any, prop: string, defaultValue?: string): string {
override computeStyle(element: any, prop: string, defaultValue?: string): string {
return '*star*';
}
}

View File

@ -77,23 +77,23 @@ export class MockAnimationPlayer extends NoopAnimationPlayer {
}
/* @internal */
init() {
override init() {
super.init();
this._onInitFns.forEach(fn => fn());
this._onInitFns = [];
}
reset() {
override reset() {
super.reset();
this.__started = false;
}
finish(): void {
override finish(): void {
super.finish();
this.__finished = true;
}
destroy(): void {
override destroy(): void {
super.destroy();
this.__finished = true;
}
@ -101,12 +101,12 @@ export class MockAnimationPlayer extends NoopAnimationPlayer {
/* @internal */
triggerMicrotask() {}
play(): void {
override play(): void {
super.play();
this.__started = true;
}
hasStarted() {
override hasStarted() {
return this.__started;
}