Skip to content

Commit 5dbd74b

Browse files
authored
Provide more TS type information for ViewWindows (#8616)
* Provide more TS type information for ViewWindows * Change files
1 parent df2e771 commit 5dbd74b

File tree

2 files changed

+56
-2
lines changed

2 files changed

+56
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Provide more TS type information for ViewWindows",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/src/Libraries/Components/View/ViewWindowsProps.ts

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,30 @@
55
*/
66

77
import {IKeyboardProps} from '../Keyboard/KeyboardExtProps';
8-
import {ViewProps} from 'react-native';
8+
import {NativeSyntheticEvent, ViewProps} from 'react-native';
9+
10+
export type INativeMouseEvent = {
11+
target: number;
12+
identifier: number;
13+
pageX: number;
14+
pageY: number;
15+
locationX: number;
16+
locationY: number;
17+
timestamp: number;
18+
pointerType: string;
19+
force: number;
20+
isLeftButton: boolean;
21+
isRightButton: boolean;
22+
isMiddleButton: boolean;
23+
isBarrelButtonPressed: boolean;
24+
isHorizontalScrollWheel: boolean;
25+
isEraser: boolean;
26+
shiftKey: boolean;
27+
ctrlKey: boolean;
28+
altKey: boolean;
29+
};
30+
31+
export type IMouseEvent = NativeSyntheticEvent<INativeMouseEvent>;
932

1033
/**
1134
* @remarks
@@ -29,5 +52,29 @@ export interface IViewWindowsProps extends IKeyboardProps, ViewProps {
2952
* See https://github.com/ReactWindows/discussions-and-proposals/blob/harinik-accessibility/proposals/0000-accessibilityapis-lists.md
3053
*/
3154
accessibilitySetSize?: number;
32-
focusable?: boolean;
55+
56+
/**
57+
* Specifies the Tooltip for the view
58+
*/
59+
tooltip?: string;
60+
61+
/**
62+
* Indicates the TabIndex to use for this view
63+
*/
64+
tabIndex?: number;
65+
66+
/**
67+
* Specifies if the control should show System focus visuals
68+
*/
69+
enableFocusRing?: boolean;
70+
71+
/**
72+
* Event fired when the mouse leaves the view
73+
*/
74+
onMouseLeave?: (args: IMouseEvent) => void;
75+
76+
/**
77+
* Event fired when the mouse enters the view
78+
*/
79+
onMouseEnter?: (args: IMouseEvent) => void;
3380
}

0 commit comments

Comments
 (0)