facebook / facebook/flow

How to properly reference flow-typed in custom type declarations?

Open
#3,339 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Let's say I use `bunyan` npm package and there is `flow-typed` for it already (https://github.com/flowtype/flow-typed/blob/master/definitions/npm/bunyan_v1.x.x/flow_v0.21.x-/bunyan_v1.x.x.js).

What I'm trying to achieve now is this:

```
declare class Context {
userId: string;
logger: bunyan.Logger;
};
```

And `flow` is failing with the following error:

```
type-annotation `bunyan`. Could not resolve name
```

I'm not quite sure what's going on and how to make it happy. Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.