@gpa-gemstone/helper-functions
Version:
Helper Functions for gpa-gemstone packages
30 lines (29 loc) • 1.26 kB
TypeScript
import * as React from 'react';
/**
*
* @param {React.MutableRefObject<HTMLDivElement | null>} containerRef - A mutable reference object to the container element.
* @returns {{ top: number, left: number, height: number, width: number, x: number, y: number, bottom: number, right: number }} -
* - `top`: Distance from the top of the viewport to the top of the container.
* - `left`: Distance from the left of the viewport to the left of the container.
* - `height`: Height of the container.
* - `width`: Width of the container.
* - `scrollWidth`: Scroll Width of the container.
* - `x`: Horizontal position of the container relative to the viewport.
* - `y`: Vertical position of the container relative to the viewport.
* - `bottom`: Distance from the top of the viewport to the bottom of the container.
* - `right`: Distance from the left of the viewport to the right of the container.
*/
export declare const useGetContainerPosition: (containerRef: React.MutableRefObject<HTMLDivElement | null>) => {
top: number;
left: number;
height: number;
width: number;
x: number;
y: number;
bottom: number;
right: number;
scrollWidth: number;
clientWidth: number;
scrollHeight: number;
clientHeight: number;
};