mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-21 17:10:30 +08:00
Move ImageSourcePropType.js, ImageStylePropTypes.js, TextPropTypes.js (#21387)
Summary: related #21342 TODO * move ImageSourcePropType.js, ImageStylePropTypes.js, TextPropTypes.js * fix flow error CheckList - [x] `yarn prettier` - [x] `yarn flow-check-android` - [x] `yarn flow-check-ios` All flow checks pass. [GENERAL] [ENHANCEMENT] [DeprecatedImageSourcePropType.js] - Created. [GENERAL] [ENHANCEMENT] [DeprecatedImageStylePropTypes.js] - Created. [GENERAL] [ENHANCEMENT] [DeprecatedTextPropTypes.js] - Created. Pull Request resolved: https://github.com/facebook/react-native/pull/21387 Reviewed By: TheSavior Differential Revision: D10099753 Pulled By: RSNara fbshipit-source-id: c907af6d1549ee42de1a2e17f278998e8422110f
This commit is contained in:
committed by
Facebook Github Bot
parent
e28d8f6eeb
commit
84f18341aa
@@ -30,17 +30,81 @@ export type PressRetentionOffset = $ReadOnly<{|
|
||||
* @see https://facebook.github.io/react-native/docs/text.html#reference
|
||||
*/
|
||||
export type TextProps = $ReadOnly<{
|
||||
/**
|
||||
* Indicates whether the view is an accessibility element.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#accessible
|
||||
*/
|
||||
accessible?: ?boolean,
|
||||
accessibilityRole?: ?AccessibilityRole,
|
||||
accessibilityStates?: ?AccessibilityStates,
|
||||
accessibilityTraits?: ?(AccessibilityTrait | Array<AccessibilityTrait>),
|
||||
|
||||
/**
|
||||
* Whether font should be scaled down automatically.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#adjustsfontsizetofit
|
||||
*/
|
||||
adjustsFontSizeToFit?: ?boolean,
|
||||
|
||||
/**
|
||||
* Whether fonts should scale to respect Text Size accessibility settings.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#allowfontscaling
|
||||
*/
|
||||
allowFontScaling?: ?boolean,
|
||||
children?: ?React.Node,
|
||||
|
||||
/**
|
||||
* When `numberOfLines` is set, this prop defines how text will be
|
||||
* truncated.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#ellipsizemode
|
||||
*/
|
||||
ellipsizeMode?: ?('clip' | 'head' | 'middle' | 'tail'),
|
||||
|
||||
/**
|
||||
* Specifies largest possible scale a font can reach when `allowFontScaling` is enabled.
|
||||
* Possible values:
|
||||
* `null/undefined` (default): inherit from the parent node or the global default (0)
|
||||
* `0`: no max, ignore parent/global default
|
||||
* `>= 1`: sets the maxFontSizeMultiplier of this node to this value
|
||||
*/
|
||||
maxFontSizeMultiplier?: ?number,
|
||||
|
||||
/**
|
||||
* Used to locate this view from native code.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#nativeid
|
||||
*/
|
||||
nativeID?: ?string,
|
||||
|
||||
/**
|
||||
* Used to truncate the text with an ellipsis.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#numberoflines
|
||||
*/
|
||||
numberOfLines?: ?number,
|
||||
|
||||
/**
|
||||
* Invoked on mount and layout changes.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#onlayout
|
||||
*/
|
||||
onLayout?: ?(event: LayoutEvent) => mixed,
|
||||
|
||||
/**
|
||||
* This function is called on long press.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#onlongpress
|
||||
*/
|
||||
onLongPress?: ?(event: PressEvent) => mixed,
|
||||
|
||||
/**
|
||||
* This function is called on press.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#onpress
|
||||
*/
|
||||
onPress?: ?(event: PressEvent) => mixed,
|
||||
onResponderGrant?: ?Function,
|
||||
onResponderMove?: ?Function,
|
||||
@@ -49,18 +113,71 @@ export type TextProps = $ReadOnly<{
|
||||
onResponderTerminationRequest?: ?Function,
|
||||
onStartShouldSetResponder?: ?Function,
|
||||
onTextLayout?: ?(event: TextLayoutEvent) => mixed,
|
||||
|
||||
/**
|
||||
* Defines how far your touch may move off of the button, before
|
||||
* deactivating the button.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#pressretentionoffset
|
||||
*/
|
||||
pressRetentionOffset?: ?PressRetentionOffset,
|
||||
|
||||
/**
|
||||
* Lets the user select text.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#selectable
|
||||
*/
|
||||
selectable?: ?boolean,
|
||||
style?: ?DangerouslyImpreciseStyleProp,
|
||||
|
||||
/**
|
||||
* Used to locate this view in end-to-end tests.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#testid
|
||||
*/
|
||||
testID?: ?string,
|
||||
|
||||
// Android Only
|
||||
/**
|
||||
* Android Only
|
||||
*/
|
||||
|
||||
/**
|
||||
* Specifies the disabled state of the text view for testing purposes.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#disabled
|
||||
*/
|
||||
disabled?: ?boolean,
|
||||
|
||||
/**
|
||||
* The highlight color of the text.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#selectioncolor
|
||||
*/
|
||||
selectionColor?: ?string,
|
||||
|
||||
/**
|
||||
* Set text break strategy on Android.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#textbreakstrategy
|
||||
*/
|
||||
textBreakStrategy?: ?('balanced' | 'highQuality' | 'simple'),
|
||||
|
||||
// iOS Only
|
||||
/**
|
||||
* iOS Only
|
||||
*/
|
||||
adjustsFontSizeToFit?: ?boolean,
|
||||
|
||||
/**
|
||||
* Smallest possible scale a font can reach.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#minimumfontscale
|
||||
*/
|
||||
minimumFontScale?: ?number,
|
||||
|
||||
/**
|
||||
* When `true`, no visual change is made when text is pressed down.
|
||||
*
|
||||
* See https://facebook.github.io/react-native/docs/text.html#supperhighlighting
|
||||
*/
|
||||
suppressHighlighting?: ?boolean,
|
||||
}>;
|
||||
|
||||
Reference in New Issue
Block a user