Autocomplete results incomplete when including from library.
- Lingua principale
- Rust
- Stelle
- 22.3k
- Fork
- 1.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I have a project which is built using flow and exports the flowtypes via .js.flow files.
The .js.flow files are generated through the [flow-copy-source](https://github.com/AgentME/flow-copy-source) library.
The library is called redux-mad-authentication and it can be found [here](https://github.com/42BV/redux-mad-authentication).
It contains a method called `configureAuthentication` with the following definition:
```js
export type Config = {
handshakeUrl: string,
authenticationUrl: string,
currentUserUrl: string,
loginRoute: string,
dispatch: (Action) => void,
authenticationStore: () => AuthenticationStore
};
let config: Config | null = null;
export function configureAuthentication(c: Config) {
config = c;
}
```
As you can see the argument to `configureAuthentication` is of type Config. When using the library (through npm) it seems to forget this type.
For example:

Note how it says that the argument 'c' is of type `any`.
I've also noticed some strange behaviour when exporting a type twice, for example this is part of the index.js file from the library:
```js
export { configureAuthentication } from './config.js';
export type { Config } from './config.js';
```
It simply re-exports a type definition from the 'config.js' file.
Now notice the autocomplete when using it from the 'index':

Versus using the same function from 'redux-mad-authentication/lib/config':

Note: I'm using vscode in the images with the [Flow Langue Support extension](https://github.com/flowtype/flow-for-vscode) but get the same results in Nuclide.
Is this a bug that I'm experiencing or is this a feature request?
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.