@types/web-animations-js
Advanced tools
Comparing version 2.2.5 to 2.2.6
@@ -8,9 +8,8 @@ // Type definitions for web-animations-js 2.2 | ||
type AnimationEffectTimingPlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse"; | ||
type AnimationPlayState = "idle" | "pending" | "running" | "paused" | "finished"; | ||
type AnimationPlayState = "idle" | "running" | "paused" | "finished"; | ||
declare class AnimationPlaybackEvent { | ||
constructor(target: Animation, currentTime: number, timelineTime: number); | ||
interface AnimationPlaybackEvent { | ||
target: Animation; | ||
currentTime: number; | ||
timelineTime: number; | ||
readonly currentTime: number | null; | ||
readonly timelineTime: number | null; | ||
type: string; | ||
@@ -25,10 +24,22 @@ bubbles: boolean; | ||
interface AnimationPlaybackEventInit extends EventInit { | ||
currentTime?: number | null; | ||
timelineTime?: number | null; | ||
} | ||
declare var AnimationPlaybackEvent: { | ||
prototype: AnimationPlaybackEvent; | ||
new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; | ||
}; | ||
interface AnimationKeyFrame { | ||
easing?: string; | ||
offset?: number; | ||
[key: string]: string | number | [string | number, string | number] | undefined; | ||
easing?: string | string[]; | ||
offset?: number | Array<number | null> | null; | ||
opacity?: number | number[]; | ||
transform?: string | string[]; | ||
// [key: string]: string | number | [string | number, string | number] | undefined; (duplicate string indexer in TypeScript 2.7+) | ||
} | ||
interface AnimationTimeline { | ||
currentTime: number; | ||
readonly currentTime: number | null; | ||
getAnimations(): Animation[]; | ||
@@ -48,3 +59,17 @@ play(effect: KeyframeEffect): Animation; | ||
} | ||
declare class KeyframeEffect { | ||
interface AnimationEffectReadOnly { | ||
readonly timing: number; | ||
getComputedTiming(): ComputedTimingProperties; | ||
} | ||
interface ComputedTimingProperties { | ||
endTime: number; | ||
activeDuration: number; | ||
localTime: number | null; | ||
progress: number | null; | ||
currentIteration: number | null; | ||
} | ||
declare class KeyframeEffect implements AnimationEffectReadOnly { | ||
constructor(target: HTMLElement, effect: AnimationKeyFrame | AnimationKeyFrame[], timing: number | AnimationEffectTiming, id?: string); | ||
@@ -55,11 +80,11 @@ activeDuration: number; | ||
target: HTMLElement; | ||
timing: AnimationEffectTiming; | ||
timing: number; | ||
getComputedTiming(): ComputedTimingProperties; | ||
getFrames(): AnimationKeyFrame[]; | ||
remove(): void; | ||
} | ||
type AnimationEventListener = (evt: AnimationPlaybackEvent) => void; | ||
type AnimationEventListener = (this: Animation, evt: AnimationPlaybackEvent) => any; | ||
declare class Animation { | ||
constructor(effect: KeyframeEffect, timeline?: AnimationTimeline); | ||
currentTime: number; | ||
interface Animation extends EventTarget { | ||
currentTime: number | null; | ||
id: string; | ||
@@ -76,5 +101,5 @@ oncancel: AnimationEventListener; | ||
reverse(): void; | ||
addEventListener(type: "finish" | "cancel", handler: AnimationEventListener): void; | ||
removeEventListener(type: "finish" | "cancel", handler: AnimationEventListener): void; | ||
effect: KeyframeEffect; | ||
addEventListener(type: "finish" | "cancel", handler: EventListener): void; | ||
removeEventListener(type: "finish" | "cancel", handler: EventListener): void; | ||
effect: AnimationEffectReadOnly; | ||
readonly finished: Promise<Animation>; | ||
@@ -85,2 +110,7 @@ readonly ready: Promise<Animation>; | ||
declare var Animation: { | ||
prototype: Animation; | ||
new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; | ||
}; | ||
declare class SequenceEffect extends KeyframeEffect { | ||
@@ -87,0 +117,0 @@ constructor(effects: KeyframeEffect[]); |
{ | ||
"name": "@types/web-animations-js", | ||
"version": "2.2.5", | ||
"version": "2.2.6", | ||
"description": "TypeScript definitions for web-animations-js", | ||
@@ -9,3 +9,4 @@ "license": "MIT", | ||
"name": "Kristian Moerch", | ||
"url": "https://github.com/kritollm" | ||
"url": "https://github.com/kritollm", | ||
"githubUsername": "kritollm" | ||
} | ||
@@ -20,4 +21,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "00d1e5acff50a1c7def204e4a5cc1eea3a915b8050edb6d1f099243855c7226a", | ||
"typesPublisherContentHash": "611aa86729f7a0ad2cff05c6ba063547db0c8530f47896c28eeaa850544e69e8", | ||
"typeScriptVersion": "2.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 21 Aug 2017 22:03:22 GMT | ||
* Last updated: Mon, 26 Feb 2018 20:02:51 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: Animation, AnimationPlaybackEvent, GroupEffect, KeyframeEffect, SequenceEffect |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6485
110