【发布时间】:2015-12-14 15:36:22
【问题描述】:
希望这可能会产生编译时错误,但我想我只是误解了枚举的工作原理......
enum SortDirection {
ascending = 1,
descending = -1
}
type IndexSpec = {[index: string]: SortDirection};
var i: IndexSpec = {thing: 3}; // no compile time error
【问题讨论】:
标签: enums typescript