TreeSelectContext.d.ts 1.0 KB

12345678910111213141516171819202122232425
  1. import * as React from 'react';
  2. import type { ExpandAction } from 'rc-tree/lib/Tree';
  3. import type { DataNode, FieldNames, Key } from './interface';
  4. import type useDataEntities from './hooks/useDataEntities';
  5. export interface TreeSelectContextProps {
  6. virtual?: boolean;
  7. dropdownMatchSelectWidth?: boolean | number;
  8. listHeight: number;
  9. listItemHeight: number;
  10. listItemScrollOffset?: number;
  11. treeData: DataNode[];
  12. fieldNames: FieldNames;
  13. onSelect: (value: Key, info: {
  14. selected: boolean;
  15. }) => void;
  16. treeExpandAction?: ExpandAction;
  17. treeTitleRender?: (node: any) => React.ReactNode;
  18. onPopupScroll?: React.UIEventHandler<HTMLDivElement>;
  19. leftMaxCount: number | null;
  20. /** When `true`, only take leaf node as count, or take all as count with `maxCount` limitation */
  21. leafCountOnly: boolean;
  22. valueEntities: ReturnType<typeof useDataEntities>['valueEntities'];
  23. }
  24. declare const TreeSelectContext: React.Context<TreeSelectContextProps>;
  25. export default TreeSelectContext;