Files
DefinitelyTyped/react-router/lib/match.d.ts

24 lines
713 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) => any;
export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): undefined;