mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-09 13:48:41 +08:00
Replace void with undefined type
This commit is contained in:
2
react-router-redux/index.d.ts
vendored
2
react-router-redux/index.d.ts
vendored
@@ -51,7 +51,7 @@ export interface SyncHistoryWithStoreOptions {
|
||||
}
|
||||
|
||||
export interface HistoryUnsubscribe {
|
||||
unsubscribe(): void;
|
||||
unsubscribe(): undefined;
|
||||
}
|
||||
|
||||
export function routerReducer(state?: RouterState, action?: Action): RouterState;
|
||||
|
||||
16
react-router-redux/v3/index.d.ts
vendored
16
react-router-redux/v3/index.d.ts
vendored
@@ -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<any>, selectLocationState?: Function): void;
|
||||
unsubscribe(): void;
|
||||
listenForReplays(store: Redux.Store<any>, selectLocationState?: Function): undefined;
|
||||
unsubscribe(): undefined;
|
||||
}
|
||||
|
||||
export function routeReducer(state?: any, options?: any): Redux.Reducer<any>;
|
||||
export function syncHistory(history: History.History): HistoryMiddleware;
|
||||
|
||||
|
||||
|
||||
8
react-router/lib/IndexRoute.d.ts
vendored
8
react-router/lib/IndexRoute.d.ts
vendored
@@ -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;
|
||||
|
||||
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) => 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;
|
||||
}
|
||||
|
||||
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): 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<Part> = (path: Path, query?: any) => Part;
|
||||
|
||||
export interface InjectedRouter {
|
||||
|
||||
5
react-router/lib/match.d.ts
vendored
5
react-router/lib/match.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user