【发布时间】:2017-08-26 23:13:25
【问题描述】:
从流程文档中我们得到:
// @flow
const countries = {
US: "United States",
IT: "Italy",
FR: "France"
};
type Country = $Keys<typeof countries>;
const italy: Country = 'IT';
const nope: Country = 'nope'; // 'nope' is not a Country
我想怎么做
type CountryValue = $Values<typeof countries>
const italy: CountryValue = 'Italy'; // yes
这可能吗?
【问题讨论】:
标签: flowtype