Skip to content

Commit

Permalink
Update web-animations-js for TS 5.1 (DefinitelyTyped#64674)
Browse files Browse the repository at this point in the history
Typescript 5.1's DOM types add some more of the types of
web-animations-js. This PR updates the types to make them agree and removes the duplicate type declarations.
  • Loading branch information
sandersn authored and Vicary A committed Jun 29, 2023
1 parent e397a78 commit ce32a2c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions types/web-animations-js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// Project: https://github.com/web-animations/web-animations-js, https://github.com/web-animations
// Definitions by: Kristian Moerch <https://github.com/kritollm>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 5.1

type AnimationEffectTimingFillMode = "none" | "forwards" | "backwards" | "both" | "auto";
type AnimationEffectTimingPlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse";

interface AnimationPlaybackEvent {
target: Animation;
readonly currentTime: number | null;
readonly timelineTime: number | null;
readonly currentTime: CSSNumberish | null;
readonly timelineTime: CSSNumberish | null;
type: string;
bubbles: boolean;
cancelable: boolean;
Expand All @@ -20,8 +21,8 @@ interface AnimationPlaybackEvent {
}

interface AnimationPlaybackEventInit extends EventInit {
currentTime?: number | null | undefined;
timelineTime?: number | null | undefined;
currentTime?: CSSNumberish | null;
timelineTime?: CSSNumberish | null;
}

declare var AnimationPlaybackEvent: {
Expand All @@ -38,7 +39,7 @@ interface AnimationKeyFrame {
}

interface AnimationTimeline {
readonly currentTime: number | null;
readonly currentTime: CSSNumberish | null;
getAnimations(): Animation[];
play(effect: KeyframeEffect): Animation;
}
Expand Down Expand Up @@ -70,13 +71,13 @@ interface ComputedTimingProperties {
type AnimationEventListener = ((this: Animation, evt: AnimationPlaybackEvent) => any) | null;

interface Animation extends EventTarget {
currentTime: number | null;
currentTime: CSSNumberish | null;
id: string;
oncancel: AnimationEventListener;
onfinish: AnimationEventListener;
readonly playState: AnimationPlayState;
playbackRate: number;
startTime: number | null;
startTime: CSSNumberish | null;
cancel(): void;
finish(): void;
pause(): void;
Expand Down

0 comments on commit ce32a2c

Please sign in to comment.