UNPKG

2.21 kBTypeScriptView Raw
1// Type definitions for rc-queue-anim 1.6
2// Project: https://github.com/react-component/queue-anim
3// Definitions by: jljsj33 <https://github.com/jljsj33>
4// Definitions: https://github.com/react-component/queue-anim
5import * as React from 'react';
6
7export type IQueueType = 'alpha' | 'left' | 'right' | 'top' | 'bottom' | 'scale' | 'scaleBig' | 'scaleX' | 'scaleY';
8export type INumberOrArrayOrFunc = number | [number, number] | ((e: { key: string, index: number }) => number | [number, number]);
9export type IEaseType = 'linear' |
10 'easeInSine' | 'easeOutSine' | 'easeInOutSine' |
11 'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' |
12 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic' |
13 'easeInQuart' | 'easeOutQuart' | 'easeInOutQuart' |
14 'easeInQuint' | 'easeOutQuint' | 'easeInOutQuint' |
15 'easeInExpo' | 'easeInOutExpo' | 'easeInOutExpo' |
16 'easeInCirc' | 'easeOutCirc' | 'easeInOutCirc' |
17 'easeInBack' | 'easeOutBack' | 'easeInOutBack' |
18 'easeInElastic' | 'easeOutElastic' | 'easeInOutElastic' |
19 'easeInBounce' | 'easeOutBounce' | 'easeInOutBounce' | [number, number, number, number] |
20 ((t: number, b: number, c: number, d: number) => number); // TweenOne ease path;
21
22export type IQueueTypeOrArrayOrFunc = IQueueType | [IQueueType, IQueueType] | ((e: { key: string, index: number }) => IQueueType | [IQueueType, IQueueType]);
23export type IEaseTypeOrArrayOrFunc = IEaseType | [IEaseType, IEaseType] | ((e: { key: string, index: number }) => IEaseType | [IEaseType, IEaseType]);
24export type IAnimConfigOrArrayOrFunc = {} | [{}] | ((e: { key: string, index: number }) => {} | [{}, {}]);
25export interface IProps<T> extends React.HTMLAttributes<T> {
26 type?: IQueueTypeOrArrayOrFunc;
27 animConfig?: IAnimConfigOrArrayOrFunc;
28 delay?: INumberOrArrayOrFunc;
29 duration?: INumberOrArrayOrFunc;
30 interval?: INumberOrArrayOrFunc;
31 leaveReverse?: boolean;
32 ease?: IEaseTypeOrArrayOrFunc;
33 appear?: boolean;
34 component?: string | React.ReactNode;
35 componentProps?: {};
36 animatingClassName?: [string, string];
37 forcedReplay?: boolean;
38 onEnd?: (e: { key: string, type: string, target: HTMLElement }) => void;
39}
40
41export default class RcQueueAnim<T> extends React.Component<IProps<T>> { }