diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index df8c1e7695..337370eaf9 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -19,6 +19,7 @@ // Cheng Gibson // Saransh Kataria // Francesco Moro +// Wojciech Tyczynski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -1804,7 +1805,101 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { elevation?: number; } -export interface ViewPropsIOS { +export type TVParallaxProperties = { + /** + * If true, parallax effects are enabled. Defaults to true. + */ + enabled?: boolean, + + /** + * Defaults to 2.0. + */ + shiftDistanceX?: number, + + /** + * Defaults to 2.0. + */ + shiftDistanceY?: number, + + /** + * Defaults to 0.05. + */ + tiltAngle?: number, + + /** + * Defaults to 1.0 + */ + magnification?: number, + + /** + * Defaults to 1.0 + */ + pressMagnification?: number, + + /** + * Defaults to 0.3 + */ + pressDuration?: number, + + /** + * Defaults to 0.3 + */ + pressDelay?: number, +} + +export interface TVViewPropsIOS { + /** + * *(Apple TV only)* When set to true, this view will be focusable + * and navigable using the Apple TV remote. + * + * @platform ios + */ + isTVSelectable?: boolean, + + /** + * *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view. + * + * @platform ios + */ + hasTVPreferredFocus?: boolean, + + /** + * *(Apple TV only)* Object with properties to control Apple TV parallax effects. + * + * @platform ios + */ + tvParallaxProperties?: TVParallaxProperties, + + /** + * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0. + * + * @platform ios + */ + tvParallaxShiftDistanceX?: number, + + /** + * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0. + * + * @platform ios + */ + tvParallaxShiftDistanceY?: number, + + /** + * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 0.05. + * + * @platform ios + */ + tvParallaxTiltAngle?: number, + + /** + * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 1.0. + * + * @platform ios + */ + tvParallaxMagnification?: number, +} + +export interface ViewPropsIOS extends TVViewPropsIOS { /** * A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. * @platform ios @@ -5016,10 +5111,35 @@ interface TouchableMixin { touchableGetHitSlop(): Insets; } +export interface TouchableWithoutFeedbackPropsIOS { + /** + * *(Apple TV only)* TV preferred focus (see documentation for the View component). + * + * @platform ios + */ + hasTVPreferredFocus?: boolean; + + /** + * *(Apple TV only)* Object with properties to control Apple TV parallax effects. + * + * enabled: If true, parallax effects are enabled. Defaults to true. + * shiftDistanceX: Defaults to 2.0. + * shiftDistanceY: Defaults to 2.0. + * tiltAngle: Defaults to 0.05. + * magnification: Defaults to 1.0. + * pressMagnification: Defaults to 1.0. + * pressDuration: Defaults to 0.3. + * pressDelay: Defaults to 0.0. + * + * @platform ios + */ + tvParallaxProperties?: TVParallaxProperties; +} + /** * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props */ -export interface TouchableWithoutFeedbackProps extends AccessibilityProps { +export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackPropsIOS, AccessibilityProps { /** * Delay in ms, from onPressIn, before onLongPress is called. */