import React, { Ref, RefObject } from 'react'; import { PropsType as UseDropdownPropsType } from '../useDropdown'; import { type SelectValueType } from '../types'; export type SelectEvent> = (event: T, data: { name?: string; value?: string; index?: number; }) => void; export interface SelectServiceType { focus: () => void; blur: () => void; } export type PropsType = UseDropdownPropsType & { /** Имя компонента */ name?: string; /** Разворачивать список при получениее фокуса */ openWhenFocus?: boolean; /** Если установлено, то onSelect будет вызываться с первым элементом из списка по нажатию на Enter, * если ничего не выбрано (по умолчанию false) * */ selectFirstOnEnter?: boolean; /** Обработчик события при потере фокуса компонентом */ onBlur?: React.FocusEventHandler; /** Обработчик события при получении фокуса компонентом */ onFocus?: React.FocusEventHandler; /** Обработчик события при нажатии кнопки клавиатуры, когда компонент в фокусе */ onKeyDown?: SelectEvent; /** Ref, принимающий функции для программного focus/blur */ controlsRef?: React.MutableRefObject; disableSearch?: boolean; }; export declare function useMultiselect(props: PropsType, { forwardedRef, handleSelect, handleMultiselect, ignoreFocus, }: { forwardedRef: Ref; handleSelect?: (value: T, event: React.MouseEvent | React.KeyboardEvent) => void; handleMultiselect?: (value: T, event: React.MouseEvent | React.KeyboardEvent) => void; ignoreFocus?: RefObject; }): { active: boolean; setActive: React.Dispatch>; popperElement: React.MutableRefObject | undefined; setPopperElement: React.Dispatch | undefined>>; showList: boolean; showDropdown: () => void; hideDropdown: () => void; currentIndex: number; setCurrentIndex: React.Dispatch>; localOptions: (React.ReactNode | T)[]; setLocalOptions: React.Dispatch>; align: "top" | "bottom" | "vertical" | undefined; refSelect: React.RefObject; setBlurOnFiled: (event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | MouseEvent, isHideDropdown?: boolean) => void; handleClick: (event: React.MouseEvent) => void; handleFocus: (event: React.FocusEvent) => void; handleBlur: (e: React.FocusEvent) => void; handleKeyDown: (event: React.KeyboardEvent) => void; handleOptionMouseOver: (option: React.ReactNode) => void; handleScroll: (event: React.UIEvent) => void; callProgramBlur: () => void; };