@types/gatsbyjs__reach-router
Advanced tools
Comparing version 1.3.0 to 2.0.0
@@ -1,6 +0,77 @@ | ||
// Type definitions for @gatsbyjs/reach-router 1.3 | ||
// Type definitions for @gatsbyjs/reach-router 2.0 | ||
// Project: https://github.com/gatsbyjs/reach-router#readme | ||
// Definitions by: Adam Jones <https://github.com/domdomegg> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 3.2 | ||
export * from '@reach/router'; | ||
import * as React from 'react'; | ||
import { WindowLocation } from '@reach/router'; | ||
export { | ||
HLocation, | ||
WindowLocation, | ||
HistoryActionType, | ||
HistoryLocation, | ||
HistoryListener, | ||
HistoryUnsubscribe, | ||
History, | ||
Router, | ||
RouterProps, | ||
RouteComponentProps, | ||
AnchorProps, | ||
LinkProps, | ||
LinkGetProps, | ||
Link, | ||
RedirectProps, | ||
Redirect, | ||
RedirectRequest, | ||
isRedirect, | ||
redirectTo, | ||
MatchProps, | ||
MatchRenderFn, | ||
MatchRenderProps, | ||
Match, | ||
NavigateFn, | ||
NavigateOptions, | ||
ServerLocation, | ||
ServerLocationProps, | ||
HistorySource, | ||
createHistory, | ||
createMemorySource, | ||
globalHistory, | ||
// Looking for useNavigate? It was removed from @gatsbyjs/reach-router | ||
// Use import { navigate } from 'gatsby' instead | ||
useLocation, | ||
useParams, | ||
useMatch, | ||
} from '@reach/router'; | ||
// Override location to remove navigate function for React 18 server components compatibility | ||
// https://github.com/gatsbyjs/reach-router/pull/4 | ||
export interface LocationProps { | ||
children: LocationProviderRenderFn; | ||
} | ||
export class Location extends React.Component<LocationProps> {} | ||
export interface LocationProviderProps { | ||
history?: History | undefined; | ||
children?: React.ReactNode | LocationProviderRenderFn | undefined; | ||
} | ||
export type LocationProviderRenderFn = (context: LocationContext) => React.ReactNode; | ||
export interface LocationContext { | ||
location: WindowLocation; | ||
} | ||
export class LocationProvider extends React.Component<LocationProviderProps> {} |
{ | ||
"name": "@types/gatsbyjs__reach-router", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for @gatsbyjs/reach-router", | ||
@@ -23,6 +23,7 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gatsbyjs__reach-router", | ||
"dependencies": { | ||
"@types/reach__router": "*" | ||
"@types/reach__router": "*", | ||
"@types/react": "*" | ||
}, | ||
"typesPublisherContentHash": "ae1beba123028e2a75154f7638b7524674b82dbb5f2234db7c2d95c2adbcfb04", | ||
"typeScriptVersion": "3.9" | ||
"typesPublisherContentHash": "0b147b31a187d1ce48beef11cd0d4bbac07e6c7aa4ddf5fa73e46f2233dd1997", | ||
"typeScriptVersion": "4.2" | ||
} |
@@ -11,14 +11,85 @@ # Installation | ||
````ts | ||
// Type definitions for @gatsbyjs/reach-router 1.3 | ||
// Type definitions for @gatsbyjs/reach-router 2.0 | ||
// Project: https://github.com/gatsbyjs/reach-router#readme | ||
// Definitions by: Adam Jones <https://github.com/domdomegg> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// Minimum TypeScript Version: 3.2 | ||
export * from '@reach/router'; | ||
import * as React from 'react'; | ||
import { WindowLocation } from '@reach/router'; | ||
export { | ||
HLocation, | ||
WindowLocation, | ||
HistoryActionType, | ||
HistoryLocation, | ||
HistoryListener, | ||
HistoryUnsubscribe, | ||
History, | ||
Router, | ||
RouterProps, | ||
RouteComponentProps, | ||
AnchorProps, | ||
LinkProps, | ||
LinkGetProps, | ||
Link, | ||
RedirectProps, | ||
Redirect, | ||
RedirectRequest, | ||
isRedirect, | ||
redirectTo, | ||
MatchProps, | ||
MatchRenderFn, | ||
MatchRenderProps, | ||
Match, | ||
NavigateFn, | ||
NavigateOptions, | ||
ServerLocation, | ||
ServerLocationProps, | ||
HistorySource, | ||
createHistory, | ||
createMemorySource, | ||
globalHistory, | ||
// Looking for useNavigate? It was removed from @gatsbyjs/reach-router | ||
// Use import { navigate } from 'gatsby' instead | ||
useLocation, | ||
useParams, | ||
useMatch, | ||
} from '@reach/router'; | ||
// Override location to remove navigate function for React 18 server components compatibility | ||
// https://github.com/gatsbyjs/reach-router/pull/4 | ||
export interface LocationProps { | ||
children: LocationProviderRenderFn; | ||
} | ||
export class Location extends React.Component<LocationProps> {} | ||
export interface LocationProviderProps { | ||
history?: History | undefined; | ||
children?: React.ReactNode | LocationProviderRenderFn | undefined; | ||
} | ||
export type LocationProviderRenderFn = (context: LocationContext) => React.ReactNode; | ||
export interface LocationContext { | ||
location: WindowLocation; | ||
} | ||
export class LocationProvider extends React.Component<LocationProviderProps> {} | ||
```` | ||
### Additional Details | ||
* Last updated: Tue, 05 Apr 2022 21:01:45 GMT | ||
* Dependencies: [@types/reach__router](https://npmjs.com/package/@types/reach__router) | ||
* Last updated: Thu, 23 Feb 2023 01:02:40 GMT | ||
* Dependencies: [@types/reach__router](https://npmjs.com/package/@types/reach__router), [@types/react](https://npmjs.com/package/@types/react) | ||
* Global values: none | ||
@@ -25,0 +96,0 @@ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
6326
60
98
0
2
+ Added@types/react@*