import * as React from 'react';
export interface Viewport {
left: number;
top: number;
width: number;
height: number;
}
/**
* useViewport is a React hook that exposes a viewport (top/left/width/height)
* representing the currently visible region of a scrolling contaienr
.
* It uses a ResizeObserver and an onScroll handler to monitor the viewport of the
* container. To use, spread the returned `containerProps` onto the container div.
*/
export declare const useViewport: (options?: {
initialOffset?: (el: HTMLElement) => {
left: number;
top: number;
};
}) => {
viewport: Viewport;
containerProps: {
ref: (el: HTMLDivElement) => void;
onScroll: (e: React.UIEvent) => void;
};
onMoveToViewport: (targetOffset: {
left: number;
top: number;
}, animated: boolean) => void;
};