-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Map / indexed object support for TypeScript parser (#35098)
Summary: Pull Request resolved: #35098 Changelog: [General][Fixed] [react-native-codegen] react-native-codegen : Add Map / indexed object support for TypeScript parser In flow we can expose Maps via the following syntax in TM specs ` +getMap: (arg: {[key: string]: ?number}) => {[key: string]: ?number}; ` In TypeScript writing the same spec: ` readonly getMap: (arg: { [key: string]: number | null; }) => { [key: string]: number | null; }; ` leads to an exception the TypeScript code-gen parser ```UnsupportedObjectPropertyTypeAnnotationParserError: Module NativeTurboModuleCxx: 'ObjectTypeAnnotation' cannot contain 'TSIndexSignature'. at react-native-github/packages/react-native-codegen/src/parsers/typescript/modules/index.js:309:23``` ``` This change fixes the TypeScript parser Reviewed By: cipolleschi Differential Revision: D40753368 fbshipit-source-id: 0eef8ecb63d1ed049fde1e75cc6f2ec627f1f232
- Loading branch information
1 parent
87d6580
commit 87c356d
Showing
7 changed files
with
215 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters