import { RefObject, CSSProperties, ReactElement, JSXElementConstructor, Ref } from 'react'; import type { TransitionStatus as TransitionState, TransitionChildren } from 'react-transition-group/Transition'; import { NativeElementTag } from '../utils/jsx-types'; export type { TransitionState }; export type TransitionMode = 'enter' | 'exit'; export type TransitionDuration = 'auto' | number | { [mode in TransitionMode]?: number; }; export type TransitionEasing = string | { [mode in TransitionMode]?: string; }; export type TransitionDelay = number | { [mode in TransitionMode]?: number; }; export type TransitionEnterHandler = (node: HTMLElement, isAppearing: boolean) => void; export type TransitionExitHandler = (node: HTMLElement) => void; export interface TransitionImplementationChildProps { ref?: Ref; style?: CSSProperties; } export interface TransitionProps { /** * A custom callback for adding custom transition end handler */ addEndListener?: (node: HTMLElement, next: VoidFunction) => void; /** * Whether to perform the enter transition if `in` is true while it first mount * @true */ appear?: boolean; /** * A react node or a render props called with transition state */ children?: TransitionChildren; /** * The duration of the transition, in milliseconds */ duration?: TransitionDuration; /** * The flag to trigger toggling transition between `enter` and `exit` state * @default false */ in?: boolean; /** * Whether to keeping mounting the child if exited. * @default false */ keepMount?: boolean; /** * Whether to mount the child at the first time entering. * @default true */ lazyMount?: boolean; /** * A ref of DOM element need to transition */ nodeRef: RefObject; /** * Callback fired before the `entering` state applied */ onEnter?: TransitionEnterHandler; /** * Callback fired after the `entering` state applied */ onEntering?: TransitionEnterHandler; /** * Callback fired after the `entered` state applied */ onEntered?: TransitionEnterHandler; /** * Callback fired before the `exiting` state applied. */ onExit?: TransitionExitHandler; /** * Callback fired after the `exiting` state applied. */ onExiting?: TransitionExitHandler; /** * Callback fired after the `exited` state applied. */ onExited?: TransitionExitHandler; } export interface TransitionImplementationProps extends Omit { children: ReactElement>; /** * The delay of the transition, in milliseconds */ delay?: TransitionDelay; /** * The timing function of the transition */ easing?: TransitionEasing; } /** * The react component for `mezzanine` transition. */ declare function Transition(props: TransitionProps): import("react/jsx-runtime").JSX.Element; export default Transition;