Constructor overload in TypeScript
TypeScript allows you to declare overloads but you can only have one implementation and that implementation must have a signature that is compatible with all overloads. In your example, this can easily be done with an optional parameter as in, or two overloads with a more general constructor as in, See in Playground