facebook / facebook/flow

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

Đang mở
#3,018 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
22.3k
Fork
1.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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)).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.