facebook / facebook/flow

Possible to create type declarations for extended methods? (i.e., chai plugins)

未關閉
#3,018 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
22.3k
分支
1.9k
PR 合併指標
30 天內沒有已合併 PR

描述

Does anyone know if it's possible to create flow declarations for chai plugins?

For example, the `chai-as-promised` plugin adds methods like `.rejectedWith(error)` to `chai.expect()`, so you could use it like this:
`expect(myPromise).to.be.rejectedWith('some error message')`

So in this case, I'd be looking to add a definition for `rejectedWith` to the return type of chai's `expect` function (BTW, chai itself does have [flow-typed declarations](https://github.com/flowtype/flow-typed/tree/master/definitions/npm/chai_v3.5.x)).

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。