CSSMotionList.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. import * as React from 'react';
  2. import type { CSSMotionProps } from './CSSMotion';
  3. import type { KeyObject } from './util/diff';
  4. export interface CSSMotionListProps extends Omit<CSSMotionProps, 'onVisibleChanged' | 'children'>, 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. children?: (props: {
  17. visible?: boolean;
  18. className?: string;
  19. style?: React.CSSProperties;
  20. index?: number;
  21. [key: string]: any;
  22. }, ref: (node: any) => void) => React.ReactElement;
  23. }
  24. export interface CSSMotionListState {
  25. keyEntities: KeyObject[];
  26. }
  27. /**
  28. * Generate a CSSMotionList component with config
  29. * @param transitionSupport No need since CSSMotionList no longer depends on transition support
  30. * @param CSSMotion CSSMotion component
  31. */
  32. export declare function genCSSMotionList(transitionSupport: boolean, CSSMotion?: React.ForwardRefExoticComponent<CSSMotionProps & React.RefAttributes<any>>): React.ComponentClass<CSSMotionListProps>;
  33. declare const _default: React.ComponentClass<CSSMotionListProps, any>;
  34. export default _default;