UNPKG

@guardian/threads

Version:
41 lines (40 loc) 1.4 kB
import React from 'react'; import { ChipProps } from './abstract/Chip'; import { InputChip } from './abstract/InputChip'; import { SelectOption } from './SelectChip'; interface SelectAsyncChipProps extends ChipProps { onInputChange: (inputStr: string) => Promise<SelectOption[]>; } interface SelectAsyncChipState { isMounted: boolean; isFetching: boolean; isOptionsMenuOpen: boolean; isEditing: boolean; currentIndex: number; searchInputValue: string; options: SelectOption[]; } export declare const getSelectAsyncChipWrapperTestId: (index: number) => string; export declare const getSelectAsyncChipTestId: (index: number) => string; export declare const getEditButtonTestId: (index: number) => string; export declare class SelectAsyncChip extends InputChip<SelectAsyncChipProps, SelectAsyncChipState> { state: SelectAsyncChipState; private selectRef; focus: () => void; select: () => void; componentDidMount(): void; componentWillUnmount(): void; onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void; render(): JSX.Element; private getInputValue; private onBlur; private enterEditMode; private exitEditMode; private onChange; private onSelect; private getPopoverCoords; private shouldDisplayOptionsMenu; private shouldDisplayLoadingState; private onKeyDownForEditMode; } export {};