diff --git a/types/redux-first-router/index.d.ts b/types/redux-first-router/index.d.ts index fee6b525e0..278891e10b 100644 --- a/types/redux-first-router/index.d.ts +++ b/types/redux-first-router/index.d.ts @@ -7,6 +7,7 @@ // jscinoz // surgeboris // geirsagberg +// Harry Hedger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -54,7 +55,7 @@ export interface ReceivedAction { type: string; payload: Payload; meta?: object; - query?: object; + query?: Query; search?: string; navKey?: Nullable; } @@ -62,11 +63,11 @@ export interface ReceivedAction { export interface ReceivedActionMeta { type: string; payload: Payload; - query?: object; + query?: Query; navKey?: Nullable; meta: { notFoundPath?: string; - query?: object; + query?: Query; search?: string; }; } @@ -83,7 +84,7 @@ export interface Location { pathname: string; type: string; payload: Payload; - query?: object; + query?: Query; search?: string; } @@ -91,7 +92,7 @@ export interface LocationState { pathname: string; type: string; payload: Payload; - query?: object; + query?: Query; search?: string; prev: Location; kind: Nullable; @@ -122,7 +123,7 @@ export interface Meta { location: ActionMetaLocation; notFoundPath?: string; navigation?: NavigationAction; - query?: object; + query?: Query; search?: string; } @@ -130,7 +131,7 @@ export interface Action { type: string; payload?: Payload; meta?: Meta; - query?: object; + query?: Query; navKey?: Nullable; } @@ -296,8 +297,18 @@ export interface Options { extra?: any; } -export type Params = object; -export type Payload = object; +export interface Query { + [key: string]: string; +} + +export interface Params { + [key: string]: any; +} + +export interface Payload { + query?: Query; + [key: string]: any; +} export type DisplayConfirmLeave = (message: string, callback: (unblock: boolean) => void) => void; diff --git a/types/redux-first-router/redux-first-router-tests.ts b/types/redux-first-router/redux-first-router-tests.ts index 0439f551c7..c3b99fbbdf 100644 --- a/types/redux-first-router/redux-first-router-tests.ts +++ b/types/redux-first-router/redux-first-router-tests.ts @@ -70,7 +70,7 @@ const { reducer, middleware, enhancer, initialDispatch, thunk } = connectRoutes( initialEntries: [], querySerializer: { stringify: queryString => { - queryString; // $ExpectType object + queryString; // $ExpectType Params return ''; }, parse: params => {