【发布时间】:2017-01-31 22:37:23
【问题描述】:
我有以下对象声明:
type QueryQuantifierType = {
+max?: number,
+min?: number,
+multiple?: boolean
};
它允许:
{
min: 1
}
{
max: 1
}
{
max: 1,
min: 1
}
{
min: 1,
multiple: true
}
{
max: 1,
multiple: true
}
这些是有效值。
但是,问题是它也是permits an empty object。
如何为必须具有至少一个属性的对象定义 Flow 类型?
【问题讨论】:
标签: javascript flowtype