UNPKG

4.77 kBTypeScriptView Raw
1import * as React from 'react';
2import { View, StyleProp, ViewStyle } from 'react-native';
3import { IconSource } from '../Icon';
4declare type Props = React.ComponentPropsWithRef<typeof View> & {
5 /**
6 * The label text of the item.
7 */
8 label: string;
9 /**
10 * Icon to display for the `DrawerItem`.
11 */
12 icon?: IconSource;
13 /**
14 * Whether to highlight the drawer item as active.
15 */
16 active?: boolean;
17 /**
18 * Function to execute on press.
19 */
20 onPress?: () => void;
21 /**
22 * Accessibility label for the button. This is read by the screen reader when the user taps the button.
23 */
24 accessibilityLabel?: string;
25 /**
26 * Callback which returns a React element to display on the right side. For instance a Badge.
27 */
28 right?: (props: {
29 color: string;
30 }) => React.ReactNode;
31 style?: StyleProp<ViewStyle>;
32 /**
33 * @optional
34 */
35 theme: ReactNativePaper.Theme;
36};
37declare const _default: (React.ComponentClass<Pick<Props, "ref" | "label" | "style" | "pointerEvents" | "onLayout" | "onPress" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "icon" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "right" | "active"> & {
38 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
39}, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & {
40 ({ icon, label, active, theme, style, onPress, accessibilityLabel, right, ...rest }: Props): JSX.Element;
41 displayName: string;
42}) | (React.FunctionComponent<Props> & {
43 ({ icon, label, active, theme, style, onPress, accessibilityLabel, right, ...rest }: Props): JSX.Element;
44 displayName: string;
45}), {}>) | (React.FunctionComponent<Pick<Props, "ref" | "label" | "style" | "pointerEvents" | "onLayout" | "onPress" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "icon" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "right" | "active"> & {
46 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
47}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & {
48 ({ icon, label, active, theme, style, onPress, accessibilityLabel, right, ...rest }: Props): JSX.Element;
49 displayName: string;
50}) | (React.FunctionComponent<Props> & {
51 ({ icon, label, active, theme, style, onPress, accessibilityLabel, right, ...rest }: Props): JSX.Element;
52 displayName: string;
53}), {}>);
54export default _default;