Нет способа получить тип и ограничения напрямую.Вы можете получить ограничение универсального типа, а также распечатать тип ограничения и, соединяя его с ключевым словом extends
, получите то, что вы хотите.
const type = checker.getTypeAtLocation( paramNode );
let constraintType = type.getConstraint();
if(constraintType == null) continue;
let genericType = checker.typeToString(type); // T
let genericConstraintType = checker.typeToString(constraintType); // Item
console.log(`${genericType} extends ${genericConstraintType}`); // put it together manually