NodeList.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Handle virtual list of the TreeNodes.
  3. */
  4. import * as React from 'react';
  5. import type { BasicDataNode, DataEntity, DataNode, FlattenNode, Key, KeyEntities, ScrollTo } from './interface';
  6. export declare const MOTION_KEY: string;
  7. export declare const MotionEntity: DataEntity;
  8. export interface NodeListRef {
  9. scrollTo: ScrollTo;
  10. getIndentWidth: () => number;
  11. }
  12. interface NodeListProps<TreeDataType extends BasicDataNode> {
  13. prefixCls: string;
  14. style: React.CSSProperties;
  15. data: FlattenNode<TreeDataType>[];
  16. motion: any;
  17. focusable?: boolean;
  18. activeItem: FlattenNode<TreeDataType>;
  19. focused?: boolean;
  20. tabIndex: number;
  21. checkable?: boolean;
  22. selectable?: boolean;
  23. disabled?: boolean;
  24. expandedKeys: Key[];
  25. selectedKeys: Key[];
  26. checkedKeys: Key[];
  27. loadedKeys: Key[];
  28. loadingKeys: Key[];
  29. halfCheckedKeys: Key[];
  30. keyEntities: KeyEntities;
  31. dragging: boolean;
  32. dragOverNodeKey: Key;
  33. dropPosition: number;
  34. height: number;
  35. itemHeight: number;
  36. virtual?: boolean;
  37. scrollWidth?: number;
  38. onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
  39. onFocus?: React.FocusEventHandler<HTMLDivElement>;
  40. onBlur?: React.FocusEventHandler<HTMLDivElement>;
  41. onActiveChange: (key: Key) => void;
  42. onListChangeStart: () => void;
  43. onListChangeEnd: () => void;
  44. }
  45. /**
  46. * We only need get visible content items to play the animation.
  47. */
  48. export declare function getMinimumRangeTransitionRange(list: FlattenNode[], virtual: boolean, height: number, itemHeight: number): FlattenNode<DataNode>[];
  49. declare const NodeList: React.ForwardRefExoticComponent<NodeListProps<any> & React.RefAttributes<NodeListRef>>;
  50. export default NodeList;