CSSMotion.d.ts
2.59 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import * as React from 'react';
import { MotionStatus, MotionEventHandler, MotionEndEventHandler, MotionPrepareEventHandler } from './interface';
export declare type CSSMotionConfig = boolean | {
transitionSupport?: boolean;
/** @deprecated, no need this anymore since `rc-motion` only support latest react */
forwardRef?: boolean;
};
export declare type MotionName = string | {
appear?: string;
enter?: string;
leave?: string;
appearActive?: string;
enterActive?: string;
leaveActive?: string;
};
export interface CSSMotionProps {
motionName?: MotionName;
visible?: boolean;
motionAppear?: boolean;
motionEnter?: boolean;
motionLeave?: boolean;
motionLeaveImmediately?: boolean;
motionDeadline?: number;
/**
* Create element in view even the element is invisible.
* Will patch `display: none` style on it.
*/
forceRender?: boolean;
/**
* Remove element when motion end. This will not work when `forceRender` is set.
*/
removeOnLeave?: boolean;
leavedClassName?: string;
/** @private Used by CSSMotionList. Do not use in your production. */
eventProps?: object;
onAppearPrepare?: MotionPrepareEventHandler;
onEnterPrepare?: MotionPrepareEventHandler;
onLeavePrepare?: MotionPrepareEventHandler;
onAppearStart?: MotionEventHandler;
onEnterStart?: MotionEventHandler;
onLeaveStart?: MotionEventHandler;
onAppearActive?: MotionEventHandler;
onEnterActive?: MotionEventHandler;
onLeaveActive?: MotionEventHandler;
onAppearEnd?: MotionEndEventHandler;
onEnterEnd?: MotionEndEventHandler;
onLeaveEnd?: MotionEndEventHandler;
/** This will always trigger after final visible changed. Even if no motion configured. */
onVisibleChanged?: (visible: boolean) => void;
internalRef?: React.Ref<any>;
children?: (props: {
visible?: boolean;
className?: string;
style?: React.CSSProperties;
[key: string]: any;
}, ref: (node: any) => void) => React.ReactElement;
}
export interface CSSMotionState {
status?: MotionStatus;
statusActive?: boolean;
newStatus?: boolean;
statusStyle?: React.CSSProperties;
prevProps?: CSSMotionProps;
}
/**
* `transitionSupport` is used for none transition test case.
* Default we use browser transition event support check.
*/
export declare function genCSSMotion(config: CSSMotionConfig): React.ForwardRefExoticComponent<CSSMotionProps & {
ref?: React.Ref<any>;
}>;
declare const _default: React.ForwardRefExoticComponent<CSSMotionProps & {
ref?: React.Ref<any>;
}>;
export default _default;