Collection.d.ts 718 B

12345678910111213141516171819
  1. import * as React from 'react';
  2. import type { SizeInfo } from '.';
  3. type onCollectionResize = (size: SizeInfo, element: HTMLElement, data: any) => void;
  4. export declare const CollectionContext: React.Context<onCollectionResize>;
  5. export interface ResizeInfo {
  6. size: SizeInfo;
  7. data: any;
  8. element: HTMLElement;
  9. }
  10. export interface CollectionProps {
  11. /** Trigger when some children ResizeObserver changed. Collect by frame render level */
  12. onBatchResize?: (resizeInfo: ResizeInfo[]) => void;
  13. children?: React.ReactNode;
  14. }
  15. /**
  16. * Collect all the resize event from children ResizeObserver
  17. */
  18. export declare function Collection({ children, onBatchResize }: CollectionProps): React.JSX.Element;
  19. export {};