forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
82 lines (58 loc) · 2.65 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import type {NativeSyntheticEvent, StyleProp, TextInputFocusEventData, TextInputSelectionChangeEventData, TextStyle, ViewStyle} from 'react-native';
import type {TextSelection} from '@components/Composer/types';
import type {BaseTextInputProps} from '@components/TextInput/BaseTextInput/types';
type TextInputWithCurrencySymbolProps = {
/** Formatted amount in local currency */
formattedAmount: string;
/** Function to call when amount in text input is changed */
onChangeAmount?: (value: string) => void;
/** Function to call when currency button is pressed */
onCurrencyButtonPress?: () => void;
/** Placeholder value for amount text input */
placeholder: string;
/** Currency code of user's selected currency */
selectedCurrencyCode: string;
/** Selection Object */
selection?: TextSelection;
/** Function to call when selection in text input is changed */
onSelectionChange?: (event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;
/** Function to call to handle key presses in the text input */
onKeyPress?: (event: NativeSyntheticEvent<KeyboardEvent>) => void;
/**
* Callback that is called when the text input is blurred
*/
onBlur?: ((e: NativeSyntheticEvent<TextInputFocusEventData>) => void) | undefined;
/**
* Callback that is called when the text input is pressed down
*/
onMouseDown?: ((e: React.MouseEvent) => void) | undefined;
/**
* Callback that is called when the text input is pressed up
*/
onMouseUp?: ((e: React.MouseEvent) => void) | undefined;
/** Whether the currency symbol is pressable */
isCurrencyPressable: boolean;
/** Whether to hide the currency symbol */
hideCurrencySymbol?: boolean;
/** Whether to disable native keyboard on mobile */
disableKeyboard?: boolean;
/** Extra symbol to display */
extraSymbol?: React.ReactNode;
/** Style for the input */
style?: StyleProp<TextStyle>;
/** Style for the container */
containerStyle?: StyleProp<ViewStyle>;
/** Character to be shown before the amount */
prefixCharacter?: string;
/** Style for the prefix */
prefixStyle?: StyleProp<TextStyle>;
/** Style for the prefix container */
prefixContainerStyle?: StyleProp<ViewStyle>;
/** Customizes the touchable wrapper of the TextInput component */
touchableInputWrapperStyle?: StyleProp<ViewStyle>;
/** Max length for the amount input */
maxLength?: number;
/** Hide the focus styles on TextInput */
hideFocusedState?: boolean;
} & Pick<BaseTextInputProps, 'autoFocus' | 'autoGrow'>;
export default TextInputWithCurrencySymbolProps;