import type { RefObject } from 'react'; import type { TextInput } from 'react-native'; import type { OptionsType, OptionType } from '../types'; export type Action = | 'open' | 'close' | 'selectOption' | 'setSearchInputRef' | 'setSearchValue' | 'searchOptions' | 'setOptionsListPosition' | 'reinitializeOptions'; export type ActionType = | { type: Extract; } | { type: Extract; } | { type: Extract; payload: { selectedOption: OptionType | OptionType[] | null; selectedOptionIndex: number | number[]; }; } | { type: Extract; payload: Position; } | { type: Extract; payload: string; searchPattern: (payload: string) => string; } | { type: Extract; payload: string; } | { type: Extract; payload: RefObject | null; } | { type: Extract; payload: OptionsType; }; export type Position = { width: number; top: number; left: number; aboveSelectControl: boolean; }; export type State = { isOpened: boolean; selectedOption: OptionType | OptionType[] | null; selectedOptionIndex: number | number[]; optionsData: OptionsType; openedPosition: Position; searchValue: string | null; searchedOptions: OptionsType; searchInputRef: RefObject | null; animationDuration: number; }; export type CreateInitialStateType = { options: OptionsType; searchable: boolean; animation: boolean | number; defaultOption: OptionType | OptionType[] | undefined; };