import { AutoSuggestClassNameContract } from "@microsoft/fast-components-class-name-contracts-base"; import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react"; import React from "react"; import { ListboxItemProps } from "../index"; import { AutoSuggestContext, AutoSuggestContextType } from "./auto-suggest-context"; import { AutoSuggestHandledProps, AutoSuggestProps, AutoSuggestUnhandledProps } from "./auto-suggest.props"; export interface AutoSuggestState { value: string; isMenuOpen: boolean; focusedItem: ListboxItemProps; } declare class AutoSuggest extends Foundation { static displayName: string; static defaultProps: Partial; private static valuePropertyKey; /** * Handled props instantiation */ protected handledProps: HandledProps; private rootElement; private shouldFocusMenuOnNextRender; private storedValueString; /** * constructor */ constructor(props: AutoSuggestProps); componentDidUpdate(prevProps: AutoSuggestProps): void; componentDidMount(): void; componentWillUnmount(): void; /** * Renders the component */ render(): React.ReactElement; /** * Create class names */ protected generateClassNames(): string; /** * Determine which function to use to render content display (ie. the part of the control that shows when the menu isn't open) * and invokes it */ private renderInputRegion; /** * Determine which function to use to render the menu and invokes it */ private renderMenu; private renderChildren; /** * Determine if a single node is a match */ private isMatch; /** * The default function that renders an unstyled content display */ private defaultInputRegionRenderFunction; /** * Handle blur events */ private handleBlurCapture; /** * Updates selection state and associated values */ private updateFocusedItem; /** * Handles clicks */ private handleInputRegionClick; /** * Handles item invoked */ private handleItemInvoked; /** * Invokes the auto-select component */ private invoke; /** * Handles value changes from input element */ private handleChange; /** * Update the currentValue of the component */ private updateValue; /** * Handles input region key events */ private handleInputRegionKeydown; /** * Handles menu key events */ private handleMenuKeydown; /** * test if a key press is a valid input */ private isValidInput; /** * Passes focus to the input element if focus would bump up against the ends of the menu, * return true if result was focusing on input region */ private checkForMenuEnd; /** * Opens menu and focuses on first or last valid item */ private focusOnMenu; /** * Gets first child in a range */ private focusFirstItemInRange; /** * Toggles the menu */ private toggleMenu; /** * Focus on the input element */ private focusOnInput; /** * Determine menu state by comparing desired state to props */ private validateMenuState; /** * Close the menu when when there are clicks outside */ private handleWindowClick; } export default AutoSuggest; export * from "./auto-suggest.props"; export { AutoSuggestClassNameContract, AutoSuggestContext, AutoSuggestContextType };