declare module 'react-native-dropdown-picker-plus' { import { Dispatch, JSX, PropsWithoutRef, ReactElement, SetStateAction } from 'react'; import { FlatListProps, LayoutChangeEvent, ModalProps, ScrollViewProps, StyleProp, TextInputProps, TextProps, TextStyle, TouchableOpacityProps, ViewProps, ViewStyle, } from 'react-native'; export type ValueType = string | number | boolean; export interface ItemType { containerStyle?: StyleProp; disabled?: boolean; icon?: () => JSX.Element; label?: string; labelStyle?: StyleProp; parent?: T; selectable?: boolean; testID?: string; value?: T; } export type ModeType = 'DEFAULT' | 'SIMPLE' | 'BADGE'; export interface ModeInterface { BADGE: string; DEFAULT: string; SIMPLE: string; } export type ListModeType = 'DEFAULT' | 'FLATLIST' | 'SCROLLVIEW' | 'MODAL'; export interface ListModeInterface { DEFAULT: string; FLATLIST: string; MODAL: string; SCROLLVIEW: string; } export interface SchemaInterface { containerStyle: string; disabled: string; icon: string; label: string; labelStyle: string; parent: string; selectable: string; testID: string; value: string; } export type LanguageType = | 'DEFAULT' | 'FALLBACK' | 'AR' | 'EN' | 'ES' | 'FA' | 'FR' | 'ID' | 'IT' | 'KO' | 'PT' | 'RU' | 'TR'; export interface TranslationInterface { NOTHING_TO_SHOW: string; PLACEHOLDER: string; SEARCH_PLACEHOLDER: string; SELECTED_ITEMS_COUNT_TEXT: string | { [key in number | 'n']: string }; } export type ThemeNameType = 'DEFAULT' | 'LIGHT' | 'DARK'; export type ThemeType = object; // TODO: specify ThemeType further: currently any object export interface RenderBadgeItemPropsInterface { badgeDotStyle: StyleProp; badgeStyle: StyleProp; badgeTextStyle: StyleProp; getBadgeColor: (value: string) => string; getBadgeDotColor: (value: string) => string; IconComponent: () => JSX.Element; label: string; onPress: (value: T) => void; props: TouchableOpacityProps; rtl: boolean; showBadgeDot: boolean; textStyle: StyleProp; THEME: ThemeType; value: T; } export interface RenderListItemPropsInterface { categorySelectable: boolean; containerStyle: StyleProp; custom: boolean; customItemContainerStyle: StyleProp; customItemLabelStyle: StyleProp; disabled: boolean; disabledItemContainerStyle: StyleProp; disabledItemLabelStyle: StyleProp; IconComponent: () => JSX.Element; isSelected: boolean; item: ItemType; label: string; labelStyle: StyleProp; listChildContainerStyle: StyleProp; listChildLabelStyle: StyleProp; listItemContainerStyle: StyleProp; listItemLabelStyle: StyleProp; listParentContainerStyle: StyleProp; listParentLabelStyle: StyleProp; onPress: (value: T) => void; parent: T; props: ViewProps; rtl: boolean; selectable: boolean; selectedItemContainerStyle: StyleProp; selectedItemLabelStyle: StyleProp; setPosition: (value: T, y: number) => void; theme: ThemeNameType; THEME: ThemeType; TickIconComponent: () => JSX.Element; value: T; } export interface ActivityIndicatorComponentPropsInterface { color: string; size: number; } export interface ListEmptyComponentPropsInterface { ActivityIndicatorComponent: (props: ActivityIndicatorComponentPropsInterface) => JSX.Element; listMessageContainer: StyleProp; listMessageTextStyle: StyleProp; loading: boolean; message: string; } export type DropDownDirectionType = 'DEFAULT' | 'TOP' | 'BOTTOM' | 'AUTO'; export interface DropDownPickerBaseProps { items: Array>; setItems?: | Dispatch>>> | ((getItems: () => Array>) => void); open: boolean; setOpen: Dispatch> | ((getIsOpen: () => boolean) => void); activityIndicatorColor?: string; ActivityIndicatorComponent?: (props: ActivityIndicatorComponentPropsInterface) => JSX.Element; activityIndicatorSize?: number; allowFontScaling?: boolean; addCustomItem?: boolean; ArrowDownIconComponent?: (props: { style: StyleProp }) => JSX.Element; arrowIconContainerStyle?: StyleProp; arrowIconStyle?: StyleProp; ArrowUpIconComponent?: (props: { style: StyleProp }) => JSX.Element; autoScroll?: boolean; badgeColors?: Array | string; badgeDotColors?: Array | string; badgeDotStyle?: StyleProp; badgeProps?: TouchableOpacityProps; badgeSeparatorStyle?: StyleProp; badgeStyle?: StyleProp; badgeTextStyle?: StyleProp; bottomOffset?: number; categorySelectable?: boolean; closeAfterSelecting?: boolean; CloseIconComponent?: (props: { style: StyleProp }) => JSX.Element; closeIconContainerStyle?: StyleProp; closeIconStyle?: StyleProp; closeIconTestID?: string; closeOnBackPressed?: boolean; containerProps?: ViewProps; containerStyle?: StyleProp; customItemContainerStyle?: StyleProp; customItemLabelStyle?: StyleProp; disableBorderRadius?: boolean; disabledItemContainerStyle?: StyleProp; disabledItemLabelStyle?: StyleProp; disabled?: boolean; disabledStyle?: StyleProp; disableLocalSearch?: boolean; dropDownContainerStyle?: StyleProp; dropDownDirection?: DropDownDirectionType; dropdownLabelContainerStyle?: StyleProp; dropdownLabelTextStyle?: StyleProp; dropDownLabelY?: number; extendableBadgeContainer?: boolean; flatListProps?: Partial>>; hidden?: boolean; hideListItemsIcons?: boolean; hideSelectedItemIcon?: boolean; iconContainerStyle?: StyleProp; itemKey?: string; itemProps?: TouchableOpacityProps; itemSeparator?: boolean; itemSeparatorStyle?: StyleProp; label?: string; labelProps?: TextProps; labelStyle?: StyleProp; language?: LanguageType; listChildContainerStyle?: StyleProp; listChildLabelStyle?: StyleProp; ListEmptyComponent?: (props: ListEmptyComponentPropsInterface) => JSX.Element; leftComponent?: JSX.Element; leftComponentIndentLabel?: boolean; listItemContainerStyle?: StyleProp; listItemLabelStyle?: StyleProp; listMessageContainerStyle?: StyleProp; listMessageTextStyle?: StyleProp; listMode?: ListModeType; listParentContainerStyle?: StyleProp; listParentLabelStyle?: StyleProp; loading?: boolean; maxHeight?: number; max?: number; min?: number; modalAnimationType?: 'none' | 'slide' | 'fade'; modalContentContainerStyle?: StyleProp; modalProps?: ModalProps; modalTitle?: string; modalTitleStyle?: StyleProp; modalTitleContainerStyle?: StyleProp; mode?: ModeType; multipleText?: string; onChangeSearchText?: (text: string) => void; onClose?: () => void; onDirectionChanged?: (direction: DropDownDirectionType) => void; onLayout?: (e: LayoutChangeEvent) => void; onOpen?: () => void; onPress?: (open: boolean) => void; placeholder?: string; placeholderStyle?: StyleProp; props?: TouchableOpacityProps; renderBadgeItem?: (props: RenderBadgeItemPropsInterface) => JSX.Element; renderListItem?: (props: RenderListItemPropsInterface) => JSX.Element; rtl?: boolean; schema?: Partial; scrollViewProps?: ScrollViewProps; searchable?: boolean; searchContainerStyle?: StyleProp; searchPlaceholder?: string; searchPlaceholderTextColor?: string; searchTextInputProps?: TextInputProps; searchTextInputStyle?: StyleProp; searchWithRegionalAccents?: boolean; selectedItemContainerStyle?: StyleProp; selectedItemLabelStyle?: StyleProp; showArrowIcon?: boolean; showBadgeDot?: boolean; showTickIcon?: boolean; stickyHeader?: boolean; style?: StyleProp; testID?: string; textStyle?: StyleProp; theme?: ThemeNameType; TickIconComponent?: (props: { style: StyleProp }) => JSX.Element; tickIconContainerStyle?: StyleProp; tickIconStyle?: StyleProp; translation?: Partial; zIndexInverse?: number; zIndex?: number; } interface DropDownPickerSingleProps { multiple?: false; onChangeValue?: (value: T | null) => void; onSelectItem?: (item: ItemType) => void; value: T | null; setValue: Dispatch> | ((getItems: () => T | null) => void); } interface DropDownPickerMultipleProps { multiple: true; onChangeValue?: (value: Array | null) => void; onSelectItem?: (items: Array>) => void; value: Array | null; setValue: | Dispatch | null>> | ((getItems: () => Array | null) => void); } interface DropDownPickerInterface { addTheme: (name: string, theme: ThemeNameType) => void; addTranslation: (language: string, translation: TranslationInterface) => void; DROPDOWN_DIRECTION: DropDownDirectionType; LANGUAGE: LanguageType; LIST_MODE: ListModeInterface; MODE: ModeInterface; modifyTranslation: (language: string, translation: TranslationInterface) => void; SCHEMA: SchemaInterface; setDropDownDirection: (direction: DropDownDirectionType) => void; setLanguage: (language: string) => void; setListMode: (mode: string) => void; setMode: (mode: string) => void; setTheme: (name: string) => void; THEMES: ThemeNameType; } export type DropDownPickerProps = ( | DropDownPickerSingleProps | DropDownPickerMultipleProps ) & DropDownPickerBaseProps; const DropDownPicker: (( props: PropsWithoutRef>, ) => ReactElement) & DropDownPickerInterface; export default DropDownPicker; }