You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mkscrgO & { [K]: V }should work, but right now K is always string, even if you pass a string literal to setProp, so it becomes O & { [string: V } which is not very useful 😿
Flow understands when a new key is added to an object:
But (AFAIK) it's impossible to write a well-typed generic function for setting a key. It might work if we exposed a
$SetKey
utility:Thoughts? Am I missing something, and this is actually possible today?
Background
I'd like to define types for a binary parsing library with syntax like
But this requires using string literals as keys in object types, e.g.
The text was updated successfully, but these errors were encountered: