我有以下函数调用:
this.get('barcode').scan();
是否可以通过函数参数的值确定返回类型的方式来定义get函数.在我的情况下,'get'返回Barcode类,如果使用'barcode'调用,则返回Mqtt类,如果使用'mqtt'调用.
typescript
typescript ×1