This is now an issue at #17678, if you're here you should probably be there.
I'll probably put this up as a TS issue at some point, but I've been spamming them a bit over the last few days and I'm trying to play it cool.
This arrogantly assumes the implementation of #17636.
Given some type Foo
, construct a new type Bar
with a subset of the members of Foo
, where that subset is determined by a type predicate. Both the key and type of the member should be available to the predicate. Type predicates should have the full power of the type system.
This is analgous to Array.prototype.filter
, where the index and item value are available to the predicate.