1 | import * as React from 'react';
|
2 | import { StyleProp, Animated, LayoutRectangle, ViewStyle } from 'react-native';
|
3 | import type { $Omit } from '../../types';
|
4 | import MenuItem from './MenuItem';
|
5 | declare type Props = {
|
6 | |
7 |
|
8 |
|
9 | visible: boolean;
|
10 | |
11 |
|
12 |
|
13 | anchor: React.ReactNode | {
|
14 | x: number;
|
15 | y: number;
|
16 | };
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | statusBarHeight?: number;
|
24 | |
25 |
|
26 |
|
27 | onDismiss: () => void;
|
28 | |
29 |
|
30 |
|
31 | overlayAccessibilityLabel?: string;
|
32 | |
33 |
|
34 |
|
35 | children: React.ReactNode;
|
36 | |
37 |
|
38 |
|
39 | contentStyle?: StyleProp<ViewStyle>;
|
40 | style?: StyleProp<ViewStyle>;
|
41 | |
42 |
|
43 |
|
44 | theme: ReactNativePaper.Theme;
|
45 | };
|
46 | declare type Layout = $Omit<$Omit<LayoutRectangle, 'x'>, 'y'>;
|
47 | declare type State = {
|
48 | rendered: boolean;
|
49 | top: number;
|
50 | left: number;
|
51 | menuLayout: Layout;
|
52 | anchorLayout: Layout;
|
53 | opacityAnimation: Animated.Value;
|
54 | scaleAnimation: Animated.ValueXY;
|
55 | };
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | declare class Menu extends React.Component<Props, State> {
|
103 | static Item: typeof MenuItem;
|
104 | static defaultProps: {
|
105 | statusBarHeight: any;
|
106 | overlayAccessibilityLabel: string;
|
107 | };
|
108 | static getDerivedStateFromProps(nextProps: Props, prevState: State): {
|
109 | rendered: boolean;
|
110 | } | null;
|
111 | state: {
|
112 | rendered: boolean;
|
113 | top: number;
|
114 | left: number;
|
115 | menuLayout: {
|
116 | width: number;
|
117 | height: number;
|
118 | };
|
119 | anchorLayout: {
|
120 | width: number;
|
121 | height: number;
|
122 | };
|
123 | opacityAnimation: Animated.Value;
|
124 | scaleAnimation: Animated.ValueXY;
|
125 | };
|
126 | componentDidUpdate(prevProps: Props): void;
|
127 | componentWillUnmount(): void;
|
128 | private anchor?;
|
129 | private menu?;
|
130 | private isCoordinate;
|
131 | private measureMenuLayout;
|
132 | private measureAnchorLayout;
|
133 | private updateVisibility;
|
134 | private isBrowser;
|
135 | private focusFirstDOMNode;
|
136 | private handleDismiss;
|
137 | private handleKeypress;
|
138 | private attachListeners;
|
139 | private removeListeners;
|
140 | private show;
|
141 | private hide;
|
142 | render(): JSX.Element;
|
143 | }
|
144 | declare const _default: (React.ComponentClass<Pick<Props, "style" | "anchor" | "children" | "visible" | "contentStyle" | "statusBarHeight" | "onDismiss" | "overlayAccessibilityLabel"> & {
|
145 | theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
|
146 | }, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & typeof Menu) | (React.FunctionComponent<Props> & typeof Menu), {}>) | (React.FunctionComponent<Pick<Props, "style" | "anchor" | "children" | "visible" | "contentStyle" | "statusBarHeight" | "onDismiss" | "overlayAccessibilityLabel"> & {
|
147 | theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
|
148 | }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & typeof Menu) | (React.FunctionComponent<Props> & typeof Menu), {}>);
|
149 | export default _default;
|