Open markusenglund opened 3 months ago
We generally prefer using type
instead of interface
as types are more flexible. I don't think this is an issue with our SDK though.
Your preferences might not be shared by the consumers of your library. In the project I'm working on, we need to use a class as the type of the metadata due to the framework we're using. Type-casting to appease the ts compiler is totally fine for us, I'm just letting you know that this is an annoyance.
Fair enough. We will see what we can do about this if more people face this same issue.
The following code causes this ts error:
Argument of type 'UserMeta' is not assignable to parameter of type 'JSONObject'. Index signature for type 'string' is missing in type 'UserMeta'
Switching from interface to a type works ok:
I haven't made the effort to figure out why, but if seems like incorrect behavior.