mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
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.
This commit is contained in:
parent
1636a8e3aa
commit
df4cd9221a
4
react-router-redux/index.d.ts
vendored
4
react-router-redux/index.d.ts
vendored
@ -1,6 +1,6 @@
|
||||
// Type definitions for react-router-redux 4.0
|
||||
// Project: https://github.com/rackt/react-router-redux
|
||||
// Definitions by: Isman Usoh <http://github.com/isman-usoh>, Noah Shipley <https://github.com/noah79>, Dimitri Rosenberg <https://github.com/rosendi>, Karol Janyst <https://github.com/LKay>
|
||||
// Definitions by: Isman Usoh <http://github.com/isman-usoh>, Noah Shipley <https://github.com/noah79>, Dimitri Rosenberg <https://github.com/rosendi>, Karol Janyst <https://github.com/LKay>, Dovydas Navickas <https://github.com/DovydasNavickas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
@ -51,7 +51,7 @@ export interface SyncHistoryWithStoreOptions {
|
||||
}
|
||||
|
||||
export interface HistoryUnsubscribe {
|
||||
unsubscribe(): undefined;
|
||||
unsubscribe(): void;
|
||||
}
|
||||
|
||||
export function routerReducer(state?: RouterState, action?: Action): RouterState;
|
||||
|
||||
4
react-router-redux/v3/index.d.ts
vendored
4
react-router-redux/v3/index.d.ts
vendored
@ -34,8 +34,8 @@ export interface RouteActions {
|
||||
}
|
||||
|
||||
export interface HistoryMiddleware extends Redux.Middleware {
|
||||
listenForReplays(store: Redux.Store<any>, selectLocationState?: Function): undefined;
|
||||
unsubscribe(): undefined;
|
||||
listenForReplays(store: Redux.Store<any>, selectLocationState?: Function): void;
|
||||
unsubscribe(): void;
|
||||
}
|
||||
|
||||
export function routeReducer(state?: any, options?: any): Redux.Reducer<any>;
|
||||
|
||||
1
react-router/index.d.ts
vendored
1
react-router/index.d.ts
vendored
@ -8,6 +8,7 @@
|
||||
// Kostya Esmukov <https://github.com/KostyaEsmukov>
|
||||
// John Reilly <https://github.com/johnnyreilly>
|
||||
// Karol Janyst <https://github.com/LKay>
|
||||
// Dovydas Navickas <https://github.com/DovydasNavickas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
|
||||
4
react-router/lib/IndexRoute.d.ts
vendored
4
react-router/lib/IndexRoute.d.ts
vendored
@ -15,8 +15,8 @@ type ComponentsCallback = (err: any, components: RouteComponents) => any;
|
||||
export interface IndexRouteProps {
|
||||
component?: RouteComponent;
|
||||
components?: RouteComponents;
|
||||
getComponent?(nextState: RouterState, callback: ComponentCallback): undefined;
|
||||
getComponents?(nextState: RouterState, callback: ComponentsCallback): undefined;
|
||||
getComponent?: (nextState: RouterState, callback: ComponentCallback) => void;
|
||||
getComponents?: (nextState: RouterState, callback: ComponentsCallback) => void;
|
||||
onEnter?: EnterHook;
|
||||
onChange?: ChangeHook;
|
||||
onLeave?: LeaveHook;
|
||||
|
||||
8
react-router/lib/Route.d.ts
vendored
8
react-router/lib/Route.d.ts
vendored
@ -20,12 +20,12 @@ declare const Route: Route;
|
||||
|
||||
export default Route;
|
||||
|
||||
type RouteCallback = (err: any, route: PlainRoute) => any;
|
||||
type RoutesCallback = (err: any, routesArray: PlainRoute[]) => any;
|
||||
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): undefined;
|
||||
getChildRoutes?: (partialNextState: LocationState, callback: RoutesCallback) => void;
|
||||
indexRoute?: PlainRoute;
|
||||
getIndexRoute?(partialNextState: LocationState, callback: RouteCallback): undefined;
|
||||
getIndexRoute?: (partialNextState: LocationState, callback: RouteCallback) => void;
|
||||
}
|
||||
|
||||
12
react-router/lib/Router.d.ts
vendored
12
react-router/lib/Router.d.ts
vendored
@ -36,8 +36,8 @@ export type ChangeHook = (prevState: RouterState, nextState: RouterState, replac
|
||||
export type RouteHook = (nextLocation?: Location) => any;
|
||||
|
||||
export interface RedirectFunction {
|
||||
(location: LocationDescriptor): undefined;
|
||||
(state: LocationState, pathname: Pathname | Path, query?: Query): undefined;
|
||||
(location: LocationDescriptor): void;
|
||||
(state: LocationState, pathname: Pathname | Path, query?: Query): void;
|
||||
}
|
||||
|
||||
export interface RouterState {
|
||||
@ -47,11 +47,11 @@ export interface RouterState {
|
||||
components: RouteComponent[];
|
||||
}
|
||||
|
||||
type LocationFunction = (location: LocationDescriptor) => any;
|
||||
type GoFunction = (n: number) => any;
|
||||
type NavigateFunction = () => any;
|
||||
type LocationFunction = (location: LocationDescriptor) => void;
|
||||
type GoFunction = (n: number) => void;
|
||||
type NavigateFunction = () => void;
|
||||
type ActiveFunction = (location: LocationDescriptor, indexOnly?: boolean) => boolean;
|
||||
type LeaveHookFunction = (route: any, callback: RouteHook) => any;
|
||||
type LeaveHookFunction = (route: any, callback: RouteHook) => void;
|
||||
type CreatePartFunction<Part> = (path: Path, query?: any) => Part;
|
||||
|
||||
export interface InjectedRouter {
|
||||
|
||||
4
react-router/lib/match.d.ts
vendored
4
react-router/lib/match.d.ts
vendored
@ -18,6 +18,6 @@ interface MatchHistoryArgs extends MatchArgs {
|
||||
history: History;
|
||||
}
|
||||
|
||||
export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => any;
|
||||
export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => void;
|
||||
|
||||
export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): undefined;
|
||||
export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): void;
|
||||
|
||||
@ -27,7 +27,7 @@ import { createHistory, History } from "history";
|
||||
const routerHistory = useRouterHistory(createHistory)({ basename: "/test" });
|
||||
|
||||
interface CustomHistory {
|
||||
test(): undefined;
|
||||
test(): void;
|
||||
}
|
||||
|
||||
type CombinedHistory = History & CustomHistory;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user