diff --git a/.flowconfig b/.flowconfig index e18ea6b43..bebde8927 100644 --- a/.flowconfig +++ b/.flowconfig @@ -33,4 +33,4 @@ untyped-import untyped-type-import [version] -^0.91.0 +^0.98.1 diff --git a/flow-typed/npm/express_v4.x.x.js b/flow-typed/npm/express_v4.x.x.js index 01b9e9520..6439d8944 100644 --- a/flow-typed/npm/express_v4.x.x.js +++ b/flow-typed/npm/express_v4.x.x.js @@ -1,7 +1,4 @@ -// flow-typed signature: 45384ed25d019e0595020cc30e78b80f -// flow-typed version: d11eab7bb5/express_v4.x.x/flow_>=v0.32.x - -import type { Server } from 'http'; +import * as http from 'http'; import type { Socket } from 'net'; declare type express$RouterOptions = { @@ -104,8 +101,10 @@ declare class express$Response extends http$ServerResponse mixins express$Reques declare type express$NextFunction = (err?: ?Error | 'route') => mixed; declare type express$Middleware = - ((req: express$Request, res: express$Response, next: express$NextFunction) => mixed) | - ((error: Error, req: express$Request, res: express$Response, next: express$NextFunction) => mixed); + // $FlowFixMe: $SubType is deprecated; waiting for upstream to fix this. + ((req: $Subtype, res: express$Response, next: express$NextFunction) => mixed) | + // $FlowFixMe: $SubType is deprecated; waiting for upstream to fix this. + ((error: Error, req: $Subtype, res: express$Response, next: express$NextFunction) => mixed); declare interface express$RouteMethodType { (middleware: express$Middleware): T; (...middleware: Array): T; @@ -151,28 +150,29 @@ declare class express$Router extends express$Route { use(...middleware: Array): this; use(path: express$Path|express$Path[], ...middleware: Array): this; use(path: string, router: express$Router): this; - handle(req: http$IncomingMessage, res: http$ServerResponse, next: express$NextFunction): void; + handle(req: http$IncomingMessage<>, res: http$ServerResponse, next: express$NextFunction): void; param( param: string, callback: ( - req: express$Request, + // $FlowFixMe: $SubType is deprecated; waiting for upstream to fix this. + req: $Subtype, res: express$Response, next: express$NextFunction, id: string ) => mixed ): void; - (req: http$IncomingMessage, res: http$ServerResponse, next?: ?express$NextFunction): void; + (req: http$IncomingMessage<>, res: http$ServerResponse, next?: ?express$NextFunction): void; } declare class express$Application extends express$Router mixins events$EventEmitter { constructor(): void; locals: {[name: string]: mixed}; mountpath: string; - listen(port: number, hostname?: string, backlog?: number, callback?: (err?: ?Error) => mixed): ?Server; - listen(port: number, hostname?: string, callback?: (err?: ?Error) => mixed): ?Server; - listen(port: number, callback?: (err?: ?Error) => mixed): ?Server; - listen(path: string, callback?: (err?: ?Error) => mixed): ?Server; - listen(handle: Object, callback?: (err?: ?Error) => mixed): ?Server; + listen(port: number, hostname?: string, backlog?: number, callback?: (err?: ?Error) => mixed): ?http.Server; + listen(port: number, hostname?: string, callback?: (err?: ?Error) => mixed): ?http.Server; + listen(port: number, callback?: (err?: ?Error) => mixed): ?http.Server; + listen(path: string, callback?: (err?: ?Error) => mixed): ?http.Server; + listen(handle: Object, callback?: (err?: ?Error) => mixed): ?http.Server; disable(name: string): void; disabled(name: string): boolean; enable(name: string): express$Application; @@ -184,9 +184,9 @@ declare class express$Application extends express$Router mixins events$EventEmit // get(name: string): mixed; set(name: string, value: mixed): mixed; render(name: string, optionsOrFunction: {[name: string]: mixed}, callback: express$RenderCallback): void; - handle(req: http$IncomingMessage, res: http$ServerResponse, next?: ?express$NextFunction): void; + handle(req: http$IncomingMessage<>, res: http$ServerResponse, next?: ?express$NextFunction): void; // callable signature is not inherited - (req: http$IncomingMessage, res: http$ServerResponse, next?: ?express$NextFunction): void; + (req: http$IncomingMessage<>, res: http$ServerResponse, next?: ?express$NextFunction): void; } declare module 'express' { diff --git a/flow-typed/npm/redux_v4.x.x.js b/flow-typed/npm/redux_v4.x.x.js index d7a909d56..269b4e00c 100644 --- a/flow-typed/npm/redux_v4.x.x.js +++ b/flow-typed/npm/redux_v4.x.x.js @@ -1,8 +1,4 @@ -// flow-typed signature: df80bdd535bfed9cf3223e077f3b4543 -// flow-typed version: c4c8963c9c/redux_v4.x.x/flow_>=v0.55.x - declare module 'redux' { - /* S = State @@ -11,49 +7,91 @@ declare module 'redux' { */ + declare export type Action = { + type: T + } + declare export type DispatchAPI = (action: A) => A; - declare export type Dispatch }> = DispatchAPI; + + declare export type Dispatch = DispatchAPI; declare export type MiddlewareAPI> = { - dispatch: D; - getState(): S; + dispatch: D, + getState(): S, }; declare export type Store> = { // rewrite MiddlewareAPI members in order to get nicer error messages (intersections produce long messages) - dispatch: D; - getState(): S; - subscribe(listener: () => void): () => void; - replaceReducer(nextReducer: Reducer): void + dispatch: D, + getState(): S, + subscribe(listener: () => void): () => void, + replaceReducer(nextReducer: Reducer): void, }; declare export type Reducer = (state: S | void, action: A) => S; - declare export type CombinedReducer = (state: $Shape & {} | void, action: A) => S; + declare export type CombinedReducer = ( + state: ($Shape & {}) | void, + action: A + ) => S; - declare export type Middleware> = - (api: MiddlewareAPI) => - (next: D) => D; + declare export type Middleware> = ( + api: MiddlewareAPI + ) => (next: D) => D; declare export type StoreCreator> = { - (reducer: Reducer, enhancer?: StoreEnhancer): Store; - (reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; + (reducer: Reducer, enhancer?: StoreEnhancer): Store, + ( + reducer: Reducer, + preloadedState: S, + enhancer?: StoreEnhancer + ): Store, }; - declare export type StoreEnhancer> = (next: StoreCreator) => StoreCreator; + declare export type StoreEnhancer> = ( + next: StoreCreator + ) => StoreCreator; - declare export function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store; - declare export function createStore(reducer: Reducer, preloadedState?: S, enhancer?: StoreEnhancer): Store; + declare export function createStore( + reducer: Reducer, + enhancer?: StoreEnhancer + ): Store; + declare export function createStore( + reducer: Reducer, + preloadedState?: S, + enhancer?: StoreEnhancer + ): Store; - declare export function applyMiddleware(...middlewares: Array>): StoreEnhancer; + declare export function applyMiddleware( + ...middlewares: Array> + ): StoreEnhancer; declare export type ActionCreator = (...args: Array) => A; - declare export type ActionCreators = { [key: K]: ActionCreator }; + declare export type ActionCreators = { + [key: K]: ActionCreator, + }; - declare export function bindActionCreators, D: DispatchAPI>(actionCreator: C, dispatch: D): C; - declare export function bindActionCreators, D: DispatchAPI>(actionCreators: C, dispatch: D): C; + declare export function bindActionCreators< + A, + C: ActionCreator, + D: DispatchAPI + >( + actionCreator: C, + dispatch: D + ): C; + declare export function bindActionCreators< + A, + K, + C: ActionCreators, + D: DispatchAPI + >( + actionCreators: C, + dispatch: D + ): C; - declare export function combineReducers(reducers: O): CombinedReducer<$ObjMap(r: Reducer) => S>, A>; + declare export function combineReducers( + reducers: O + ): CombinedReducer<$ObjMap(r: Reducer) => S>, A>; declare export var compose: $Compose; } diff --git a/package.json b/package.json index 0ee0452cd..b005a8772 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.5.1", "eslint-plugin-relay": "^1.0.0", - "flow-bin": "^0.91.0", + "flow-bin": "^0.98.1", "glob": "^7.1.2", "jest": "^24.7.1", "jest-fetch-mock": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index 01d4c589d..a5821f69d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3417,10 +3417,10 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.91.0: - version "0.91.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.91.0.tgz#f5c89729f74b2ccbd47df6fbfadbdcc89cc1e478" - integrity sha512-j+L+xNiUYnZZ27MjVI0y2c9474ZHOvdSQq0Tjwh56mEA7tfxYqp5Dcb6aZSwvs3tGMTjCrZow9aUlZf3OoRyDQ== +flow-bin@^0.98.1: + version "0.98.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.98.1.tgz#a8d781621c91703df69928acc83c9777e2fcbb49" + integrity sha512-y1YzQgbFUX4EG6h2EO8PhyJeS0VxNgER8XsTwU8IXw4KozfneSmGVgw8y3TwAOza7rVhTlHEoli1xNuNW1rhPw== flow-parser@0.*: version "0.96.1"