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 {TVParallaxProperties} from '../View/ViewPropTypes';
15import {TouchableMixin} from './Touchable';
16import {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
17
18export interface TVProps {
19  /**
20   * *(Apple TV only)* TV preferred focus (see documentation for the View component).
21   *
22   * @platform ios
23   */
24  hasTVPreferredFocus?: boolean | undefined;
25
26  /**
27   * Designates the next view to receive focus when the user navigates down. See the Android documentation.
28   *
29   * @platform android
30   */
31  nextFocusDown?: number | undefined;
32
33  /**
34   * Designates the next view to receive focus when the user navigates forward. See the Android documentation.
35   *
36   * @platform android
37   */
38  nextFocusForward?: number | undefined;
39
40  /**
41   * Designates the next view to receive focus when the user navigates left. See the Android documentation.
42   *
43   * @platform android
44   */
45  nextFocusLeft?: number | undefined;
46
47  /**
48   * Designates the next view to receive focus when the user navigates right. See the Android documentation.
49   *
50   * @platform android
51   */
52  nextFocusRight?: number | undefined;
53
54  /**
55   * Designates the next view to receive focus when the user navigates up. See the Android documentation.
56   *
57   * @platform android
58   */
59  nextFocusUp?: number | undefined;
60}
61
62/**
63 * @see https://reactnative.dev/docs/touchableopacity#props
64 */
65export interface TouchableOpacityProps
66  extends TouchableWithoutFeedbackProps,
67    TVProps {
68  /**
69   * Determines what the opacity of the wrapped view should be when touch is active.
70   * Defaults to 0.2
71   */
72  activeOpacity?: number | undefined;
73
74  /**
75   * *(Apple TV only)* Object with properties to control Apple TV parallax effects.
76   *
77   * enabled: If true, parallax effects are enabled.  Defaults to true.
78   * shiftDistanceX: Defaults to 2.0.
79   * shiftDistanceY: Defaults to 2.0.
80   * tiltAngle: Defaults to 0.05.
81   * magnification: Defaults to 1.0.
82   * pressMagnification: Defaults to 1.0.
83   * pressDuration: Defaults to 0.3.
84   * pressDelay: Defaults to 0.0.
85   *
86   * @platform android
87   */
88  tvParallaxProperties?: TVParallaxProperties | undefined;
89}
90
91/**
92 * A wrapper for making views respond properly to touches.
93 * On press down, the opacity of the wrapped view is decreased, dimming it.
94 * This is done without actually changing the view hierarchy,
95 * and in general is easy to add to an app without weird side-effects.
96 *
97 * @see https://reactnative.dev/docs/touchableopacity
98 */
99declare class TouchableOpacityComponent extends React.Component<TouchableOpacityProps> {}
100declare const TouchableOpacityBase: Constructor<TimerMixin> &
101  Constructor<TouchableMixin> &
102  Constructor<NativeMethods> &
103  typeof TouchableOpacityComponent;
104export class TouchableOpacity extends TouchableOpacityBase {
105  /**
106   * Animate the touchable to a new opacity.
107   */
108  setOpacityTo: (value: number) => void;
109}
110