0
有沒有辦法使用Flow擴展/添加到現有的聲明?將插件方法添加到Flow中的Moment.js聲明中?
具體而言,在這種情況下,我們同時使用了Moment.js和a plugin that adds a format method to the Duration object。
我在FlowInterfaces中找到third-party type declaration for momentjs,但(自然地)它沒有插件提供的額外方法。
目前解決這個我已經重複與新方法的添加行的所有申報文件,但最好有會是更新現有的聲明,就像一個辦法:
type moment$MomentOptions += {
format(format: ?string): string; // moment-duration-format
}
。 ..但更好的語法:)
所以我的問題是這樣的事情存在的流?