UNPKG

4.05 kBTypeScriptView Raw
1import * as React from 'react';
2import { ViewStyle, StyleProp, GestureResponderEvent, TouchableWithoutFeedback } from 'react-native';
3import TouchableRipple from './TouchableRipple/TouchableRipple';
4import { IconSource } from './Icon';
5import type { $RemoveChildren } from '../types';
6declare type Props = $RemoveChildren<typeof TouchableRipple> & {
7 /**
8 * Icon to display.
9 */
10 icon: IconSource;
11 /**
12 * Color of the icon.
13 */
14 color?: string;
15 /**
16 * Size of the icon.
17 */
18 size?: number;
19 /**
20 * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch.
21 */
22 disabled?: boolean;
23 /**
24 * Whether an icon change is animated.
25 */
26 animated?: boolean;
27 /**
28 * Accessibility label for the button. This is read by the screen reader when the user taps the button.
29 */
30 accessibilityLabel?: string;
31 /**
32 * Function to execute on press.
33 */
34 onPress?: (e: GestureResponderEvent) => void;
35 style?: StyleProp<ViewStyle>;
36 ref?: React.RefObject<TouchableWithoutFeedback>;
37 /**
38 * @optional
39 */
40 theme: ReactNativePaper.Theme;
41};
42declare const _default: (React.ComponentClass<Pick<Props, "ref" | "style" | "color" | "size" | "onLayout" | "onPress" | "onLongPress" | "testID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "icon" | "key" | "hitSlop" | "hasTVPreferredFocus" | "tvParallaxProperties" | "delayLongPress" | "delayPressIn" | "delayPressOut" | "disabled" | "onBlur" | "onFocus" | "onPressIn" | "onPressOut" | "pressRetentionOffset" | "touchSoundDisabled" | "background" | "borderless" | "rippleColor" | "underlayColor" | "centered" | "animated"> & {
43 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
44}, any> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & (({ icon, color: customColor, size, accessibilityLabel, disabled, onPress, animated, theme, style, ...rest }: Props) => JSX.Element)) | (React.FunctionComponent<Props> & (({ icon, color: customColor, size, accessibilityLabel, disabled, onPress, animated, theme, style, ...rest }: Props) => JSX.Element)), {}>) | (React.FunctionComponent<Pick<Props, "ref" | "style" | "color" | "size" | "onLayout" | "onPress" | "onLongPress" | "testID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "icon" | "key" | "hitSlop" | "hasTVPreferredFocus" | "tvParallaxProperties" | "delayLongPress" | "delayPressIn" | "delayPressOut" | "disabled" | "onBlur" | "onFocus" | "onPressIn" | "onPressOut" | "pressRetentionOffset" | "touchSoundDisabled" | "background" | "borderless" | "rippleColor" | "underlayColor" | "centered" | "animated"> & {
45 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
46}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<(React.ComponentClass<Props, any> & (({ icon, color: customColor, size, accessibilityLabel, disabled, onPress, animated, theme, style, ...rest }: Props) => JSX.Element)) | (React.FunctionComponent<Props> & (({ icon, color: customColor, size, accessibilityLabel, disabled, onPress, animated, theme, style, ...rest }: Props) => JSX.Element)), {}>);
47export default _default;
48
\No newline at end of file