UNPKG

4.93 kBTypeScriptView Raw
1import * as React from 'react';
2import { View, ViewStyle, StyleProp } from 'react-native';
3import Surface from './Surface';
4import { IconSource } from './Icon';
5import type { $RemoveChildren } from '../types';
6declare type Props = $RemoveChildren<typeof Surface> & {
7 /**
8 * Whether banner is currently visible.
9 */
10 visible: boolean;
11 /**
12 * Content that will be displayed inside banner.
13 */
14 children: string;
15 /**
16 * Icon to display for the `Banner`. Can be an image.
17 */
18 icon?: IconSource;
19 /**
20 * Action items to shown in the banner.
21 * An action item should contain the following properties:
22 *
23 * - `label`: label of the action button (required)
24 * - `onPress`: callback that is called when button is pressed (required)
25 *
26 * To customize button you can pass other props that button component takes.
27 */
28 actions: Array<{
29 label: string;
30 onPress: () => void;
31 }>;
32 /**
33 * Style of banner's inner content.
34 * Use this prop to apply custom width for wide layouts.
35 */
36 contentStyle?: StyleProp<ViewStyle>;
37 style?: StyleProp<ViewStyle>;
38 ref?: React.RefObject<View>;
39 /**
40 * @optional
41 */
42 theme: ReactNativePaper.Theme;
43};
44declare const _default: (React.ComponentClass<Pick<Props, "ref" | "style" | "children" | "pointerEvents" | "onLayout" | "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" | "visible" | "contentStyle" | "actions"> & {
45 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
46}, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & (({ visible, icon, children, actions, contentStyle, style, theme, ...rest }: Props) => JSX.Element)) | (React.FunctionComponent<Props> & (({ visible, icon, children, actions, contentStyle, style, theme, ...rest }: Props) => JSX.Element)), {}>) | (React.FunctionComponent<Pick<Props, "ref" | "style" | "children" | "pointerEvents" | "onLayout" | "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" | "visible" | "contentStyle" | "actions"> & {
47 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
48}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & (({ visible, icon, children, actions, contentStyle, style, theme, ...rest }: Props) => JSX.Element)) | (React.FunctionComponent<Props> & (({ visible, icon, children, actions, contentStyle, style, theme, ...rest }: Props) => JSX.Element)), {}>);
49export default _default;
50
\No newline at end of file