import type { CallbackFn } from '../types'; import { MenuPositionEnum } from '../constants'; import { type RefObject } from 'react'; type MenuPosition = Readonly<{ menuStyleTop?: string; menuHeightCalc: number; }>; /** * Handle calculating and maintaining the menuHeight used by react-window. * Handle scroll animation and callback execution when menuOpen = true. * Handle resetting menuHeight back to the menuHeightDefault and callback execution when menuOpen = false. * Use ref to track if the menuHeight was resized, and if so, set the menu height back to default (avoids uncessary renders) with call to setMenuHeight. * Handle determining where to place the menu in relation to control - when menuPosition = 'top' or menuPosition = 'bottom' and there is not sufficient space below control, place on top. */ declare const useMenuPosition: (menuRef: RefObject, controlRef: RefObject, menuOpen: boolean, menuPosition: MenuPositionEnum, menuItemSize: number, menuHeightDefault: number, menuOptionsLength: number, isMenuPortaled: boolean, onMenuOpen?: CallbackFn, onMenuClose?: CallbackFn, menuScrollDuration?: number, scrollMenuIntoView?: boolean) => MenuPosition; export default useMenuPosition;