diff --git a/react-router-redux/index.d.ts b/react-router-redux/index.d.ts index 98a0b6d00e..0736359b21 100644 --- a/react-router-redux/index.d.ts +++ b/react-router-redux/index.d.ts @@ -51,7 +51,7 @@ export interface SyncHistoryWithStoreOptions { } export interface HistoryUnsubscribe { - unsubscribe(): void; + unsubscribe(): undefined; } export function routerReducer(state?: RouterState, action?: Action): RouterState; diff --git a/react-router-redux/v3/index.d.ts b/react-router-redux/v3/index.d.ts index 105d081f30..70c43a0171 100644 --- a/react-router-redux/v3/index.d.ts +++ b/react-router-redux/v3/index.d.ts @@ -19,11 +19,11 @@ export const goForward: GoBackAction; export const routeActions: RouteActions; export type LocationDescriptor = History.LocationDescriptor; -export type PushAction = (nextLocation: LocationDescriptor) => void; -export type ReplaceAction = (nextLocation: LocationDescriptor) => void; -export type GoAction = (n: number) => void; -export type GoForwardAction = () => void; -export type GoBackAction = () => void; +export type PushAction = (nextLocation: LocationDescriptor) => undefined; +export type ReplaceAction = (nextLocation: LocationDescriptor) => undefined; +export type GoAction = (n: number) => undefined; +export type GoForwardAction = () => undefined; +export type GoBackAction = () => undefined; export interface RouteActions { push: PushAction; @@ -34,11 +34,9 @@ export interface RouteActions { } export interface HistoryMiddleware extends Redux.Middleware { - listenForReplays(store: Redux.Store, selectLocationState?: Function): void; - unsubscribe(): void; + listenForReplays(store: Redux.Store, selectLocationState?: Function): undefined; + unsubscribe(): undefined; } export function routeReducer(state?: any, options?: any): Redux.Reducer; export function syncHistory(history: History.History): HistoryMiddleware; - - diff --git a/react-router/lib/IndexRoute.d.ts b/react-router/lib/IndexRoute.d.ts index b0574df26a..59390dffbf 100644 --- a/react-router/lib/IndexRoute.d.ts +++ b/react-router/lib/IndexRoute.d.ts @@ -9,14 +9,14 @@ import { RouterState } from "react-router"; -type ComponentCallback = (err: any, component: RouteComponent) => void; -type ComponentsCallback = (err: any, components: RouteComponents) => void; +type ComponentCallback = (err: any, component: RouteComponent) => undefined; +type ComponentsCallback = (err: any, components: RouteComponents) => undefined; export interface IndexRouteProps { component?: RouteComponent; components?: RouteComponents; - getComponent?(nextState: RouterState, callback: ComponentCallback): void; - getComponents?(nextState: RouterState, callback: ComponentsCallback): void; + getComponent?(nextState: RouterState, callback: ComponentCallback): undefined; + getComponents?(nextState: RouterState, callback: ComponentsCallback): undefined; onEnter?: EnterHook; onChange?: ChangeHook; onLeave?: LeaveHook; diff --git a/react-router/lib/Route.d.ts b/react-router/lib/Route.d.ts index 15aafebc75..7ff834cbf8 100644 --- a/react-router/lib/Route.d.ts +++ b/react-router/lib/Route.d.ts @@ -20,12 +20,12 @@ declare const Route: Route; export default Route; -type RouteCallback = (err: any, route: PlainRoute) => void; -type RoutesCallback = (err: any, routesArray: PlainRoute[]) => void; +type RouteCallback = (err: any, route: PlainRoute) => undefined; +type RoutesCallback = (err: any, routesArray: PlainRoute[]) => undefined; export interface PlainRoute extends RouteProps { childRoutes?: PlainRoute[]; - getChildRoutes?(partialNextState: LocationState, callback: RoutesCallback): void; + getChildRoutes?(partialNextState: LocationState, callback: RoutesCallback): undefined; indexRoute?: PlainRoute; - getIndexRoute?(partialNextState: LocationState, callback: RouteCallback): void; + getIndexRoute?(partialNextState: LocationState, callback: RouteCallback): undefined; } diff --git a/react-router/lib/Router.d.ts b/react-router/lib/Router.d.ts index 02550026b9..33979d9c87 100644 --- a/react-router/lib/Router.d.ts +++ b/react-router/lib/Router.d.ts @@ -36,8 +36,8 @@ export type ChangeHook = (prevState: RouterState, nextState: RouterState, replac export type RouteHook = (nextLocation?: Location) => any; export interface RedirectFunction { - (location: LocationDescriptor): void; - (state: LocationState, pathname: Pathname | Path, query?: Query): void; + (location: LocationDescriptor): undefined; + (state: LocationState, pathname: Pathname | Path, query?: Query): undefined; } export interface RouterState { @@ -47,11 +47,11 @@ export interface RouterState { components: RouteComponent[]; } -type LocationFunction = (location: LocationDescriptor) => void; -type GoFunction = (n: number) => void; -type NavigateFunction = () => void; +type LocationFunction = (location: LocationDescriptor) => undefined; +type GoFunction = (n: number) => undefined; +type NavigateFunction = () => undefined; type ActiveFunction = (location: LocationDescriptor, indexOnly?: boolean) => boolean; -type LeaveHookFunction = (route: any, callback: RouteHook) => void; +type LeaveHookFunction = (route: any, callback: RouteHook) => undefined; type CreatePartFunction = (path: Path, query?: any) => Part; export interface InjectedRouter { diff --git a/react-router/lib/match.d.ts b/react-router/lib/match.d.ts index e9fd936ad9..48cec07676 100644 --- a/react-router/lib/match.d.ts +++ b/react-router/lib/match.d.ts @@ -18,7 +18,6 @@ interface MatchHistoryArgs extends MatchArgs { history: History; } -export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => void; - -export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): void; +export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => undefined; +export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): undefined;