1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import type * as React from 'react';
|
11 | import {Constructor} from '../../types/private/Utilities';
|
12 | import {AccessibilityProps} from '../Components/View/ViewAccessibility';
|
13 | import {NativeMethods} from '../../types/public/ReactNativeTypes';
|
14 | import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet';
|
15 | import {TextStyle} from '../StyleSheet/StyleSheetTypes';
|
16 | import {
|
17 | GestureResponderEvent,
|
18 | LayoutChangeEvent,
|
19 | NativeSyntheticEvent,
|
20 | TextLayoutEventData,
|
21 | } from '../Types/CoreEventTypes';
|
22 |
|
23 | export interface TextPropsIOS {
|
24 | |
25 |
|
26 |
|
27 | adjustsFontSizeToFit?: boolean | undefined;
|
28 |
|
29 | |
30 |
|
31 |
|
32 | dynamicTypeRamp?:
|
33 | | 'caption2'
|
34 | | 'caption1'
|
35 | | 'footnote'
|
36 | | 'subheadline'
|
37 | | 'callout'
|
38 | | 'body'
|
39 | | 'headline'
|
40 | | 'title3'
|
41 | | 'title2'
|
42 | | 'title1'
|
43 | | 'largeTitle'
|
44 | | undefined;
|
45 |
|
46 | |
47 |
|
48 |
|
49 |
|
50 | suppressHighlighting?: boolean | undefined;
|
51 |
|
52 | |
53 |
|
54 |
|
55 | lineBreakStrategyIOS?:
|
56 | | 'none'
|
57 | | 'standard'
|
58 | | 'hangul-word'
|
59 | | 'push-out'
|
60 | | undefined;
|
61 | }
|
62 |
|
63 | export interface TextPropsAndroid {
|
64 | |
65 |
|
66 |
|
67 | disabled?: boolean | undefined;
|
68 |
|
69 | |
70 |
|
71 |
|
72 | selectable?: boolean | undefined;
|
73 |
|
74 | |
75 |
|
76 |
|
77 | selectionColor?: ColorValue | undefined;
|
78 |
|
79 | |
80 |
|
81 |
|
82 |
|
83 | textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined;
|
84 |
|
85 | |
86 |
|
87 |
|
88 |
|
89 | dataDetectorType?:
|
90 | | null
|
91 | | 'phoneNumber'
|
92 | | 'link'
|
93 | | 'email'
|
94 | | 'none'
|
95 | | 'all'
|
96 | | undefined;
|
97 |
|
98 | |
99 |
|
100 |
|
101 | android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined;
|
102 | }
|
103 |
|
104 |
|
105 | export interface TextProps
|
106 | extends TextPropsIOS,
|
107 | TextPropsAndroid,
|
108 | AccessibilityProps {
|
109 | |
110 |
|
111 |
|
112 |
|
113 | allowFontScaling?: boolean | undefined;
|
114 |
|
115 | children?: React.ReactNode | undefined;
|
116 |
|
117 | |
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
|
135 |
|
136 | |
137 |
|
138 |
|
139 | id?: string | undefined;
|
140 |
|
141 | |
142 |
|
143 |
|
144 |
|
145 | lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined;
|
146 |
|
147 | |
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | numberOfLines?: number | undefined;
|
155 |
|
156 | |
157 |
|
158 |
|
159 |
|
160 |
|
161 | onLayout?: ((event: LayoutChangeEvent) => void) | undefined;
|
162 |
|
163 | /**
|
164 | * Invoked on Text layout
|
165 | */
|
166 | onTextLayout?:
|
167 | | ((event: NativeSyntheticEvent<TextLayoutEventData>) => void)
|
168 | | undefined;
|
169 |
|
170 | /**
|
171 | * This function is called on press.
|
172 | * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting).
|
173 | */
|
174 | onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
175 |
|
176 | onPressIn?: ((event: GestureResponderEvent) => void) | undefined;
|
177 | onPressOut?: ((event: GestureResponderEvent) => void) | undefined;
|
178 |
|
179 | /**
|
180 | * This function is called on long press.
|
181 | * e.g., `onLongPress={this.increaseSize}>``
|
182 | */
|
183 | onLongPress?: ((event: GestureResponderEvent) => void) | undefined;
|
184 |
|
185 | /**
|
186 | * @see https://reactnative.dev/docs/text#style
|
187 | */
|
188 | style?: StyleProp<TextStyle> | undefined;
|
189 |
|
190 | /**
|
191 | * Used to locate this view in end-to-end tests.
|
192 | */
|
193 | testID?: string | undefined;
|
194 |
|
195 | /**
|
196 | * Used to reference react managed views from native code.
|
197 | */
|
198 | nativeID?: string | undefined;
|
199 |
|
200 | /**
|
201 | * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:
|
202 | * - null/undefined (default): inherit from the parent node or the global default (0)
|
203 | * - 0: no max, ignore parent/global default
|
204 | * - >= 1: sets the maxFontSizeMultiplier of this node to this value
|
205 | */
|
206 | maxFontSizeMultiplier?: number | null | undefined;
|
207 |
|
208 | /**
|
209 | * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
|
210 | */
|
211 | minimumFontScale?: number | undefined;
|
212 | }
|
213 |
|
214 | /**
|
215 | * A React component for displaying text which supports nesting, styling, and touch handling.
|
216 | */
|
217 | declare class TextComponent extends React.Component<TextProps> {}
|
218 | declare const TextBase: Constructor<NativeMethods> & typeof TextComponent;
|
219 | export class Text extends TextBase {}
|
220 |
|
\ | No newline at end of file |