-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TS types for Codegen #46484
Add TS types for Codegen #46484
Conversation
This pull request was exported from Phabricator. Differential Revision: D62644516 |
export type Double = number; | ||
export type Float = number; | ||
export type Int32 = number; | ||
export type UnsafeObject = any; // Object is forbidden in strict mode | ||
export type UnsafeMixed = any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same thing as here?
declare module 'react-native/Libraries/Types/CodegenTypes' { |
export type UnsafeObject = any; // Object is forbidden in strict mode | ||
export type UnsafeMixed = any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this has already been discussed, but I think it's preferable to use unknown
instead of any
here. unknown
will create a type error unless the consumer verifies the type of the value before using it. any
will not notify the user that the type is unsafe.
Consumers can cast the value as any
in their own code if they'd prefer to not verify the type.
Summary: Pull Request resolved: facebook#46484 We recently realized that we don't have TS types for Codegen. These are needed to let our users use these types when writing Specs in TS ## Changelog [General][Added] - Add CodegenTypes for TS Reviewed By: christophpurrer Differential Revision: D62644516
This pull request was exported from Phabricator. Differential Revision: D62644516 |
68e0bdc
to
6a18d37
Compare
This pull request has been merged in 20b1415. |
This pull request was successfully merged by @cipolleschi in 20b1415 When will my fix make it into a release? | How to file a pick request? |
Summary: Pull Request resolved: #46484 We recently realized that we don't have TS types for Codegen. These are needed to let our users use these types when writing Specs in TS ## Changelog [General][Added] - Add CodegenTypes for TS Reviewed By: christophpurrer Differential Revision: D62644516 fbshipit-source-id: 92bb7e8998d31806f6eb63319fb6d406fcd65ad8
Summary:
We recently realized that we don't have TS types for Codegen.
These are needed to let our users use these types when writing Specs in TS
Changelog
[General][Added] - Add CodegenTypes for TS
Differential Revision: D62644516