@types/web-animations-js
Advanced tools
| 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; | ||
| type: string; | ||
| bubbles: boolean; | ||
| cancelable: boolean; | ||
| currentTarget: Animation; | ||
| defaultPrevented: boolean; | ||
| eventPhase: number; | ||
| timeStamp: number; | ||
| } | ||
| 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 | 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 { | ||
| readonly currentTime: number | null; | ||
| getAnimations(): Animation[]; | ||
| play(effect: KeyframeEffect): Animation; | ||
| } | ||
| interface AnimationEffectTiming { | ||
| delay?: number; | ||
| direction?: AnimationEffectTimingPlaybackDirection; | ||
| duration?: number; | ||
| easing?: string; | ||
| endDelay?: number; | ||
| fill?: AnimationEffectTimingFillMode; | ||
| iterationStart?: number; | ||
| iterations?: number; | ||
| playbackRate?: number; | ||
| } | ||
| interface AnimationEffectReadOnly { | ||
| readonly timing: number; | ||
| getComputedTiming(): ComputedTimingProperties; | ||
| } | ||
| interface ComputedTimingProperties { | ||
| endTime: number; | ||
| activeDuration: number; | ||
| localTime: number | null; | ||
| progress: number | null; | ||
| currentIteration: number | null; | ||
| } | ||
| type AnimationEventListener = ((this: Animation, evt: AnimationPlaybackEvent) => any) | null; | ||
| interface Animation extends EventTarget { | ||
| currentTime: number | null; | ||
| id: string; | ||
| oncancel: AnimationEventListener; | ||
| onfinish: AnimationEventListener; | ||
| readonly playState: AnimationPlayState; | ||
| playbackRate: number; | ||
| startTime: number | null; | ||
| cancel(): void; | ||
| finish(): void; | ||
| pause(): void; | ||
| play(): void; | ||
| reverse(): void; | ||
| addEventListener(type: "finish" | "cancel", handler: EventListener): void; | ||
| removeEventListener(type: "finish" | "cancel", handler: EventListener): void; | ||
| effect: AnimationEffect | null; | ||
| readonly finished: Promise<Animation>; | ||
| readonly ready: Promise<Animation>; | ||
| timeline: AnimationTimeline | null; | ||
| } | ||
| declare var Animation: { | ||
| prototype: Animation; | ||
| new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; | ||
| }; | ||
| declare class SequenceEffect extends KeyframeEffect { | ||
| constructor(effects: KeyframeEffect[]); | ||
| } | ||
| declare class GroupEffect extends KeyframeEffect { | ||
| constructor(effects: KeyframeEffect[]); | ||
| } | ||
| interface Element { | ||
| animate(effect: AnimationKeyFrame | AnimationKeyFrame[] | null, timing: number | AnimationEffectTiming): Animation; | ||
| getAnimations(): Animation[]; | ||
| } | ||
| interface Document { | ||
| readonly timeline: AnimationTimeline; | ||
| } |
@@ -5,6 +5,6 @@ // Type definitions for web-animations-js 2.2 | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
| // TypeScript Version: 3.0 | ||
| type AnimationEffectTimingFillMode = "none" | "forwards" | "backwards" | "both" | "auto"; | ||
| type AnimationEffectTimingPlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse"; | ||
| type AnimationPlayState = "idle" | "running" | "paused" | "finished"; | ||
@@ -72,14 +72,3 @@ interface AnimationPlaybackEvent { | ||
| declare class KeyframeEffect implements AnimationEffectReadOnly { | ||
| constructor(target: HTMLElement, effect: AnimationKeyFrame | AnimationKeyFrame[], timing: number | AnimationEffectTiming, id?: string); | ||
| activeDuration: number; | ||
| onsample: (timeFraction: number | null, effect: KeyframeEffect, animation: Animation) => void | undefined; | ||
| parent: KeyframeEffect | null; | ||
| target: HTMLElement; | ||
| timing: number; | ||
| getComputedTiming(): ComputedTimingProperties; | ||
| getFrames(): AnimationKeyFrame[]; | ||
| remove(): void; | ||
| } | ||
| type AnimationEventListener = (this: Animation, evt: AnimationPlaybackEvent) => any; | ||
| type AnimationEventListener = ((this: Animation, evt: AnimationPlaybackEvent) => any) | null; | ||
@@ -93,3 +82,3 @@ interface Animation extends EventTarget { | ||
| playbackRate: number; | ||
| startTime: number; | ||
| startTime: number | null; | ||
| cancel(): void; | ||
@@ -102,6 +91,6 @@ finish(): void; | ||
| removeEventListener(type: "finish" | "cancel", handler: EventListener): void; | ||
| effect: AnimationEffectReadOnly; | ||
| effect: AnimationEffect | null; | ||
| readonly finished: Promise<Animation>; | ||
| readonly ready: Promise<Animation>; | ||
| timeline: AnimationTimeline; | ||
| timeline: AnimationTimeline | null; | ||
| } | ||
@@ -111,3 +100,3 @@ | ||
| prototype: Animation; | ||
| new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; | ||
| new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; | ||
| }; | ||
@@ -122,7 +111,8 @@ | ||
| interface Element { | ||
| animate(effect: AnimationKeyFrame | AnimationKeyFrame[], timing: number | AnimationEffectTiming): Animation; | ||
| animate(effect: AnimationKeyFrame | AnimationKeyFrame[] | null, timing: number | AnimationEffectTiming): Animation; | ||
| animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; | ||
| getAnimations(): Animation[]; | ||
| } | ||
| interface Document { | ||
| timeline: AnimationTimeline; | ||
| readonly timeline: AnimationTimeline; | ||
| } |
@@ -0,0 +0,0 @@ MIT License |
| { | ||
| "name": "@types/web-animations-js", | ||
| "version": "2.2.6", | ||
| "version": "2.2.7", | ||
| "description": "TypeScript definitions for web-animations-js", | ||
@@ -14,10 +14,18 @@ "license": "MIT", | ||
| "main": "", | ||
| "types": "index", | ||
| "typesVersions": { | ||
| ">=3.2.0-0": { | ||
| "*": [ | ||
| "ts3.2/*" | ||
| ] | ||
| } | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
| "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
| }, | ||
| "scripts": {}, | ||
| "dependencies": {}, | ||
| "typesPublisherContentHash": "611aa86729f7a0ad2cff05c6ba063547db0c8530f47896c28eeaa850544e69e8", | ||
| "typeScriptVersion": "2.0" | ||
| "typesPublisherContentHash": "180bd6a47860a5621dfb9dcb0180bf6c9e920bcd38b83112bc87d07ceb75cc65", | ||
| "typeScriptVersion": "3.0" | ||
| } |
@@ -8,10 +8,10 @@ # Installation | ||
| # Details | ||
| Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/web-animations-js | ||
| Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/web-animations-js | ||
| Additional Details | ||
| * Last updated: Mon, 26 Feb 2018 20:02:51 GMT | ||
| * Last updated: Fri, 14 Dec 2018 17:53:35 GMT | ||
| * Dependencies: none | ||
| * Global values: Animation, AnimationPlaybackEvent, GroupEffect, KeyframeEffect, SequenceEffect | ||
| * Global values: Animation, AnimationPlaybackEvent, GroupEffect, SequenceEffect | ||
| # Credits | ||
| These definitions were written by Kristian Moerch <https://github.com/kritollm>. |
9472
46.06%5
25%194
76.36%