DefinitelyTyped/react-router/lib/Route.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

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;
}