1
1
declare module 'react-native-dropdown-picker' {
2
- import { Dispatch , JSX , PropsWithoutRef , ReactElement } from 'react' ;
2
+ import {
3
+ Dispatch ,
4
+ JSX ,
5
+ PropsWithoutRef ,
6
+ ReactElement ,
7
+ SetStateAction ,
8
+ } from 'react' ;
3
9
import {
4
10
FlatListProps ,
5
11
LayoutChangeEvent ,
@@ -14,9 +20,6 @@ declare module 'react-native-dropdown-picker' {
14
20
ViewStyle ,
15
21
} from 'react-native' ;
16
22
17
- type SetStateCallback < S > = ( prevState : S ) => S ;
18
- type SetStateValue < S > = ( prevState : S ) => S ;
19
-
20
23
export type ValueType = string | number | boolean ;
21
24
22
25
export type ItemType < T extends ValueType > = {
@@ -70,10 +73,10 @@ declare module 'react-native-dropdown-picker' {
70
73
| 'FR'
71
74
| 'ID'
72
75
| 'IT'
76
+ | 'KO'
73
77
| 'PT'
74
78
| 'RU'
75
- | 'TR'
76
- | 'KO' ;
79
+ | 'TR' ;
77
80
78
81
export interface TranslationInterface {
79
82
NOTHING_TO_SHOW : string ;
@@ -155,9 +158,9 @@ declare module 'react-native-dropdown-picker' {
155
158
156
159
export interface DropDownPickerBaseProps < T extends ValueType > {
157
160
items : Array < ItemType < T > > ;
158
- setItems ?: Dispatch < SetStateCallback < Array < ItemType < T > > > > ;
161
+ setItems ?: Dispatch < SetStateAction < Array < ItemType < T > > > > ;
159
162
open : boolean ;
160
- setOpen : Dispatch < SetStateValue < boolean > > ;
163
+ setOpen : Dispatch < SetStateAction < boolean > > ;
161
164
activityIndicatorColor ?: string ;
162
165
ActivityIndicatorComponent ?: (
163
166
props : ActivityIndicatorComponentPropsInterface ,
@@ -278,15 +281,15 @@ declare module 'react-native-dropdown-picker' {
278
281
multiple ?: false ;
279
282
onChangeValue ?: ( value : T | null ) => void ;
280
283
onSelectItem ?: ( item : ItemType < T > ) => void ;
281
- setValue : Dispatch < SetStateCallback < T | null > > ;
284
+ setValue : Dispatch < SetStateAction < T | null > > ;
282
285
value : T | null ;
283
286
}
284
287
285
288
interface DropDownPickerMultipleProps < T extends ValueType > {
286
289
multiple : true ;
287
290
onChangeValue ?: ( value : Array < T > | null ) => void ;
288
291
onSelectItem ?: ( items : Array < ItemType < T > > ) => void ;
289
- setValue : Dispatch < SetStateCallback < Array < T > | null > > ;
292
+ setValue : Dispatch < SetStateAction < Array < T > | null > > ;
290
293
value : Array < T > | null ;
291
294
}
292
295
0 commit comments