Skip to content

Commit 1a3abaa

Browse files
committed
add CursorValue flow type
1 parent f9eaa5e commit 1a3abaa

File tree

3 files changed

+28
-66
lines changed

3 files changed

+28
-66
lines changed

Libraries/Components/Touchable/TouchableWithoutFeedback.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import type {
2323
AccessibilityValue,
2424
} from '../../Components/View/ViewAccessibility';
2525
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
26+
import type {CursorValue} from '../../StyleSheet/StyleSheetTypes';
2627
import type {
2728
BlurEvent,
2829
FocusEvent,
@@ -54,28 +55,7 @@ type Props = $ReadOnly<{|
5455
accessibilityViewIsModal?: ?boolean,
5556
accessible?: ?boolean,
5657
children?: ?React.Node,
57-
cursor?: ?(
58-
| 'alias'
59-
| 'auto'
60-
| 'col-resize'
61-
| 'context-menu'
62-
| 'copy'
63-
| 'crosshair'
64-
| 'default'
65-
| 'disappearing-item'
66-
| 'e-resize'
67-
| 'grab'
68-
| 'grabbing'
69-
| 'n-resize'
70-
| 'no-drop'
71-
| 'not-allowed'
72-
| 'pointer'
73-
| 'row-resize'
74-
| 's-resize'
75-
| 'text'
76-
| 'vertical-text'
77-
| 'w-resize'
78-
),
58+
cursor?: ?CursorValue,
7959
delayLongPress?: ?number,
8060
delayPressIn?: ?number,
8161
delayPressOut?: ?number,

Libraries/Components/View/ViewPropTypes.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import type {
2323
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
2424
import type {Node} from 'react';
2525
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
26+
import type {CursorValue} from '../../StyleSheet/StyleSheetTypes';
2627
import type {
2728
AccessibilityRole,
2829
AccessibilityState,
@@ -630,26 +631,5 @@ export type ViewProps = $ReadOnly<{|
630631
/*
631632
* Sets the type of mouse cursor, to show when the mouse pointer is over the view.
632633
*/
633-
cursor?: ?(
634-
| 'alias'
635-
| 'auto'
636-
| 'col-resize'
637-
| 'context-menu'
638-
| 'copy'
639-
| 'crosshair'
640-
| 'default'
641-
| 'disappearing-item'
642-
| 'e-resize'
643-
| 'grab'
644-
| 'grabbing'
645-
| 'n-resize'
646-
| 'no-drop'
647-
| 'not-allowed'
648-
| 'pointer'
649-
| 'row-resize'
650-
| 's-resize'
651-
| 'text'
652-
| 'vertical-text'
653-
| 'w-resize'
654-
),
634+
cursor?: ?CursorValue,
655635
|}>;

Libraries/StyleSheet/StyleSheetTypes.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ const AnimatedNode = require('../Animated/src/nodes/AnimatedNode');
1414

1515
import type {NativeColorValue} from './PlatformColorValueTypes';
1616

17+
export type CursorValue = ?(
18+
| 'alias'
19+
| 'auto'
20+
| 'col-resize'
21+
| 'context-menu'
22+
| 'copy'
23+
| 'crosshair'
24+
| 'default'
25+
| 'disappearing-item'
26+
| 'e-resize'
27+
| 'grab'
28+
| 'grabbing'
29+
| 'n-resize'
30+
| 'no-drop'
31+
| 'not-allowed'
32+
| 'pointer'
33+
| 'row-resize'
34+
| 's-resize'
35+
| 'text'
36+
| 'vertical-text'
37+
| 'w-resize'
38+
)
39+
1740
export type ColorValue = null | string | NativeColorValue;
1841

1942
export type ColorArrayValue = null | $ReadOnlyArray<ColorValue>;
@@ -583,28 +606,7 @@ export type ____ViewStyle_Internal = $ReadOnly<{|
583606
borderTopWidth?: number | AnimatedNode,
584607
opacity?: number | AnimatedNode,
585608
elevation?: number,
586-
cursor?: ?(
587-
| 'alias'
588-
| 'auto'
589-
| 'col-resize'
590-
| 'context-menu'
591-
| 'copy'
592-
| 'crosshair'
593-
| 'default'
594-
| 'disappearing-item'
595-
| 'e-resize'
596-
| 'grab'
597-
| 'grabbing'
598-
| 'n-resize'
599-
| 'no-drop'
600-
| 'not-allowed'
601-
| 'pointer'
602-
| 'row-resize'
603-
| 's-resize'
604-
| 'text'
605-
| 'vertical-text'
606-
| 'w-resize'
607-
),
609+
cursor?: CursorValue,
608610
|}>;
609611

610612
export type ____FontWeight_Internal =

0 commit comments

Comments
 (0)