我正在使用flow来创建一个我想要一些类来实现的接口:
// @flow
export default interface Client {
connect(): any;
getFile(): any;
uploadFile(): any;
deleteFile(): any;
end(): any;
};
但是当我运行flow check
时,我收到以下错误:
3: export default interface Client {
^^^^^^^^^ Use of future reserved word in strict mode
我正在关注Flow文档的Interfaces types和Modules types页面,我没有找到解决问题的方法。
我的流量版本是0.49.1。
有没有人有使用接口的解决方案?非常感谢你。
答案 0 :(得分:4)
您似乎无法将其设为默认导出。通过了:
/* @flow */
export interface Client {
connect(): any;
getFile(): any;
uploadFile(): any;
deleteFile(): any;
end(): any;
};
我不确定Flow是否支持将任何类型设为默认导出。我从来没有做过,从来没有觉得有必要尝试。