13
13
14
14
import type { Node } from 'react' ;
15
15
16
- import type { LayoutEvent } from 'CoreEventTypes' ;
17
- import type { TextStyleProp } from 'StyleSheet' ;
16
+ import type { LayoutEvent , PressEvent } from 'CoreEventTypes' ;
17
+ import type { DangerouslyImpreciseStyleProp } from 'StyleSheet' ;
18
18
19
19
type PressRetentionOffset = {
20
20
top : number ,
@@ -26,28 +26,34 @@ type PressRetentionOffset = {
26
26
/**
27
27
* @see https://facebook.github.io/react-native/docs/text.html#reference
28
28
*/
29
- export type TextProps = { |
30
- accessible ? : boolean ,
31
- allowFontScaling ? : boolean ,
29
+ export type TextProps = $ReadOnly < {
30
+ accessible ?: ? boolean ,
31
+ allowFontScaling ?: ? boolean ,
32
32
children ?: Node ,
33
33
ellipsizeMode ?: 'clip' | 'head' | 'middle' | 'tail' ,
34
34
nativeID ?: string ,
35
- numberOfLines ? : number ,
36
- onLayout ?: ?( event : LayoutEvent ) => void ,
37
- onLongPress ?: ?( ) => void ,
38
- onPress ?: ?( ) => void ,
39
- pressRetentionOffset ?: PressRetentionOffset ,
40
- selectable ?: boolean ,
41
- style ?: TextStyleProp ,
35
+ numberOfLines ?: ?number ,
36
+ onLayout ?: ?( event : LayoutEvent ) => mixed ,
37
+ onLongPress ?: ?( event : PressEvent ) => mixed ,
38
+ onPress ?: ?( event : PressEvent ) => mixed ,
39
+ onResponderGrant ?: ?Function ,
40
+ onResponderMove ?: ?Function ,
41
+ onResponderRelease ?: ?Function ,
42
+ onResponderTerminate ?: ?Function ,
43
+ onResponderTerminationRequest ?: ?Function ,
44
+ onStartShouldSetResponder ?: ?Function ,
45
+ pressRetentionOffset ?: ?PressRetentionOffset ,
46
+ selectable ?: ?boolean ,
47
+ style ?: ?DangerouslyImpreciseStyleProp ,
42
48
testID ?: string ,
43
49
44
50
// Android Only
45
- disabled ? : boolean ,
46
- selectionColor ? : string ,
51
+ disabled ?: ? boolean ,
52
+ selectionColor ?: ? string ,
47
53
textBreakStrategy ?: 'balanced' | 'highQuality' | 'simple' ,
48
54
49
55
// iOS Only
50
- adjustsFontSizeToFit ? : boolean ,
51
- minimumFontScale ? : number ,
52
- suppressHighlighting ? : boolean ,
53
- | } ;
56
+ adjustsFontSizeToFit ?: ? boolean ,
57
+ minimumFontScale ?: ? number ,
58
+ suppressHighlighting ?: ? boolean ,
59
+ } > ;
0 commit comments