import * as React from 'react'; import type { ISuggestionModel } from '@fluentui/react/lib/Pickers'; import type { ISuggestionsHeaderFooterItemProps, ISuggestionsControlProps } from './Suggestions.types'; import type { JSXElement } from '@fluentui/utilities'; export declare enum SuggestionItemType { header = 0, suggestion = 1, footer = 2 } export interface ISuggestionsControlState { selectedHeaderIndex: number; selectedFooterIndex: number; suggestions: ISuggestionModel[]; } export declare class SuggestionsHeaderFooterItem extends React.Component { constructor(props: ISuggestionsHeaderFooterItemProps); render(): JSXElement; } /** * Class when used with SuggestionsStore, renders a suggestions control with customizable headers and footers */ export declare class SuggestionsControl extends React.Component, ISuggestionsControlState> { private _selectedElement; private _suggestions; constructor(suggestionsProps: ISuggestionsControlProps); componentDidMount(): void; componentDidUpdate(prevProps: ISuggestionsControlProps, prevState: ISuggestionsControlState): void; UNSAFE_componentWillReceiveProps(newProps: ISuggestionsControlProps): void; componentWillUnmount(): void; render(): JSXElement; get currentSuggestion(): ISuggestionModel | undefined; get currentSuggestionIndex(): number; get selectedElement(): HTMLDivElement | undefined; hasSuggestionSelected(): boolean; hasSelection(): boolean; executeSelectedAction(): void; removeSuggestion(index?: number): void; /** * Handles the key down, returns true, if the event was handled, false otherwise * @param keyCode - The keyCode to handle */ handleKeyDown(keyCode: number): boolean; scrollSelected(): void; private _renderHeaderItems; private _renderFooterItems; private _renderSuggestions; /** * Selects the next selectable item */ private _selectNextItem; /** * Selects the previous selectable item */ private _selectPreviousItem; /** * Resets the selected state and selects the first selectable item */ private _resetSelectedItem; /** * Selects the first item */ private _selectFirstItem; /** * Selects the last item */ private _selectLastItem; /** * Selects the next item in the suggestion item type group, given the current index * If none is able to be selected, returns false, otherwise returns true * @param itemType - The suggestion item type * @param currentIndex - The current index, default is -1 */ private _selectNextItemOfItemType; /** * Selects the previous item in the suggestion item type group, given the current index * If none is able to be selected, returns false, otherwise returns true * @param itemType - The suggestion item type * @param currentIndex - The current index. If none is provided, the default is the items length of specified type */ private _selectPreviousItemOfItemType; private _getCurrentIndexForType; private _getNextItemSectionType; private _getPreviousItemSectionType; }