From 1a3abaa7aa5c70f40f992b51506f2d8526ff38e3 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 6 May 2021 17:05:15 -0600 Subject: [PATCH] add CursorValue flow type --- .../Touchable/TouchableWithoutFeedback.js | 24 +--------- Libraries/Components/View/ViewPropTypes.js | 24 +--------- Libraries/StyleSheet/StyleSheetTypes.js | 46 ++++++++++--------- 3 files changed, 28 insertions(+), 66 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 9e96edf5df4e97..cd8135d375c63f 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -23,6 +23,7 @@ import type { AccessibilityValue, } from '../../Components/View/ViewAccessibility'; import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; +import type {CursorValue} from '../../StyleSheet/StyleSheetTypes'; import type { BlurEvent, FocusEvent, @@ -54,28 +55,7 @@ type Props = $ReadOnly<{| accessibilityViewIsModal?: ?boolean, accessible?: ?boolean, children?: ?React.Node, - cursor?: ?( - | 'alias' - | 'auto' - | 'col-resize' - | 'context-menu' - | 'copy' - | 'crosshair' - | 'default' - | 'disappearing-item' - | 'e-resize' - | 'grab' - | 'grabbing' - | 'n-resize' - | 'no-drop' - | 'not-allowed' - | 'pointer' - | 'row-resize' - | 's-resize' - | 'text' - | 'vertical-text' - | 'w-resize' - ), + cursor?: ?CursorValue, delayLongPress?: ?number, delayPressIn?: ?number, delayPressOut?: ?number, diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 51dacf204c5f1e..c54ed894369606 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -23,6 +23,7 @@ import type { import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType'; import type {Node} from 'react'; import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; +import type {CursorValue} from '../../StyleSheet/StyleSheetTypes'; import type { AccessibilityRole, AccessibilityState, @@ -630,26 +631,5 @@ export type ViewProps = $ReadOnly<{| /* * Sets the type of mouse cursor, to show when the mouse pointer is over the view. */ - cursor?: ?( - | 'alias' - | 'auto' - | 'col-resize' - | 'context-menu' - | 'copy' - | 'crosshair' - | 'default' - | 'disappearing-item' - | 'e-resize' - | 'grab' - | 'grabbing' - | 'n-resize' - | 'no-drop' - | 'not-allowed' - | 'pointer' - | 'row-resize' - | 's-resize' - | 'text' - | 'vertical-text' - | 'w-resize' - ), + cursor?: ?CursorValue, |}>; diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index fd26321ffd7011..832528590a77d7 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -14,6 +14,29 @@ const AnimatedNode = require('../Animated/src/nodes/AnimatedNode'); import type {NativeColorValue} from './PlatformColorValueTypes'; +export type CursorValue = ?( + | 'alias' + | 'auto' + | 'col-resize' + | 'context-menu' + | 'copy' + | 'crosshair' + | 'default' + | 'disappearing-item' + | 'e-resize' + | 'grab' + | 'grabbing' + | 'n-resize' + | 'no-drop' + | 'not-allowed' + | 'pointer' + | 'row-resize' + | 's-resize' + | 'text' + | 'vertical-text' + | 'w-resize' +) + export type ColorValue = null | string | NativeColorValue; export type ColorArrayValue = null | $ReadOnlyArray; @@ -583,28 +606,7 @@ export type ____ViewStyle_Internal = $ReadOnly<{| borderTopWidth?: number | AnimatedNode, opacity?: number | AnimatedNode, elevation?: number, - cursor?: ?( - | 'alias' - | 'auto' - | 'col-resize' - | 'context-menu' - | 'copy' - | 'crosshair' - | 'default' - | 'disappearing-item' - | 'e-resize' - | 'grab' - | 'grabbing' - | 'n-resize' - | 'no-drop' - | 'not-allowed' - | 'pointer' - | 'row-resize' - | 's-resize' - | 'text' - | 'vertical-text' - | 'w-resize' - ), + cursor?: CursorValue, |}>; export type ____FontWeight_Internal =