UNPKG

1.23 kBTypeScriptView Raw
1import * as React from 'react';
2import type { CSSMotionProps } from './CSSMotion';
3import type { KeyObject } from './util/diff';
4export interface CSSMotionListProps extends Omit<CSSMotionProps, 'onVisibleChanged'>, Omit<React.HTMLAttributes<any>, 'children'> {
5 keys: (React.Key | {
6 key: React.Key;
7 [name: string]: any;
8 })[];
9 component?: string | React.ComponentType | false;
10 /** This will always trigger after final visible changed. Even if no motion configured. */
11 onVisibleChanged?: (visible: boolean, info: {
12 key: React.Key;
13 }) => void;
14 /** All motion leaves in the screen */
15 onAllRemoved?: () => void;
16}
17export interface CSSMotionListState {
18 keyEntities: KeyObject[];
19}
20/**
21 * Generate a CSSMotionList component with config
22 * @param transitionSupport No need since CSSMotionList no longer depends on transition support
23 * @param CSSMotion CSSMotion component
24 */
25export declare function genCSSMotionList(transitionSupport: boolean, CSSMotion?: React.ForwardRefExoticComponent<CSSMotionProps & {
26 ref?: React.Ref<any>;
27}>): React.ComponentClass<CSSMotionListProps>;
28declare const _default: React.ComponentClass<CSSMotionListProps, any>;
29export default _default;