Improve types, fix translator compatibility for version-related modules (#42638)

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

Enables these modules to be covered by `public-api-test`.

- Standardise as CommonJS modules, fixing compatibility with [`flow-api-translator`](https://www.npmjs.com/package/flow-api-translator).
- Use explicit object type in generated file template.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D52963967

fbshipit-source-id: c9f3e35f70859c1b99b7297228ee2498f91d9041
This commit is contained in:
Alex Hunt
2024-01-25 02:32:00 -08:00
committed by Facebook GitHub Bot
parent 0ea16fd3f7
commit 02e7244b3d
5 changed files with 37 additions and 6 deletions
@@ -9,9 +9,16 @@
* @flow strict
*/
exports.version = {
const version: $ReadOnly<{
major: number,
minor: number,
patch: number,
prerelease: string | null,
}> = {
major: ${major},
minor: ${minor},
patch: ${patch},
prerelease: ${prerelease},
};
module.exports = {version};