Add intersection types in react-native-codegen for TypeScript#35247
Add intersection types in react-native-codegen for TypeScript#35247ZihanChen-MSFT wants to merge 11 commits into
Conversation
Base commit: cf37479 |
Base commit: cf37479 |
|
PR build artifact for df4d3db is ready. |
|
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for doing this, it will help many people with the New aArchitecture writing better specs! I left two comments to improve the readability of the code.
|
PR build artifact for e897f9c is ready. |
|
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
Refer to "Support intersection of object types,
{...a, ...b, ...}in Flow is equivalent toa & b & {...}in TypeScript, the order and the form is not important." in #34872In this change I also extract the common part from
getTypeAnnotationandgetTypeAnnotationForArrayintogetCommonTypeAnnotation. Most of the differences are aboutdefaultin the schema. After a schema is generated fromgetCommonTypeAnnotationsuccessfully,getTypeAnnotationwill filldefaultif necessary, whilegetTypeAnnotationForArraydoes nothing.Changelog
[General] [Changed] - Add intersection types in react-native-codegen for TypeScript
Test Plan
yarn jest react-native-codegenpassed