PickByType
PickByType<T, V> = Pick<T, KeysOfType<T, V>>Source: common.ts:268
Picks properties of T that have values assignable to V
Type Parameters
T— Object typeV— Value type to match
Example
CODE
interface Mixed {
count: number
name: string
active: boolean
score: number
}
type NumberProps = PickByType<Mixed, number>
// { count: number; score: number }