1/** 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 * 7 * @format 8 */ 9 10import type * as React from 'react'; 11import {Constructor} from '../../../types/private/Utilities'; 12import {TimerMixin} from '../../../types/private/TimerMixin'; 13import {NativeMethods} from '../../../types/public/ReactNativeTypes'; 14import {ColorValue, StyleProp} from '../../StyleSheet/StyleSheet'; 15import {ViewStyle} from '../../StyleSheet/StyleSheetTypes'; 16import {TouchableMixin} from './Touchable'; 17import {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback'; 18 19/** 20 * @see https://reactnative.dev/docs/touchablehighlight#props 21 */ 22export interface TouchableHighlightProps extends TouchableWithoutFeedbackProps { 23 /** 24 * Determines what the opacity of the wrapped view should be when touch is active. 25 */ 26 activeOpacity?: number | undefined; 27 28 /** 29 * 30 * Called immediately after the underlay is hidden 31 */ 32 onHideUnderlay?: (() => void) | undefined; 33 34 /** 35 * Called immediately after the underlay is shown 36 */ 37 onShowUnderlay?: (() => void) | undefined; 38 39 /** 40 * @see https://reactnative.dev/docs/view#style 41 */ 42 style?: StyleProp<ViewStyle> | undefined; 43 44 /** 45 * The color of the underlay that will show through when the touch is active. 46 */ 47 underlayColor?: ColorValue | undefined; 48} 49 50/** 51 * A wrapper for making views respond properly to touches. 52 * On press down, the opacity of the wrapped view is decreased, 53 * which allows the underlay color to show through, darkening or tinting the view. 54 * The underlay comes from adding a view to the view hierarchy, 55 * which can sometimes cause unwanted visual artifacts if not used correctly, 56 * for example if the backgroundColor of the wrapped view isn't explicitly set to an opaque color. 57 * 58 * NOTE: TouchableHighlight supports only one child 59 * If you wish to have several child components, wrap them in a View. 60 * 61 * @see https://reactnative.dev/docs/touchablehighlight 62 */ 63declare class TouchableHighlightComponent extends React.Component<TouchableHighlightProps> {} 64declare const TouchableHighlightBase: Constructor<NativeMethods> & 65 Constructor<TimerMixin> & 66 Constructor<TouchableMixin> & 67 typeof TouchableHighlightComponent; 68export class TouchableHighlight extends TouchableHighlightBase {} 69