diff --git a/index.d.ts b/index.d.ts index bea5ffa..edcb3ce 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,11 @@ declare module 'react-native-dropdown-picker' { - import { Dispatch, JSX, PropsWithoutRef, ReactElement } from 'react'; + import { + Dispatch, + JSX, + PropsWithoutRef, + ReactElement, + SetStateAction, + } from 'react'; import { FlatListProps, LayoutChangeEvent, @@ -14,9 +20,6 @@ declare module 'react-native-dropdown-picker' { ViewStyle, } from 'react-native'; - type SetStateCallback = (prevState: S) => S; - type SetStateValue = (prevState: S) => S; - export type ValueType = string | number | boolean; export type ItemType = { @@ -155,9 +158,9 @@ declare module 'react-native-dropdown-picker' { export interface DropDownPickerBaseProps { items: Array>; - setItems?: Dispatch>>>; + setItems?: Dispatch>>>; open: boolean; - setOpen: Dispatch>; + setOpen: Dispatch>; activityIndicatorColor?: string; ActivityIndicatorComponent?: ( props: ActivityIndicatorComponentPropsInterface, @@ -278,7 +281,7 @@ declare module 'react-native-dropdown-picker' { multiple?: false; onChangeValue?: (value: T | null) => void; onSelectItem?: (item: ItemType) => void; - setValue: Dispatch>; + setValue: Dispatch>; value: T | null; } @@ -286,7 +289,7 @@ declare module 'react-native-dropdown-picker' { multiple: true; onChangeValue?: (value: Array | null) => void; onSelectItem?: (items: Array>) => void; - setValue: Dispatch | null>>; + setValue: Dispatch | null>>; value: Array | null; }