TypeScript: is there a way to define a function, which must and only take one out of two as its argument

后端 未结 0 944
逝去的感伤
逝去的感伤 2020-12-13 06:38

for example, I have a function called foo.

Either foo({a: bar}) or foo({b: baz}) is valid but it cannot be foo({})

相关标签:
回答
  • 消灭零回复
提交回复
热议问题