UNPKG

@snipsonian/redux-first-router

Version:

Redux-first-router snippets

16 lines (15 loc) 1.1 kB
import { IReducerState } from '../reducer'; import { IBaseRoute } from '../route/types'; export interface IPayload { [index: string]: any; } export declare function setReducerKey(newReducerKey: string): void; export declare function getReducerState<RouteKey extends string>(state: any): IReducerState<RouteKey>; export declare function getCurrentRouteKey<RouteKey extends string>(state: any): RouteKey; export declare function getCurrentRouteInfo<Route extends IBaseRoute = IBaseRoute>(state: any): Route; export declare function getCurrentRoutePayload<Payload extends IPayload>(state: any): Payload; export declare function getPropertyFromCurrentRoutePayload<Payload extends IPayload>(state: any, property: string): any; export declare function getCurrentRouteQueryParams<Query extends object>(state: any): Query; export declare function getTopParentRouteKey(state: any): string; export declare function isChildRouteOf<RouteKey extends string>(routeKey: RouteKey, possibleParentRouteKey: string): boolean; export declare function getVirtualPageForRoute(state: any, route: IBaseRoute): string;