Skip to content

Commit

Permalink
add CursorValue flow type
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlntn committed May 6, 2021
1 parent f9eaa5e commit 1a3abaa
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 66 deletions.
24 changes: 2 additions & 22 deletions Libraries/Components/Touchable/TouchableWithoutFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
24 changes: 2 additions & 22 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
|}>;
46 changes: 24 additions & 22 deletions Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<ColorValue>;
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 1a3abaa

Please sign in to comment.