TypeScript function overload prevent parameter declaration any

后端 未结 0 1231
function add(x: string, y: string): string
function add(x: number, y: number): number
// How to prevent any as user can cast x or y as any
function add(x: any, y: any):          


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