-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathCalloutNativeComponent.ts
More file actions
60 lines (53 loc) · 1.8 KB
/
CalloutNativeComponent.ts
File metadata and controls
60 lines (53 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
* @format
*/
import type { HostComponent, ViewProps } from 'react-native';
import type { WithDefault, DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { UnsafeMixed } from './codegenTypes';
// Should be:
// import type {UnsafeMixed} from 'react-native/Libraries/Types/CodegenTypes';
type AnchorRect = {
screenX: Double;
screenY: Double;
width: Double;
height: Double;
};
export interface NativeProps extends ViewProps {
accessibilityLabel?: string;
accessibilityOnShowAnnouncement?: string;
anchorRect?: AnchorRect;
directionalHint?: WithDefault<
| 'leftTopEdge'
| 'leftCenter'
| 'leftBottomEdge'
| 'topLeftEdge'
| 'topAutoEdge'
| 'topCenter'
| 'topRightEdge'
| 'rightTopEdge'
| 'rightCenter'
| 'rightBottomEdge'
| 'bottomLeftEdge'
| 'bottomAutoEdge'
| 'bottomCenter'
| 'bottomRightEdge',
'bottomLeftEdge'
>;
dismissBehaviors?: string[];
doNotTakePointerCapture?: boolean;
focusable?: boolean;
isBeakVisible?: boolean;
maxHeight?: Int32;
maxWidth?: Int32;
setInitialFocus?: boolean;
target?: UnsafeMixed;
// targetAnchor?: string; // Win32 only Callout can target an anchor registered in the anchor registry // Can be a node id or an anchor ID - This need to be reworked as Mixed types are not supported going forward
testID?: string;
onRestoreFocus?: DirectEventHandler<{ target: Int32; containsFocus: boolean }>;
onDismiss?: DirectEventHandler<{ target: Int32 }>;
onShow?: DirectEventHandler<{ target: Int32 }>;
}
export default codegenNativeComponent<NativeProps>('RCTCallout') as HostComponent<NativeProps>;