Open braebo opened 11 months ago
Interesting. Do you know how it works? It looks a bit cryptic and I still can't understand why it works as intended.
Yea it's a weird one!
You can read more about it in these stack overflow posts:
https://stackoverflow.com/a/61048124 https://stackoverflow.com/a/75265010
Right now, the
view
option is typed asstring
, which provides no autocomplete:I think a union of string literals would be awesome to have here. This would make it easy to see what the available views are without having to surf the docs every time.
If it was instead typed like this:
The
({} & string)
would allow any string value, but the type would preserve the intellisense for autocomplete!I think this could also be used to infer the type of the binding returned using conditional types internally... but that is another issue altogether 😇