1 | import * as React from 'react';
|
2 | import { Transition } from 'react-transition-group';
|
3 |
|
4 | export type fn = () => void;
|
5 | export interface BaseTransition {
|
6 |
|
7 | in?: boolean | undefined;
|
8 |
|
9 | onExited?: fn | undefined;
|
10 | }
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export type FadeProps = BaseTransition & {
|
17 | component: React.ComponentType<any>;
|
18 | duration: number;
|
19 | };
|
20 | export const Fade: React.ComponentType<FadeProps>;
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export const collapseDuration: number;
|
27 |
|
28 | export type TransitionState = 'exiting' | 'exited';
|
29 | export type Width = number | 'auto';
|
30 | export interface CollapseProps {
|
31 | children: any;
|
32 | in: boolean;
|
33 | }
|
34 | export interface CollapseState {
|
35 | width: Width;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 | export class Collapse extends React.Component<CollapseProps, CollapseState> {
|
41 | duration: number;
|
42 | transition: {
|
43 | exiting: any;
|
44 | exited: any;
|
45 | };
|
46 |
|
47 |
|
48 | getWidth: (ref: React.Ref<any>) => void;
|
49 |
|
50 |
|
51 | getStyle: (width: Width) => any;
|
52 |
|
53 |
|
54 | getTransition: (state: TransitionState) => any;
|
55 | }
|