refactor(animations): handle #24571 todos (#49231)

This commit removes the remaining ones in animations code base

PR Close #49231
This commit is contained in:
Matthieu Riegler
2023-02-27 19:33:12 +01:00
committed by Jessica Janiuk
parent 2312eb53ef
commit 477237aa85
3 changed files with 5 additions and 7 deletions
@@ -615,8 +615,7 @@ export class AnimationTimelineContext {
export class TimelineBuilder {
public duration: number = 0;
// TODO(issue/24571): remove '!'.
public easing!: string|null;
public easing: string|null = null;
private _previousKeyframe: ɵStyleDataMap = new Map();
private _currentKeyframe: ɵStyleDataMap = new Map();
private _keyframes = new Map<number, ɵStyleDataMap>();
@@ -1499,8 +1499,7 @@ export class TransitionAnimationPlayer implements AnimationPlayer {
private _queuedCallbacks = new Map<string, ((event: any) => any)[]>();
public readonly destroyed = false;
// TODO(issue/24571): remove '!'.
public parentPlayer!: AnimationPlayer;
public parentPlayer: AnimationPlayer|null = null;
public markedForDestroy: boolean = false;
public disabled = false;
@@ -30,7 +30,7 @@ export class WebAnimationsPlayer implements AnimationPlayer {
private _originalOnDoneFns: Function[] = [];
private _originalOnStartFns: Function[] = [];
// TODO(issue/24571): remove '!'.
// using non-null assertion because it's re(set) by init();
public readonly domPlayer!: DOMAnimation;
public time = 0;
@@ -64,8 +64,8 @@ export class WebAnimationsPlayer implements AnimationPlayer {
this._initialized = true;
const keyframes = this.keyframes;
(this as {domPlayer: DOMAnimation}).domPlayer =
this._triggerWebAnimation(this.element, keyframes, this.options);
// @ts-expect-error overwriting a readonly property
this.domPlayer = this._triggerWebAnimation(this.element, keyframes, this.options);
this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : new Map();
this.domPlayer.addEventListener('finish', () => this._onFinish());
}