Utility type to restrict the type of a function's parameter without using extends.
Used to allow a generic parameter to widen to its base type on function call,
while still providing helpful error messages for incompatible typing.
constfoo = newMyClass(42); // ✅ Allowed, T widens to number and foo is MyClass<number> constbar = newMyClass("hello"); // ❌ Error: Expected to receive a number, but got a string instead!
Utility type to restrict the type of a function's parameter without using
extends. Used to allow a generic parameter to widen to its base type on function call, while still providing helpful error messages for incompatible typing.