Multiple type signatures for members, Union Types in TypeScript

前端 未结 3 1339
失恋的感觉
失恋的感觉 2020-12-29 19:25

If I have a property that might be a string or a boolean how do I define it:

interface Foo{
    bar:string;
    bar:boolean;
}

I don\'t want

3条回答
提交回复
热议问题