-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.d.ts
40 lines (40 loc) · 1.39 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
import { Component } from 'react';
export interface Props {
children: any;
animate: boolean;
baseClassName: string;
animationClassName: string;
customTag?: string;
onAnimationEnd?: () => void;
}
export interface State {
animating: boolean;
clearAnimationClass: boolean;
}
interface AnimateOnChange {
elm: HTMLElement;
setElementRef: (ref: HTMLElement) => void;
}
/**
* # AnimateOnChange component.
* Adds `animationClassName` when `animate` is true, then removes
* `animationClassName` when animation is done (event `animationend` is
* triggered).
*
* @prop {string} baseClassName - Base class name.
* @prop {string} animationClassName - Class added when `animate == true`.
* @prop {bool} animate - Wheter to animate component.
*/
declare class AnimateOnChange extends Component<Props & any, State> implements AnimateOnChange {
constructor(props: Props);
componentDidMount(): void;
componentWillUnmount(): void;
addEventListener(type: string, elm: HTMLElement, eventHandler: (e: Event) => void): void;
removeEventListeners(type: string, elm: HTMLElement, eventHandler: (e: Event) => void): void;
updateEvents(type: string, newEvent: string): void;
animationStart(e: Event): void;
animationEnd(e: Event): void;
shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
render(): JSX.Element;
}
export default AnimateOnChange;