Change Animated re-export to generate correct namespace in TS (#50222)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50222

The flow-api-translator will generate

```ts
export * as default from './AnimatedExports';
```

in TS which preserves the namespace. Previous import, export translated to:

```ts
declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof Animated;
declare type $$EXPORT_DEFAULT_DECLARATION$$ =
  typeof $$EXPORT_DEFAULT_DECLARATION$$;
export default $$EXPORT_DEFAULT_DECLARATION$$;
```

which dropped the `Animated` namespace.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D71737199

fbshipit-source-id: a46a7ddddd023fa831cd4bb50f17a0641f328066
This commit is contained in:
Dawid Małecki
2025-03-25 03:47:30 -07:00
committed by Facebook GitHub Bot
parent 9c5cf4e9c4
commit 3bb86b0ecf
2 changed files with 3 additions and 5 deletions
@@ -9,7 +9,5 @@
* @oncall react_native
*/
import * as Animated from './AnimatedExports';
export * as default from './AnimatedExports';
export type {CompositeAnimation, Numeric} from './AnimatedImplementation';
export default Animated;
@@ -118,8 +118,8 @@ declare export default typeof Animated;
`;
exports[`public API should not change unintentionally Libraries/Animated/Animated.js.flow 1`] = `
"export type { CompositeAnimation, Numeric } from \\"./AnimatedImplementation\\";
declare export default typeof Animated;
"export * as default from \\"./AnimatedExports\\";
export type { CompositeAnimation, Numeric } from \\"./AnimatedImplementation\\";
"
`;