facebook / facebook/flow

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

Abierto
#3,339 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
22.3k
Forks
1.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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!

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.