From 30fd5a3c0528b24a2b9dbcf04eaae0e534577276 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 1 Apr 2025 03:54:49 -0700 Subject: [PATCH] Update Accessibility, Animated and Appearance type exports (#50421) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50421 Changelog: [Internal] Reviewed By: huntie Differential Revision: D72224821 fbshipit-source-id: 604fcdcabc1b6eeca7df3a32faf2505ddf268547 --- .../Libraries/Animated/AnimatedExports.js.flow | 1 + packages/react-native/Libraries/Utilities/Appearance.js | 2 ++ .../__tests__/__snapshots__/public-api-test.js.snap | 8 +++++++- packages/react-native/index.js.flow | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Animated/AnimatedExports.js.flow b/packages/react-native/Libraries/Animated/AnimatedExports.js.flow index 8ef977556aa..18f56ec1e5a 100644 --- a/packages/react-native/Libraries/Animated/AnimatedExports.js.flow +++ b/packages/react-native/Libraries/Animated/AnimatedExports.js.flow @@ -37,6 +37,7 @@ export type {default as AnimatedDivision} from './nodes/AnimatedDivision'; export type {default as AnimatedModulo} from './nodes/AnimatedModulo'; export type {default as AnimatedMultiplication} from './nodes/AnimatedMultiplication'; export type {default as AnimatedSubtraction} from './nodes/AnimatedSubtraction'; +export type {WithAnimatedValue} from './createAnimatedComponent'; export const add = AnimatedImplementation.add; export const attachNativeEvent = AnimatedImplementation.attachNativeEvent; diff --git a/packages/react-native/Libraries/Utilities/Appearance.js b/packages/react-native/Libraries/Utilities/Appearance.js index 6c13f4d6d53..411ce1766b4 100644 --- a/packages/react-native/Libraries/Utilities/Appearance.js +++ b/packages/react-native/Libraries/Utilities/Appearance.js @@ -16,6 +16,8 @@ import NativeEventEmitter from '../EventEmitter/NativeEventEmitter'; import EventEmitter from '../vendor/emitter/EventEmitter'; import invariant from 'invariant'; +export type {AppearancePreferences}; + type Appearance = { colorScheme: ?ColorSchemeName, }; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 3fe206a1cf3..fbe122e9966 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -185,6 +185,7 @@ export type { default as AnimatedDivision } from \\"./nodes/AnimatedDivision\\"; export type { default as AnimatedModulo } from \\"./nodes/AnimatedModulo\\"; export type { default as AnimatedMultiplication } from \\"./nodes/AnimatedMultiplication\\"; export type { default as AnimatedSubtraction } from \\"./nodes/AnimatedSubtraction\\"; +export type { WithAnimatedValue } from \\"./createAnimatedComponent\\"; declare export const add: $FlowFixMe; declare export const attachNativeEvent: $FlowFixMe; declare export const createAnimatedComponent: $FlowFixMe; @@ -8515,7 +8516,8 @@ declare export default typeof UTFSequence; `; exports[`public API should not change unintentionally Libraries/Utilities/Appearance.js 1`] = ` -"declare export function getColorScheme(): ?ColorSchemeName; +"export type { AppearancePreferences }; +declare export function getColorScheme(): ?ColorSchemeName; declare export function setColorScheme(colorScheme: ?ColorSchemeName): void; declare export function addChangeListener( listener: ({ colorScheme: ?ColorSchemeName }) => void @@ -9473,6 +9475,10 @@ export type { TouchableOpacityProps } from \\"./Libraries/Components/Touchable/T export { default as TouchableOpacity } from \\"./Libraries/Components/Touchable/TouchableOpacity\\"; export type { TouchableWithoutFeedbackProps } from \\"./Libraries/Components/Touchable/TouchableWithoutFeedback\\"; export { default as TouchableWithoutFeedback } from \\"./Libraries/Components/Touchable/TouchableWithoutFeedback\\"; +export type { + AccessibilityRole, + AccessibilityState, +} from \\"./Libraries/Components/View/ViewAccessibility\\"; export type { GestureResponderHandlers, TVViewPropsIOS, diff --git a/packages/react-native/index.js.flow b/packages/react-native/index.js.flow index 272ef711193..4da36e8bf07 100644 --- a/packages/react-native/index.js.flow +++ b/packages/react-native/index.js.flow @@ -155,6 +155,10 @@ export {default as TouchableOpacity} from './Libraries/Components/Touchable/Touc export type {TouchableWithoutFeedbackProps} from './Libraries/Components/Touchable/TouchableWithoutFeedback'; export {default as TouchableWithoutFeedback} from './Libraries/Components/Touchable/TouchableWithoutFeedback'; +export type { + AccessibilityRole, + AccessibilityState, +} from './Libraries/Components/View/ViewAccessibility'; export type { GestureResponderHandlers, TVViewPropsIOS,