Skip to content

Commit

Permalink
update createMatchSelector parameter typing (supasate#432)
Browse files Browse the repository at this point in the history
`path` parameter should match parameter of the underlying `matchPath`

fix supasate#258
  • Loading branch information
zaverden authored Sep 13, 2020
1 parent f10b162 commit 5b7611c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ declare module 'connected-react-router' {
import * as React from 'react';
import { Middleware, Reducer } from 'redux';
import { ReactReduxContextValue } from 'react-redux';
import { match } from 'react-router';
import { match, matchPath } from 'react-router';
import {
Action,
Hash,
Expand All @@ -14,6 +14,8 @@ declare module 'connected-react-router' {
Search
} from 'history';

type PathParam = Parameters<typeof matchPath>[1];

interface ConnectedRouterProps<S = LocationState> {
history: History<S>;
context?: React.Context<ReactReduxContextValue>;
Expand Down Expand Up @@ -73,7 +75,7 @@ declare module 'connected-react-router' {
export function getSearch<S extends RouterRootState>(state: S): Search;
export function createMatchSelector<
S extends RouterRootState, Params extends { [K in keyof Params]?: string }
>(path: string): matchSelectorFn<S, Params>;
>(path: PathParam): matchSelectorFn<S, Params>;
export function onLocationChanged<S = LocationState>(location: Location<S>, action: RouterActionType, isFirstRendering?: boolean)
: LocationChangeAction<S>;

Expand Down

0 comments on commit 5b7611c

Please sign in to comment.