import React, { MouseEvent, ReactNode, SelectHTMLAttributes } from 'react'; import { NativeSelectProps } from '../NativeSelect/NativeSelect'; import { CustomSelectOptionProps } from '../CustomSelectOption/CustomSelectOption'; declare type SelectValue = SelectHTMLAttributes['value']; export interface CustomSelectOptionInterface { value: SelectValue; label: string; [index: string]: any; } interface CustomSelectState { value: SelectValue; opened?: boolean; focused?: boolean; focusedOptionIndex: number; selectedOptionIndex: number; } export interface CustomSelectProps extends NativeSelectProps { options: Array<{ value: SelectValue; label: string; [index: string]: any; }>; popupDirection?: 'top' | 'bottom'; /** * В качестве аргумента принимает валидные для [CustomSelectOption](#/CustomSelectOption) свойства */ renderOption?: (props: CustomSelectOptionProps) => ReactNode; } declare type MouseEventHandler = (event: MouseEvent) => void; declare class CustomSelect extends React.Component { static defaultProps: CustomSelectProps; constructor(props: CustomSelectProps); state: CustomSelectState; private keyboardInput; private node; private selectEl; private readonly scrollBoxRef; private readonly resetKeyboardInput; private readonly getSelectedItem; open: () => void; close: () => void; private isValidIndex; selectFocused: () => void; select: (index: number) => void; onClick: () => void; onFocus: () => void; onBlur: () => void; handleDocumentClick: (event: Event) => void; private scrollToElement; focusOptionByIndex: (index: number) => void; focusOption: (type: "next" | "prev") => void; handleOptionHover: MouseEventHandler; handleOptionDown: MouseEventHandler; resetFocusedOption: () => void; onKeyboardInput: (key: string) => void; handleKeyDownSelect: (event: React.KeyboardEvent) => void; handleKeyUp: (...a: any[]) => void; componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate(prevProps: CustomSelectProps): void; renderOption: (option: CustomSelectOptionInterface, index: number) => JSX.Element; rootRef: (element: HTMLLabelElement) => void; selectRef: (element: HTMLSelectElement) => void; render(): JSX.Element; } declare const _default: typeof CustomSelect; export default _default;