Say I have a type
type Transaction = { kind: 'income', customer: string } | { kind: 'expense', vendor: string };
and I need to narrow it down to just the income kind or the expense kind.
type NarrowDown<Type, Key, Value> = /* ??? implementation */
type IncomeTransaction = NarrowDown<Transaction, 'kind', 'income'> // { kind: 'income', customer: string }
is this possible?