Skip to content

Commit e8b55a4

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Add flowTypes for codegen LIBRARY_GENERATORS (facebook#51987)
Summary: Pull Request resolved: facebook#51987 In this diff I'm adding flowTypes for codegen LIBRARY_GENERATORS changelog: [internal] internal Reviewed By: huntie Differential Revision: D76470808 fbshipit-source-id: 8e2bddeda1f9175fd25fee04f8fdd3cb7c7faa49
1 parent 70962ef commit e8b55a4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/react-native-codegen/src/generators/RNCodegen.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ const ALL_GENERATORS = {
7373
generateViewConfigJs: generateViewConfigJs.generate,
7474
};
7575

76+
type FilesOutput = Map<string, string>;
77+
78+
type GenerateFunction = (
79+
libraryName: string,
80+
schema: SchemaType,
81+
packageName?: string,
82+
assumeNonnull: boolean,
83+
headerPrefix?: string,
84+
) => FilesOutput;
85+
86+
type LibraryGeneratorsFunctions = $ReadOnly<{
87+
[string]: Array<GenerateFunction>,
88+
}>;
89+
7690
type LibraryOptions = $ReadOnly<{
7791
libraryName: string,
7892
schema: SchemaType,
@@ -113,7 +127,7 @@ type SchemasConfig = $ReadOnly<{
113127
test?: boolean,
114128
}>;
115129

116-
const LIBRARY_GENERATORS = {
130+
const LIBRARY_GENERATORS: LibraryGeneratorsFunctions = {
117131
descriptors: [
118132
generateComponentDescriptorCpp.generate,
119133
generateComponentDescriptorH.generate,

0 commit comments

Comments
 (0)