@types/reach__router
- Version 1.3.15
- Published
- 8.69 kB
- 1 dependency
- MIT license
Install
npm i @types/reach__routeryarn add @types/reach__routerpnpm add @types/reach__routerOverview
TypeScript definitions for @reach/router
Index
Variables
Functions
Classes
Interfaces
Type Aliases
Variables
variable globalHistory
const globalHistory: History;variable navigate
const navigate: NavigateFn;Functions
function createHistory
createHistory: (source: HistorySource) => History;function createMemorySource
createMemorySource: (initialPath: string) => HistorySource;function isRedirect
isRedirect: (error: any) => error is RedirectRequest;function Link
Link: <TState>( props: React.PropsWithoutRef<LinkProps<TState>> & React.RefAttributes<HTMLAnchorElement>) => ReturnType<Link<TState>>;function redirectTo
redirectTo: (uri: string) => void;function useLocation
useLocation: () => WindowLocation;function useMatch
useMatch: (pathname: string) => { [param: string]: string; uri: string; path: string;};function useNavigate
useNavigate: () => NavigateFn;function useParams
useParams: < TParams extends { [Param in keyof TParams]?: string } = any>() => TParams;Classes
class Location
class Location extends React.Component<LocationProps> {}class LocationProvider
class LocationProvider extends React.Component<LocationProviderProps> {}class Match
class Match<TParams> extends React.Component<MatchProps<TParams>> {}class Redirect
class Redirect<TState> extends React.Component< RouteComponentProps<RedirectProps<TState>>> {}class Router
class Router extends React.Component< RouterProps & React.HTMLProps<HTMLDivElement>> {}class ServerLocation
class ServerLocation extends React.Component<ServerLocationProps> {}Interfaces
interface History
interface History {}property listen
listen: (listener: HistoryListener) => HistoryUnsubscribe;property location
readonly location: HistoryLocation;property navigate
navigate: NavigateFn;property transitioning
readonly transitioning: boolean;interface HistoryListenerParameter
interface HistoryListenerParameter {}interface HistorySource
interface HistorySource {}property history
history: { readonly state: any; pushState(state: any, title: string, uri: string): void; replaceState(state: any, title: string, uri: string): void;};property location
readonly location: WindowLocation;method addEventListener
addEventListener: (name: string, listener: (event: Event) => void) => void;method removeEventListener
removeEventListener: (name: string, listener: (event: Event) => void) => void;interface HLocation
interface HLocation<S = unknown> {}interface Link
interface Link<TState> extends React.ForwardRefExoticComponent< React.PropsWithoutRef<LinkProps<TState>> & React.RefAttributes<HTMLAnchorElement> > {}interface LinkGetProps
interface LinkGetProps {}property href
href: string;property isCurrent
isCurrent: boolean;property isPartiallyCurrent
isPartiallyCurrent: boolean;property location
location: WindowLocation;interface LinkProps
interface LinkProps<TState> extends AnchorProps {}interface LocationContext
interface LocationContext {}interface LocationProps
interface LocationProps {}property children
children: LocationProviderRenderFn;interface LocationProviderProps
interface LocationProviderProps {}interface MatchProps
interface MatchProps<TParams> {}interface MatchRenderProps
interface MatchRenderProps<TParams> {}interface NavigateFn
interface NavigateFn {}call signature
(to: string, options?: NavigateOptions<{}>): Promise<void>;call signature
(to: number, options?: undefined): Promise<void>;interface NavigateOptions
interface NavigateOptions<TState> {}interface RedirectProps
interface RedirectProps<TState> {}interface RedirectRequest
interface RedirectRequest {}property uri
uri: string;interface RouterProps
interface RouterProps {}interface ServerLocationProps
interface ServerLocationProps {}property url
url: string;Type Aliases
type AnchorProps
type AnchorProps = Omit< React.DetailedHTMLProps< React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement >, 'href' // remove href, as it's ignored by the router>;type HistoryActionType
type HistoryActionType = 'PUSH' | 'POP';type HistoryListener
type HistoryListener = (parameter: HistoryListenerParameter) => void;type HistoryLocation
type HistoryLocation = WindowLocation & { state?: any };type HistoryUnsubscribe
type HistoryUnsubscribe = () => void;type LocationProviderRenderFn
type LocationProviderRenderFn = (context: LocationContext) => React.ReactNode;type MatchRenderFn
type MatchRenderFn<TParams> = (props: MatchRenderProps<TParams>) => React.ReactNode;type Omit
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;type RouteComponentProps
type RouteComponentProps<TParams = {}> = Partial<TParams> & { path?: string | undefined; default?: boolean | undefined; location?: WindowLocation | undefined; navigate?: NavigateFn | undefined; uri?: string | undefined;};type WindowLocation
type WindowLocation<S = unknown> = Window['location'] & HLocation<S>;Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/reach__router.
- Markdown[](https://www.jsdocs.io/package/@types/reach__router)
- HTML<a href="https://www.jsdocs.io/package/@types/reach__router"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2148 ms. - Missing or incorrect documentation? Open an issue for this package.
