forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
66 lines (47 loc) · 1.59 KB
/
types.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
import type {ListItem} from '@components/SelectionList/types';
import type {MaybePhraseKey} from '@libs/Localize';
type ValuePickerListItem = ListItem & {
value?: string;
};
type ValuePickerItem = {
label?: string;
value?: string;
description?: string;
};
type ValueSelectorModalProps = {
/** Whether the modal is visible */
isVisible: boolean;
/** Items to pick from */
items?: ValuePickerItem[];
/** The selected item */
selectedItem?: ValuePickerItem;
/** Label for values */
label?: string;
/** Function to call when the user selects a item */
onItemSelected?: (item: ValuePickerListItem) => void;
/** Function to call when the user closes the modal */
onClose?: () => void;
/** Function to call when the user presses on the modal backdrop */
onBackdropPress?: () => void;
/** Whether to show the toolip text */
shouldShowTooltips?: boolean;
};
type ValuePickerProps = {
/** Item to display */
value?: string;
/** Label of picker */
label?: string;
/** Items to pick from */
items?: ValuePickerItem[];
/** A placeholder value to display */
placeholder?: string;
/** Form Error description */
errorText?: MaybePhraseKey;
/** Callback to call when the input changes */
onInputChange?: (value: string | undefined) => void;
/** Text to display under the main menu item */
furtherDetails?: string;
/** Whether to show the toolip text */
shouldShowTooltips?: boolean;
};
export type {ValuePickerItem, ValueSelectorModalProps, ValuePickerProps, ValuePickerListItem};