DefinitelyTyped/react-router/lib/match.d.ts
Dovydas Navickas df4cd9221a Return types updated from undefined to void in react-router and react… (#14743)
* Return types updated from undefined to void in react-router and react-router-redux.

* Author added to definitions.
2017-03-10 16:02:02 -08:00

24 lines
709 B
TypeScript

import { Basename, History, LocationDescriptor } from "history";
import { ParseQueryString, RouteConfig, StringifyQuery } from "react-router";
interface MatchArgs {
routes: RouteConfig;
basename?: Basename;
parseQueryString?: ParseQueryString;
stringifyQuery?: StringifyQuery;
}
interface MatchLocationArgs extends MatchArgs {
location: LocationDescriptor;
history?: History;
}
interface MatchHistoryArgs extends MatchArgs {
location?: LocationDescriptor;
history: History;
}
export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => void;
export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): void;