Description
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 library.
The library is called redux-mad-authentication and it can be found here.
It contains a method called configureAuthentication
with the following definition:
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:
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 but get the same results in Nuclide.
Is this a bug that I'm experiencing or is this a feature request?
Activity