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:
parent
907363348a
commit
73137563d5
@ -825,18 +825,18 @@ class SubTimelineBuilder extends TimelineBuilder {
|
|||||||
public timings: AnimateTimings;
|
public timings: AnimateTimings;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
driver: AnimationDriver, public element: any, public keyframes: ɵStyleData[],
|
driver: AnimationDriver, element: any, public keyframes: ɵStyleData[],
|
||||||
public preStyleProps: string[], public postStyleProps: string[], timings: AnimateTimings,
|
public preStyleProps: string[], public postStyleProps: string[], timings: AnimateTimings,
|
||||||
private _stretchStartingKeyframe: boolean = false) {
|
private _stretchStartingKeyframe: boolean = false) {
|
||||||
super(driver, element, timings.delay);
|
super(driver, element, timings.delay);
|
||||||
this.timings = {duration: timings.duration, delay: timings.delay, easing: timings.easing};
|
this.timings = {duration: timings.duration, delay: timings.delay, easing: timings.easing};
|
||||||
}
|
}
|
||||||
|
|
||||||
containsAnimation(): boolean {
|
override containsAnimation(): boolean {
|
||||||
return this.keyframes.length > 1;
|
return this.keyframes.length > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildKeyframes(): AnimationTimelineInstruction {
|
override buildKeyframes(): AnimationTimelineInstruction {
|
||||||
let keyframes = this.keyframes;
|
let keyframes = this.keyframes;
|
||||||
let {delay, duration, easing} = this.timings;
|
let {delay, duration, easing} = this.timings;
|
||||||
if (this._stretchStartingKeyframe && delay) {
|
if (this._stretchStartingKeyframe && delay) {
|
||||||
|
@ -18,7 +18,7 @@ export class DirectStylePlayer extends NoopAnimationPlayer {
|
|||||||
this._styles = hypenatePropsObject(styles);
|
this._styles = hypenatePropsObject(styles);
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
override init() {
|
||||||
if (this.__initialized || !this._startingStyles) return;
|
if (this.__initialized || !this._startingStyles) return;
|
||||||
this.__initialized = true;
|
this.__initialized = true;
|
||||||
Object.keys(this._styles).forEach(prop => {
|
Object.keys(this._styles).forEach(prop => {
|
||||||
@ -27,7 +27,7 @@ export class DirectStylePlayer extends NoopAnimationPlayer {
|
|||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
play() {
|
override play() {
|
||||||
if (!this._startingStyles) return;
|
if (!this._startingStyles) return;
|
||||||
this.init();
|
this.init();
|
||||||
Object.keys(this._styles)
|
Object.keys(this._styles)
|
||||||
@ -35,7 +35,7 @@ export class DirectStylePlayer extends NoopAnimationPlayer {
|
|||||||
super.play();
|
super.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
override destroy() {
|
||||||
if (!this._startingStyles) return;
|
if (!this._startingStyles) return;
|
||||||
Object.keys(this._startingStyles).forEach(prop => {
|
Object.keys(this._startingStyles).forEach(prop => {
|
||||||
const value = this._startingStyles![prop];
|
const value = this._startingStyles![prop];
|
||||||
|
@ -122,7 +122,7 @@ class SuffixNormalizer extends AnimationStyleNormalizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SuperMockDriver extends MockAnimationDriver {
|
class SuperMockDriver extends MockAnimationDriver {
|
||||||
computeStyle(element: any, prop: string, defaultValue?: string): string {
|
override computeStyle(element: any, prop: string, defaultValue?: string): string {
|
||||||
return '*star*';
|
return '*star*';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,23 +77,23 @@ export class MockAnimationPlayer extends NoopAnimationPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* @internal */
|
/* @internal */
|
||||||
init() {
|
override init() {
|
||||||
super.init();
|
super.init();
|
||||||
this._onInitFns.forEach(fn => fn());
|
this._onInitFns.forEach(fn => fn());
|
||||||
this._onInitFns = [];
|
this._onInitFns = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
reset() {
|
override reset() {
|
||||||
super.reset();
|
super.reset();
|
||||||
this.__started = false;
|
this.__started = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
finish(): void {
|
override finish(): void {
|
||||||
super.finish();
|
super.finish();
|
||||||
this.__finished = true;
|
this.__finished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy(): void {
|
override destroy(): void {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
this.__finished = true;
|
this.__finished = true;
|
||||||
}
|
}
|
||||||
@ -101,12 +101,12 @@ export class MockAnimationPlayer extends NoopAnimationPlayer {
|
|||||||
/* @internal */
|
/* @internal */
|
||||||
triggerMicrotask() {}
|
triggerMicrotask() {}
|
||||||
|
|
||||||
play(): void {
|
override play(): void {
|
||||||
super.play();
|
super.play();
|
||||||
this.__started = true;
|
this.__started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasStarted() {
|
override hasStarted() {
|
||||||
return this.__started;
|
return this.__started;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user