mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Return types updated from undefined to void in react-router and react-router-redux. * Author added to definitions.
32 lines
910 B
TypeScript
32 lines
910 B
TypeScript
import { ComponentClass, ClassAttributes } from "react";
|
|
import { LocationState } from "history";
|
|
import {
|
|
EnterHook,
|
|
ChangeHook,
|
|
LeaveHook,
|
|
RouteComponent,
|
|
RouteComponents,
|
|
RoutePattern,
|
|
RouterState
|
|
} from "react-router";
|
|
import { IndexRouteProps } from "react-router/lib/IndexRoute";
|
|
|
|
export interface RouteProps extends IndexRouteProps {
|
|
path?: RoutePattern;
|
|
}
|
|
|
|
type Route = ComponentClass<RouteProps>;
|
|
declare const Route: Route;
|
|
|
|
export default Route;
|
|
|
|
type RouteCallback = (err: any, route: PlainRoute) => void;
|
|
type RoutesCallback = (err: any, routesArray: PlainRoute[]) => void;
|
|
|
|
export interface PlainRoute extends RouteProps {
|
|
childRoutes?: PlainRoute[];
|
|
getChildRoutes?: (partialNextState: LocationState, callback: RoutesCallback) => void;
|
|
indexRoute?: PlainRoute;
|
|
getIndexRoute?: (partialNextState: LocationState, callback: RouteCallback) => void;
|
|
}
|