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