mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50225 Updates `index.js.flow` to export (what should be) all public types for `react-native`, closely matching the resolved exported types of `types/index.d.ts` (current manual TS defs). - Note that this first pass doesn't have to be exhaustive (not yet load bearing) — however, I've done a best-effort scan, which passes our current `__typetests__` fixtures. **Approach: Explicit type imports in `index.js.flow`** We have a number of options for how we organise and re-export values and types from the new index file — for now, we're opting for explicitly exporting each symbol here. - While this clutters the index file somewhat, it also provides a single scannable source of truth — without introducing / altering each contributing module's type exports (we might want to do this eventually, but we're far from having strong organisation denoting the public API boundary). It's self-documenting that the index file contains all root exports by name. - At the same time, we currently have some exceptions that use `export [type] *` to line up with TypeScript `namespace`s. We aim to review and update these within this release cycle, to enforce the above system. Changelog: [Internal] - The `react-native` package now exports all public types in Flow (fbsource) Reviewed By: rubennorte Differential Revision: D71741575 fbshipit-source-id: 770e2b490e494ee195f4240358fec39f69145a94
26 lines
666 B
JavaScript
26 lines
666 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import VirtualizedLists from '@react-native/virtualized-lists';
|
|
|
|
type VirtualizedSectionListType =
|
|
typeof VirtualizedLists.VirtualizedSectionList;
|
|
const VirtualizedSectionList: VirtualizedSectionListType =
|
|
VirtualizedLists.VirtualizedSectionList;
|
|
|
|
export type {
|
|
SectionBase,
|
|
ScrollToLocationParamsType,
|
|
VirtualizedSectionListProps,
|
|
} from '@react-native/virtualized-lists';
|
|
export default VirtualizedSectionList;
|