type OneLevelDeep = {
foo: boolean;
bar?: Numeric;
baz: Nullable;
fooBaz: bigint;
bazFoo: string | boolean;
seven: 7;
aNum: number;
};
type A = PickExactlyByType<OneLevelDeep, bigint>,
// A results in:
{
fooBaz: bigint;
},
// Notice how it does not pick up seven
type B = PickExactlyByType<OneLevelDeep, number>,
{
aNum: number;
}
From
T
, pick a set of properties whose type excatly matchesP
.