1 | import * as React from 'react';
|
2 | import { StyleProp, Animated, LayoutRectangle, ViewStyle } from 'react-native';
|
3 | import type { $Omit } from '../../types';
|
4 | declare type Props = {
|
5 | |
6 |
|
7 |
|
8 | visible: boolean;
|
9 | |
10 |
|
11 |
|
12 | anchor: React.ReactNode | {
|
13 | x: number;
|
14 | y: number;
|
15 | };
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | statusBarHeight?: number;
|
23 | |
24 |
|
25 |
|
26 | onDismiss: () => void;
|
27 | |
28 |
|
29 |
|
30 | overlayAccessibilityLabel?: string;
|
31 | |
32 |
|
33 |
|
34 | children: React.ReactNode;
|
35 | |
36 |
|
37 |
|
38 | contentStyle?: StyleProp<ViewStyle>;
|
39 | style?: StyleProp<ViewStyle>;
|
40 | |
41 |
|
42 |
|
43 | theme: ReactNativePaper.Theme;
|
44 | };
|
45 | declare type Layout = $Omit<$Omit<LayoutRectangle, 'x'>, 'y'>;
|
46 | declare type State = {
|
47 | rendered: boolean;
|
48 | top: number;
|
49 | left: number;
|
50 | menuLayout: Layout;
|
51 | anchorLayout: Layout;
|
52 | opacityAnimation: Animated.Value;
|
53 | scaleAnimation: Animated.ValueXY;
|
54 | };
|
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 | declare class Menu extends React.Component<Props, State> {
|
102 | static Item: React.ComponentType<Pick<{
|
103 | title: React.ReactNode;
|
104 | icon?: import("../Icon").IconSource | undefined;
|
105 | disabled?: boolean | undefined;
|
106 | onPress?: (() => void) | undefined;
|
107 | style?: StyleProp<ViewStyle>;
|
108 | contentStyle?: StyleProp<ViewStyle>; /**
|
109 | * Extra margin to add at the top of the menu to account for translucent status bar on Android.
|
110 | * If you are using Expo, we assume translucent status bar and set a height for status bar automatically.
|
111 | * Pass `0` or a custom value to and customize it.
|
112 | * This is automatically handled on iOS.
|
113 | */
|
114 | titleStyle?: StyleProp<import("react-native").TextStyle>;
|
115 | theme: ReactNativePaper.Theme;
|
116 | testID?: string | undefined;
|
117 | accessibilityLabel?: string | undefined;
|
118 | }, "style" | "title" | "onPress" | "testID" | "accessibilityLabel" | "icon" | "disabled" | "titleStyle" | "contentStyle"> & {
|
119 | theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
|
120 | }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<{
|
121 | title: React.ReactNode;
|
122 | icon?: import("../Icon").IconSource | undefined;
|
123 | disabled?: boolean | undefined;
|
124 | onPress?: (() => void) | undefined;
|
125 | style?: StyleProp<ViewStyle>;
|
126 | contentStyle?: StyleProp<ViewStyle>; /**
|
127 | * Extra margin to add at the top of the menu to account for translucent status bar on Android.
|
128 | * If you are using Expo, we assume translucent status bar and set a height for status bar automatically.
|
129 | * Pass `0` or a custom value to and customize it.
|
130 | * This is automatically handled on iOS.
|
131 | */
|
132 | titleStyle?: StyleProp<import("react-native").TextStyle>;
|
133 | theme: ReactNativePaper.Theme;
|
134 | testID?: string | undefined;
|
135 | accessibilityLabel?: string | undefined;
|
136 | }> & {
|
137 | ({ icon, title, disabled, onPress, style, contentStyle, testID, titleStyle, accessibilityLabel, theme, }: {
|
138 | title: React.ReactNode;
|
139 | icon?: import("../Icon").IconSource | undefined;
|
140 | disabled?: boolean | undefined;
|
141 | onPress?: (() => void) | undefined;
|
142 | style?: StyleProp<ViewStyle>;
|
143 | contentStyle?: StyleProp<ViewStyle>; |
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 | titleStyle?: StyleProp<import("react-native").TextStyle>;
|
150 | theme: ReactNativePaper.Theme;
|
151 | testID?: string | undefined;
|
152 | accessibilityLabel?: string | undefined;
|
153 | }): JSX.Element;
|
154 | displayName: string;
|
155 | }, {}>;
|
156 | static defaultProps: {
|
157 | statusBarHeight: any;
|
158 | overlayAccessibilityLabel: string;
|
159 | };
|
160 | static getDerivedStateFromProps(nextProps: Props, prevState: State): {
|
161 | rendered: boolean;
|
162 | } | null;
|
163 | state: {
|
164 | rendered: boolean;
|
165 | top: number;
|
166 | left: number;
|
167 | menuLayout: {
|
168 | width: number;
|
169 | height: number;
|
170 | };
|
171 | anchorLayout: {
|
172 | width: number;
|
173 | height: number;
|
174 | };
|
175 | opacityAnimation: Animated.Value;
|
176 | scaleAnimation: Animated.ValueXY;
|
177 | };
|
178 | componentDidUpdate(prevProps: Props): void;
|
179 | componentWillUnmount(): void;
|
180 | private anchor?;
|
181 | private menu?;
|
182 | private backHandlerSubscription;
|
183 | private dimensionsSubscription;
|
184 | private isCoordinate;
|
185 | private measureMenuLayout;
|
186 | private measureAnchorLayout;
|
187 | private updateVisibility;
|
188 | private isBrowser;
|
189 | private focusFirstDOMNode;
|
190 | private handleDismiss;
|
191 | private handleKeypress;
|
192 | private attachListeners;
|
193 | private removeListeners;
|
194 | private show;
|
195 | private hide;
|
196 | render(): JSX.Element;
|
197 | }
|
198 | declare const _default: React.ComponentType<Pick<Props, "style" | "anchor" | "children" | "visible" | "contentStyle" | "statusBarHeight" | "onDismiss" | "overlayAccessibilityLabel"> & {
|
199 | theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
|
200 | }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & typeof Menu, {}>;
|
201 | export default _default;
|
202 |
|
\ | No newline at end of file |