diff --git a/packages/react-native/scripts/featureflags/types.js b/packages/react-native/scripts/featureflags/types.js index 1e328087159714..9316c9487f4e72 100644 --- a/packages/react-native/scripts/featureflags/types.js +++ b/packages/react-native/scripts/featureflags/types.js @@ -10,30 +10,30 @@ export type FeatureFlagValue = boolean | number | string; -export type FeatureFlagDefinitions = { +export type FeatureFlagDefinitions = $ReadOnly<{ common: CommonFeatureFlagList, jsOnly: JsOnlyFeatureFlagList, -}; +}>; -type CommonFeatureFlagList = { - [flagName: string]: { +export type CommonFeatureFlagList = $ReadOnly<{ + [flagName: string]: $ReadOnly<{ defaultValue: FeatureFlagValue, metadata: FeatureFlagMetadata, // Indicates if this API should only be defined in JavaScript, only to // preserve backwards compatibility with existing native code temporarily. skipNativeAPI?: true, - }, -}; + }>, +}>; -type JsOnlyFeatureFlagList = { - [flagName: string]: { +export type JsOnlyFeatureFlagList = $ReadOnly<{ + [flagName: string]: $ReadOnly<{ defaultValue: FeatureFlagValue, metadata: FeatureFlagMetadata, - }, -}; + }>, +}>; -type FeatureFlagMetadata = - | { +export type FeatureFlagMetadata = + | $ReadOnly<{ purpose: 'experimentation', /** * Aproximate date when the flag was added. @@ -41,25 +41,25 @@ type FeatureFlagMetadata = */ dateAdded: string, description: string, - } - | { + }> + | $ReadOnly<{ purpose: 'operational' | 'release', description: string, - }; + }>; -export type GeneratorConfig = { +export type GeneratorConfig = $ReadOnly<{ featureFlagDefinitions: FeatureFlagDefinitions, jsPath: string, commonCxxPath: string, commonNativeModuleCxxPath: string, androidPath: string, androidJniPath: string, -}; +}>; -export type GeneratorOptions = { +export type GeneratorOptions = $ReadOnly<{ verifyUnchanged: boolean, -}; +}>; -export type GeneratorResult = { +export type GeneratorResult = $ReadOnly<{ [path: string]: string /* content */, -}; +}>;