forked from formkit/auto-animate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
57 lines (57 loc) · 1.99 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
* Absolute coordinate positions adjusted for scroll.
*/
interface Coordinates {
top: number;
left: number;
width: number;
height: number;
}
/**
* Returns the width/height that the element should be transitioned between.
* This takes into account box-sizing.
* @param el - Element being animated
* @param oldCoords - Old set of Coordinates coordinates
* @param newCoords - New set of Coordinates coordinates
* @returns
*/
export declare function getTransitionSizes(el: Element, oldCoords: Coordinates, newCoords: Coordinates): number[];
export interface AutoAnimateOptions {
/**
* The time it takes to run a single sequence of animations in milliseconds.
*/
duration: number;
/**
* The type of easing to use.
* Default: ease-in-out
*/
easing: "linear" | "ease-in" | "ease-out" | "ease-in-out" | string;
/**
* Should be provided when animated elements are wrapped with a custom scroll container.
* Elements coordinates will be based on this container scroll offsets.
*/
scrollContainer?: Element;
}
/**
* A custom plugin that determines what the effects to run
*/
export interface AutoAnimationPlugin {
<T extends "add" | "remove" | "remain">(el: Element, action: T, newCoordinates?: T extends "add" | "remain" | "remove" ? Coordinates : undefined, oldCoordinates?: T extends "remain" ? Coordinates : undefined): KeyframeEffect;
}
/**
* A function that automatically adds animation effects to itself and its
* immediate children. Specifically it adds effects for adding, moving, and
* removing DOM elements.
* @param el - A parent element to add animations to.
* @param options - An optional object of options.
*/
export default function autoAnimate(el: HTMLElement, config?: Partial<AutoAnimateOptions> | AutoAnimationPlugin): void;
/**
* The vue directive.
*/
export declare const vAutoAnimate: {
mounted: (el: HTMLElement, binding: {
value: Partial<AutoAnimateOptions> | AutoAnimationPlugin;
}) => void;
};
export {};