Skip to content

Commit

Permalink
Add query type definition for RouterState.location #381 (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomIsion committed Apr 5, 2020
1 parent fc4580d commit 1746034
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ declare module 'connected-react-router' {

export type RouterActionType = Action;

export interface RouterLocation<S> extends Location<S> {
query: Record<string, string>
}

export interface RouterState<S = LocationState> {
location: Location<S>
location: RouterLocation<S>
action: RouterActionType
}

Expand Down Expand Up @@ -64,7 +68,7 @@ declare module 'connected-react-router' {
export function getRouter<S extends RouterRootState<LS>, LS = LocationState>(state: S): RouterState<LS>;
export function getAction<S extends RouterRootState>(state: S): RouterActionType;
export function getHash<S extends RouterRootState>(state: S): Hash;
export function getLocation<S extends RouterRootState<LS>, LS = LocationState>(state: S): Location<LS>;
export function getLocation<S extends RouterRootState<LS>, LS = LocationState>(state: S): RouterLocation<LS>;
export function getSearch<S extends RouterRootState>(state: S): Search;
export function createMatchSelector<
S extends RouterRootState, Params extends { [K in keyof Params]?: string }
Expand Down

0 comments on commit 1746034

Please sign in to comment.