forked from hossein-zare/react-native-dropdown-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
96 lines (93 loc) · 2.84 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
declare module "react-native-dropdown-picker" {
import React, { ComponentType } from "react";
import {
StyleProp,
TextProps,
TextStyle,
ViewStyle,
ScrollViewProps,
ViewProps,
TextInputProps,
} from "react-native";
export type ItemType = {
label: any;
value: any;
icon?: () => JSX.Element;
hidden?: boolean;
untouchable?: boolean;
parent?: any;
disabled?: boolean;
selected?: boolean;
viewStyle?: StyleProp<ViewStyle>;
textStyle?: StyleProp<TextStyle>;
};
export type DropDownPickerInstanceType = {
open: () => void;
close: () => void;
toggle: () => void;
reset: () => void;
resetItems: (items: ItemType[], defaultValue: any) => void;
selectItem: (value: any) => void;
addItem: (item: ItemType) => void;
addItems: (items: ItemType[]) => void;
removeItem: (
value: any,
params: {
changeDefaultValue?: boolean;
}
) => void;
isOpen: () => boolean;
};
export type DropDownPickerProps = {
items: ItemType[];
defaultValue?: any;
placeholder?: string;
dropDownMaxHeight?: number;
style?: StyleProp<ViewStyle>;
dropDownStyle?: StyleProp<ViewStyle>;
containerStyle?: StyleProp<ViewStyle>;
itemStyle?: StyleProp<ViewStyle>;
labelStyle?: StyleProp<TextStyle>;
selectedLabelStyle?: StyleProp<TextStyle>;
placeholderStyle?: StyleProp<TextStyle>;
activeItemStyle?: StyleProp<ViewStyle>;
activeLabelStyle?: StyleProp<TextStyle>;
arrowStyle?: StyleProp<ViewStyle>;
arrowColor?: string;
arrowSize?: number;
showArrow?: boolean;
customArrowUp?: (size: number, color: string) => JSX.Element;
customArrowDown?: (size: number, color: string) => JSX.Element;
customTickIcon?: () => JSX.Element;
zIndex?: number;
disabled?: boolean;
isVisible?: boolean;
autoScrollToDefaultValue?: boolean;
multiple?: boolean;
multipleText?: string;
min?: number;
max?: number;
searchable?: boolean;
searchablePlaceholder?: string;
searchablePlaceholderTextColor?: string;
searchableStyle?: StyleProp<TextStyle>;
searchableError?: () => JSX.Element;
onSearch?: (text: string) => void;
selectedLabelLength?: number;
labelLength?: number;
labelProps?: TextProps;
scrollViewProps?: ScrollViewProps;
searchTextInputProps?: TextInputProps;
containerProps?: ViewProps;
globalTextStyle?: StyleProp<TextStyle>;
childrenContainerStyle?: StyleProp<ViewStyle>;
controller?: (instance: DropDownPickerInstanceType) => void;
onOpen?: () => void;
onClose?: () => void;
onChangeItem?: (item: any, index: number) => void;
onChangeList?: (items: any, callback: () => void) => void;
renderSeperator?: () => JSX.Element;
};
const DropDownPicker: ComponentType<DropDownPickerProps>;
export default DropDownPicker;
}