Skip to content

Instantly share code, notes, and snippets.

@Keats
Created January 18, 2016 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Keats/2f5f824640692a5261db to your computer and use it in GitHub Desktop.
Save Keats/2f5f824640692a5261db to your computer and use it in GitHub Desktop.
///
declare module ReduxSimpleRouter {
import R = Redux;
import H = HistoryModule;
export const TRANSITION: string;
export const UPDATE_LOCATION: string;
interface HistoryMiddleware<S> extends R.Middleware<S> {
listenForReplays(store: R.Store<S>, selectRouterState?: Function): void;
unsubscribe(): void;
}
type LocationDescriptorObject = {
pathname: H.Pathname;
search: H.QueryString;
query: H.Query;
state: H.LocationState;
};
type LocationDescriptor = LocationDescriptorObject | H.Path;
interface RouteActions {
push(nextLocation: LocationDescriptor): void;
replace(nextLocation: LocationDescriptor): void;
go(n: number): void;
goForward(): void;
goBack: void;
}
function syncHistory<S>(history: H.History): HistoryMiddleware<S>;
function routeReducer(): any; // can't set to R.Reducer for some reasons
const routeActions: RouteActions;
}
declare module "redux-simple-router" {
export = ReduxSimpleRouter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment