import React, { type ReactElement } from 'react'; import './Rotate.types'; type EnterHandler = (node: HTMLElement, isAppearing: boolean) => void; type ExitHandler = () => void; type TransitionMode = 'enter' | 'exit'; /** * Keeping the same API as all other Mui transition components. * Because Mui does not expose a dedicated type for this, we need to create our own. */ interface AnimationProps { /** Add a custom transition end trigger. Called with the transitioning DOM node and a done callback. Allows for more fine grained transition end logic. Note: Timeouts are still used as a fallback if provided. */ addEndListener?: (node: HTMLElement, next: () => void) => void; /** Perform the enter transition when it first mounts if `in` is also `true`. Set this to `false` to disable this behavior. */ appear?: boolean; /** A single child content element that can hold a `ref`. */ children: ReactElement; /** The transition timing function. You may specify a single easing or a object containing enter and exit values. */ easing?: string | { [key in TransitionMode]?: string; }; /** If `true`, the component will transition in. */ in?: boolean; /** Callback fired before the "entering" status is applied. An extra parameter `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount. */ onEnter?: EnterHandler; /** Callback fired after the "entering" status is applied. An extra parameter `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount. */ onEntering?: EnterHandler; /** Callback fired after the "entered" status is applied. An extra parameter `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount. */ onEntered?: EnterHandler; /** Callback fired before the "exiting" status is applied. */ onExit?: ExitHandler; /** Callback fired after the "exiting" status is applied. */ onExiting?: ExitHandler; /** Callback fired after the "exited" status is applied. */ onExited?: ExitHandler; /** * The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object. * Set to 'auto' to automatically calculate transition time based on height. */ timeout?: number | { [key in TransitionMode]?: number; }; /** The component that will be used for the animation. */ TransitionComponent?: React.FC; style?: React.CSSProperties; } export interface RotateProps extends AnimationProps { /** The degrees value, can be either position or negative number. */ from?: number; /** The degrees value, can be either position or negative number. */ to?: number; } declare const slots: { root: { slot: "root"; name: "MuiRotate"; }; }; export type RotateSlots = keyof typeof slots; declare const Rotate: React.FC; export default Rotate;