mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 02:24:23 +00:00
Add onTextLayout to TextProps
Summary: Splitting this into a separate diff for OSS Reviewed By: yungsters Differential Revision: D9551085 fbshipit-source-id: 8ca08351c6b89cd0011aab3c47ef6cc28b763450
This commit is contained in:
parent
b8f6adf654
commit
1736be5811
@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import type {LayoutEvent, PressEvent} from 'CoreEventTypes';
|
||||
import type {LayoutEvent, PressEvent, TextLayoutEvent} from 'CoreEventTypes';
|
||||
import type React from 'React';
|
||||
import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';
|
||||
import type {
|
||||
@ -48,6 +48,7 @@ export type TextProps = $ReadOnly<{
|
||||
onResponderTerminate?: ?Function,
|
||||
onResponderTerminationRequest?: ?Function,
|
||||
onStartShouldSetResponder?: ?Function,
|
||||
onTextLayout?: ?(event: TextLayoutEvent) => mixed,
|
||||
pressRetentionOffset?: ?PressRetentionOffset,
|
||||
selectable?: ?boolean,
|
||||
style?: ?DangerouslyImpreciseStyleProp,
|
||||
|
@ -36,12 +36,27 @@ export type Layout = $ReadOnly<{|
|
||||
height: number,
|
||||
|}>;
|
||||
|
||||
export type TextLayout = $ReadOnly<{|
|
||||
...Layout,
|
||||
ascender: number,
|
||||
capHeight: number,
|
||||
descender: number,
|
||||
text: string,
|
||||
xHeight: number,
|
||||
|}>;
|
||||
|
||||
export type LayoutEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
layout: Layout,
|
||||
|}>,
|
||||
>;
|
||||
|
||||
export type TextLayoutEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
lines: Array<TextLayout>,
|
||||
|}>,
|
||||
>;
|
||||
|
||||
export type PressEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user