@types/react-router
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -7,17 +7,3 @@ // Type definitions for react-router 3.0 | ||
/* Replacement from old history definitions */ | ||
export interface HistoryOptions { | ||
getCurrentLocation?(): Location; | ||
getUserConfirmation?(message: string, callback: (result: boolean) => void): void; | ||
pushLocation?(nextLocation: Location): void; | ||
replaceLocation?(nextLocation: Location): void; | ||
go?(n: number): void; | ||
keyLength?: number; | ||
} | ||
export type CreateHistory<T> = (options?: HistoryOptions) => T; | ||
export type CreateHistoryEnhancer<T> = (createHistory: CreateHistory<T>) => CreateHistory<T>; | ||
export { | ||
Basename, | ||
ChangeHook, | ||
@@ -27,4 +13,2 @@ EnterHook, | ||
LeaveHook, | ||
Location, | ||
LocationDescriptor, | ||
ParseQueryString, | ||
@@ -39,4 +23,3 @@ RouteComponent, | ||
RedirectFunction, | ||
StringifyQuery, | ||
Query | ||
StringifyQuery | ||
} from "react-router/lib/Router"; | ||
@@ -43,0 +26,0 @@ export { LinkProps } from "react-router/lib/Link"; |
@@ -1,6 +0,2 @@ | ||
import { History } from "history"; | ||
import { CreateHistory } from "react-router"; | ||
declare const createMemoryHistory: CreateHistory<History>; | ||
import { default as createMemoryHistory } from "history/lib/createMemoryHistory"; | ||
export default createMemoryHistory; |
import { ComponentClass, CSSProperties, HTMLProps } from "react"; | ||
import { Location, LocationDescriptor } from "react-router/lib/Router"; | ||
import { Location, LocationDescriptor } from "history"; | ||
@@ -4,0 +4,0 @@ type ToLocationFunction = (location: Location) => LocationDescriptor; |
import { ComponentClass, ClassAttributes } from "react"; | ||
import { RoutePattern, Query } from "react-router"; | ||
import { RoutePattern } from "react-router"; | ||
import { Query } from "history"; | ||
@@ -4,0 +5,0 @@ export interface IndexRedirectProps extends ClassAttributes<any> { |
@@ -12,4 +12,4 @@ import { ComponentClass, ClassAttributes } from "react"; | ||
type ComponentCallback = (err: any, component: RouteComponent) => void; | ||
type ComponentsCallback = (err: any, components: RouteComponents) => void; | ||
type ComponentCallback = (err: any, component: RouteComponent) => any; | ||
type ComponentsCallback = (err: any, components: RouteComponents) => any; | ||
@@ -19,4 +19,4 @@ export interface IndexRouteProps { | ||
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; | ||
@@ -23,0 +23,0 @@ onChange?: ChangeHook; |
@@ -1,3 +0,3 @@ | ||
import { History } from "history"; | ||
import { Basename, LocationDescriptor, ParseQueryString, RouteConfig, StringifyQuery } from "react-router"; | ||
import { Basename, History, LocationDescriptor } from "history"; | ||
import { ParseQueryString, RouteConfig, StringifyQuery } from "react-router"; | ||
@@ -21,5 +21,4 @@ interface MatchArgs { | ||
export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => void; | ||
export type MatchCallback = (error: any, redirectLocation: Location, renderProps: any) => any; | ||
export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): void; | ||
export default function match(args: MatchLocationArgs | MatchHistoryArgs, cb: MatchCallback): undefined; |
import { ComponentClass, ClassAttributes } from "react"; | ||
import { RoutePattern, Query } from "react-router"; | ||
import { RoutePattern } from "react-router"; | ||
import { IndexRedirectProps } from "react-router/lib/IndexRedirect"; | ||
import { Query } from "history"; | ||
@@ -5,0 +6,0 @@ export interface RedirectProps extends IndexRedirectProps { |
@@ -23,10 +23,10 @@ import { ComponentClass, ClassAttributes } from "react"; | ||
type RouteCallback = (err: any, route: PlainRoute) => void; | ||
type RoutesCallback = (err: any, routesArray: PlainRoute[]) => void; | ||
type RouteCallback = (err: any, route: PlainRoute) => any; | ||
type RoutesCallback = (err: any, routesArray: PlainRoute[]) => any; | ||
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; | ||
} |
import { Component, ComponentClass, ClassAttributes, ReactNode, StatelessComponent } from "react"; | ||
import { | ||
Action, | ||
Hash, | ||
History, | ||
Href, | ||
Location, | ||
LocationDescriptor, | ||
LocationKey, | ||
@@ -11,2 +12,3 @@ LocationState, | ||
Pathname, | ||
Query, | ||
Search | ||
@@ -16,5 +18,2 @@ } from "history"; | ||
/* Replacement from old history definitions */ | ||
export type Basename = string; | ||
export type Query = any; | ||
export interface Params { | ||
@@ -41,23 +40,5 @@ [key: string]: string; | ||
export interface Location { | ||
pathname: Pathname; | ||
search: Search; | ||
query: Query; | ||
state: LocationState; | ||
action: Action; | ||
key: LocationKey; | ||
} | ||
export interface LocationDescriptorObject { | ||
pathname?: Pathname; | ||
query?: Query; | ||
hash?: Hash; | ||
state?: LocationState; | ||
} | ||
export type LocationDescriptor = Path | LocationDescriptorObject; | ||
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; | ||
} | ||
@@ -72,7 +53,7 @@ | ||
type LocationFunction = (location: LocationDescriptor) => void; | ||
type GoFunction = (n: number) => void; | ||
type NavigateFunction = () => void; | ||
type LocationFunction = (location: LocationDescriptor) => any; | ||
type GoFunction = (n: number) => any; | ||
type NavigateFunction = () => any; | ||
type ActiveFunction = (location: LocationDescriptor, indexOnly?: boolean) => boolean; | ||
type LeaveHookFunction = (route: any, callback: RouteHook) => void; | ||
type LeaveHookFunction = (route: any, callback: RouteHook) => any; | ||
type CreatePartFunction<Part> = (path: Path, query?: any) => Part; | ||
@@ -79,0 +60,0 @@ |
@@ -1,6 +0,3 @@ | ||
import { History } from "history"; | ||
import { CreateHistoryEnhancer } from "react-router"; | ||
import { CreateHistory, HistoryBasename, HistoryBasenameOptions, HistoryQueries } from "history"; | ||
declare const useRouterHistory: CreateHistoryEnhancer<History>; | ||
export default useRouterHistory; | ||
export default function useRouterHistory<O, H>(createHistory: CreateHistory<O, H>): CreateHistory<O & HistoryBasenameOptions, H & HistoryBasename & HistoryQueries>; |
{ | ||
"name": "@types/react-router", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "TypeScript definitions for react-router", | ||
"license": "MIT", | ||
"author": "Sergey Buturlakin <https://github.com/sergey-buturlakin>, Yuichi Murata <https://github.com/mrk21>, Václav Ostrožlík <https://github.com/vasek17>, Nathan Brown <https://github.com/ngbrown>, Alex Wendland <https://github.com/awendland>, Kostya Esmukov <https://github.com/KostyaEsmukov>, John Reilly <https://github.com/johnnyreilly>, Karol Janyst <https://github.com/LKay>", | ||
"contributors": [ | ||
{ | ||
"name": "Sergey Buturlakin", | ||
"url": "https://github.com/sergey-buturlakin" | ||
}, | ||
{ | ||
"name": "Yuichi Murata", | ||
"url": "https://github.com/mrk21" | ||
}, | ||
{ | ||
"name": "Václav Ostrožlík", | ||
"url": "https://github.com/vasek17" | ||
}, | ||
{ | ||
"name": "Nathan Brown", | ||
"url": "https://github.com/ngbrown" | ||
}, | ||
{ | ||
"name": "Alex Wendland", | ||
"url": "https://github.com/awendland" | ||
}, | ||
{ | ||
"name": "Kostya Esmukov", | ||
"url": "https://github.com/KostyaEsmukov" | ||
}, | ||
{ | ||
"name": "John Reilly", | ||
"url": "https://github.com/johnnyreilly" | ||
}, | ||
{ | ||
"name": "Karol Janyst", | ||
"url": "https://github.com/LKay" | ||
} | ||
], | ||
"main": "", | ||
@@ -14,8 +47,8 @@ "repository": { | ||
"dependencies": { | ||
"@types/history": "*", | ||
"@types/history": "^3", | ||
"@types/react": "*" | ||
}, | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "cd9a508da180b03d15d51ab4c3d26e8ce1de6a40682e6785a543bce84475a71d", | ||
"typesPublisherContentHash": "fd458eb9fd64a7144be1270dcc2fd3fab930ee740739478939018df5cdb37f8f", | ||
"typeScriptVersion": "2.1" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 10 Feb 2017 13:02:22 GMT | ||
* Last updated: Mon, 20 Feb 2017 07:57:31 GMT | ||
* Dependencies: history, react | ||
@@ -14,0 +14,0 @@ * Global values: none |
@@ -6,8 +6,43 @@ { | ||
"data": { | ||
"authors": "Sergey Buturlakin <https://github.com/sergey-buturlakin>, Yuichi Murata <https://github.com/mrk21>, Václav Ostrožlík <https://github.com/vasek17>, Nathan Brown <https://github.com/ngbrown>, Alex Wendland <https://github.com/awendland>, Kostya Esmukov <https://github.com/KostyaEsmukov>, John Reilly <https://github.com/johnnyreilly>, Karol Janyst <https://github.com/LKay>", | ||
"contributors": [ | ||
{ | ||
"name": "Sergey Buturlakin", | ||
"url": "https://github.com/sergey-buturlakin" | ||
}, | ||
{ | ||
"name": "Yuichi Murata", | ||
"url": "https://github.com/mrk21" | ||
}, | ||
{ | ||
"name": "Václav Ostrožlík", | ||
"url": "https://github.com/vasek17" | ||
}, | ||
{ | ||
"name": "Nathan Brown", | ||
"url": "https://github.com/ngbrown" | ||
}, | ||
{ | ||
"name": "Alex Wendland", | ||
"url": "https://github.com/awendland" | ||
}, | ||
{ | ||
"name": "Kostya Esmukov", | ||
"url": "https://github.com/KostyaEsmukov" | ||
}, | ||
{ | ||
"name": "John Reilly", | ||
"url": "https://github.com/johnnyreilly" | ||
}, | ||
{ | ||
"name": "Karol Janyst", | ||
"url": "https://github.com/LKay" | ||
} | ||
], | ||
"dependencies": { | ||
"history": "*", | ||
"history": 3, | ||
"react": "*" | ||
}, | ||
"pathMappings": {}, | ||
"pathMappings": { | ||
"history": 3 | ||
}, | ||
"libraryMajorVersion": 3, | ||
@@ -23,20 +58,20 @@ "libraryMinorVersion": 0, | ||
"react-router/.", | ||
"react-router/lib/applyRouterMiddleware", | ||
"react-router/lib/browserHistory", | ||
"react-router/lib/applyRouterMiddleware", | ||
"react-router/lib/hashHistory", | ||
"react-router/lib/Link", | ||
"react-router/lib/IndexRedirect", | ||
"react-router/lib/createMemoryHistory", | ||
"react-router/lib/IndexRoute", | ||
"react-router/lib/IndexLink", | ||
"react-router/lib/Link", | ||
"react-router/lib/PatternUtils", | ||
"react-router/lib/Router", | ||
"react-router/lib/match", | ||
"react-router/lib/Redirect", | ||
"react-router/lib/PropTypes", | ||
"react-router/lib/Redirect", | ||
"react-router/lib/IndexRoute", | ||
"react-router/lib/useRouterHistory", | ||
"react-router/lib/RouterContext", | ||
"react-router/lib/RouteUtils", | ||
"react-router/lib/useRouterHistory", | ||
"react-router/lib/Route", | ||
"react-router/lib/withRouter", | ||
"react-router/lib/Router", | ||
"react-router/lib/hashHistory", | ||
"react-router/lib/match", | ||
"react-router/lib/createMemoryHistory", | ||
"react-router/lib/Route" | ||
"react-router/lib/RouteUtils" | ||
], | ||
@@ -65,5 +100,5 @@ "files": [ | ||
"hasPackageJson": false, | ||
"contentHash": "cd9a508da180b03d15d51ab4c3d26e8ce1de6a40682e6785a543bce84475a71d" | ||
"contentHash": "fd458eb9fd64a7144be1270dcc2fd3fab930ee740739478939018df5cdb37f8f" | ||
}, | ||
"isLatest": true | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17680
384
+ Added@types/history@3.2.5(transitive)
- Removed@babel/runtime@7.25.9(transitive)
- Removed@types/history@5.0.0(transitive)
- Removedhistory@5.3.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
Updated@types/history@^3