UNPKG

1.65 kBTypeScriptView Raw
1// Type definitions for rc-banner-anim 2.0
2// Project: https://github.com/react-component/banner-anim
3// Definitions by: jljsj33 <https://github.com/jljsj33>
4// Definitions: https://github.com/react-component/banner-anim
5import * as React from 'react';
6
7import { IEaseType } from 'rc-tween-one/typings/AnimObject';
8
9import Arrow from './Arrow';
10import Thumb from './Thumb';
11import Element from './Element';
12
13export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
14
15type ITypeString = 'across' | 'vertical' | 'acrossOverlay' | 'verticalOverlay' | 'gridBar' | 'grid';
16
17export declare type IType = ITypeString | ITypeString[];
18
19export interface IProps<T> extends Omit<React.HTMLAttributes<T>, 'onChange'> {
20 prefixCls?: string;
21 arrow?: boolean;
22 thumb?: boolean;
23 initShow?: number;
24 type?: IType;
25 duration?: number;
26 delay?: number;
27 ease?: IEaseType;
28 autoPlay?: boolean;
29 autoPlaySpeed?: number;
30 sync?: boolean;
31 dragPlay?: boolean;
32 onChange?: (type: string, current: number) => void;
33 component?: string | React.ReactNode;
34}
35
36export declare function setAnimCompToTagComp(item: React.ReactElement<any>, i?: number): void;
37export declare function switchChildren(hideProps: boolean, item: React.ReactElement<any>): void;
38export declare const animType: {};
39
40export default class RcBannerAnim<T> extends React.Component<IProps<T>> {
41 static Arrow: typeof Arrow;
42 static Thumb: typeof Thumb;
43 static Element: typeof Element;
44 static setAnimCompToTagComp: typeof setAnimCompToTagComp;
45 static animType: typeof animType;
46 static switchChildren: typeof switchChildren;
47}
48
49export {
50 Arrow,
51 Thumb,
52 Element,
53};
54