/* eslint-disable @typescript-eslint/consistent-type-definitions */ import type { FlatListProps, ImageProps, PressableProps, SectionListProps, TextInputProps, TextProps, TouchableWithoutFeedbackProps, ViewProps, } from 'react-native'; import type { State } from '../state'; import type { Themes } from '../themes'; import type { SelectStyles } from './styles'; export type OptionTypeRequired = { label: string; value: string; }; export type SectionType = { title: string | undefined; index: number; }; export type CustomData = T extends SectionOptionType ? Pick : T; export type OptionType = OptionTypeRequired & CustomData & { section?: SectionType }; export type SectionOptionType = { title: string; data: OptionType[]; }; export type OptionsType = SectionOptionType[] | OptionType[]; /** * `` component ref */ export interface SelectRef { /** * Open a dropdown */ open: () => void; /** * Close a dropdown */ close: () => void; /** * Clear a selected option(s) */ clear: () => { removedSelectedOption?: OptionType | null; removedSelectedOptionIndex?: number; removedSelectedOptions?: OptionType[] | null; removedSelectedOptionsIndexes?: number[]; }; /** * Get current state of select */ getState: () => State; }