4 ms·Typescript have solutions for both of those problems: conditional types and genericsby shepherdjerred 2y agoTypescript have solutions for both of those problems: conditional types and generics