///
import type { KeyObject } from './util/diff';
export declare const MOTION_PROP_NAMES: string[];
export declare const STATUS_NONE: "none";
export declare const STATUS_APPEAR: "appear";
export declare const STATUS_ENTER: "enter";
export declare const STATUS_LEAVE: "leave";
export declare type MotionStatus = typeof STATUS_NONE | typeof STATUS_APPEAR | typeof STATUS_ENTER | typeof STATUS_LEAVE;
export declare const STEP_NONE: "none";
export declare const STEP_PREPARE: "prepare";
export declare const STEP_START: "start";
export declare const STEP_ACTIVE: "active";
export declare const STEP_ACTIVATED: "end";
export declare type StepStatus = typeof STEP_NONE | typeof STEP_PREPARE | typeof STEP_START | typeof STEP_ACTIVE | typeof STEP_ACTIVATED;
export declare type MotionEvent = (TransitionEvent | AnimationEvent) & {
deadline?: boolean;
};
export declare type MotionPrepareEventHandler = (element: HTMLElement) => Promise | void;
export declare type MotionEventHandler = (element: HTMLElement, event: MotionEvent) => React.CSSProperties | void;
export declare type MotionEndEventHandler = (element: HTMLElement, event: MotionEvent) => boolean | void;
export declare type MotionName = string | {
appear?: string;
enter?: string;
leave?: string;
appearActive?: string;
enterActive?: string;
leaveActive?: string;
};
export interface CSSMotionListProps extends Omit, Omit, 'children'> {
keys: (React.Key | {
key: React.Key;
[name: string]: any;
})[];
component?: string | React.ComponentType | false;
/** This will always trigger after final visible changed. Even if no motion configured. */
onVisibleChanged?: (visible: boolean, info: {
key: React.Key;
}) => void;
/** All motion leaves in the screen */
onAllRemoved?: () => void;
}
export interface CSSMotionListState {
keyEntities: KeyObject[];
}
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. */
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;
children?: (props: {
visible?: boolean;
classNames?: 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;
}