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.
29 lines
844 B
TypeScript
29 lines
844 B
TypeScript
import { ComponentClass, ClassAttributes } from "react";
|
|
import { LocationState } from "history";
|
|
import {
|
|
EnterHook,
|
|
ChangeHook,
|
|
LeaveHook,
|
|
RouteComponent,
|
|
RouteComponents,
|
|
RouterState
|
|
} from "react-router";
|
|
|
|
type ComponentCallback = (err: any, component: RouteComponent) => any;
|
|
type ComponentsCallback = (err: any, components: RouteComponents) => any;
|
|
|
|
export interface IndexRouteProps {
|
|
component?: RouteComponent;
|
|
components?: RouteComponents;
|
|
getComponent?: (nextState: RouterState, callback: ComponentCallback) => void;
|
|
getComponents?: (nextState: RouterState, callback: ComponentsCallback) => void;
|
|
onEnter?: EnterHook;
|
|
onChange?: ChangeHook;
|
|
onLeave?: LeaveHook;
|
|
}
|
|
|
|
type IndexRoute = ComponentClass<IndexRouteProps>;
|
|
declare const IndexRoute: IndexRoute;
|
|
|
|
export default IndexRoute;
|