facebook / facebook/flow

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

Offen
#3,339 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
22.3k
Forks
1.9k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.