import React from 'react'; import { Divider, Heading, Item } from '@splunk/react-ui/Menu'; export type MenuItem = React.ReactElement, typeof Item | typeof Divider | typeof Heading>; type AdditionalTracking = { trackFirstElement?: boolean; trackLastElement?: boolean; }; type ObserveLifecycleFn = (element: HTMLElement | null) => void; /** * Find the index of an array element which is nearest to targetIndex and is a Menu.Item component * @param {Array} elements An array to search * @param {Number} targetIndex The target index. This is the ideal value to return. * @returns The index in the array of the nearest `Menu.Item` component to `targetIndex`, or -1 if no element is a `Menu.Item` component */ export declare const findClosestMenuItem: (elements: React.ReactNode[], targetIndex: number) => number; /** * @private Keep the injection of `VirtualizedItem` DRY. Will always replace the middle-most non-divider/heading * with a VirtualizedItem instance. * - If `trackFirstElement` the **FIRST** non-divider/heading item will also be replaced. * - If `trackLastElement` the **LAST** non-divider/heading item will also be replaced. */ export declare const injectVirtualizedItem: (elements: React.ReactNode[] | undefined, onMount: ObserveLifecycleFn, onUnmount: ObserveLifecycleFn, { trackFirstElement, trackLastElement }?: AdditionalTracking) => React.ReactNode[]; export {};