import type { ButtonProps } from '../../../buttons/button/Button.js'; import type { FlattenedSuggestionItem } from '../suggestions/Suggestion.types.js'; /** * Slice result type. * @internal */ type SliceResult = { items: T[]; isSliced: boolean; }; /** * Slice function type. * @internal */ type SliceFn = (items: T[], count: number) => SliceResult; /** @internal */ export declare function useShowMore(props: { items: T[]; primaryCount: number; sliceFn?: SliceFn; }): { items: T[]; isSliced: boolean; isExpanded: boolean; controlProps: ButtonProps<'button'>; }; /** * Slice the flat suggestions in case they exceed the defined limit of suggestions * shown. Group headers don't count toward the suggestion limit, but will only be rendered * if a suggestion is still visible afterwards. * Suggestions will only be sliced if there are at least two more suggestions than * the defined count. * * Example with a count of 5 that explains why we do it that way: * - 5 suggestions: we show all suggestions (they're still below the count that was * specified) * - 6 suggestions: we show all suggestions (adding a show more button would only * redundantly collapse one suggestion) * - 7 suggestions: we show only five suggestions + a show more button to reveal the * additional suggestions * @internal */ export declare function sliceFlattenedSuggestions(suggestions: FlattenedSuggestionItem[], count: number): SliceResult; export {};