// Type definitions for react-router-dom 5.3 // Project: https://github.com/ReactTraining/react-router // Definitions by: Huy Nguyen // Philip Jackson // John Reilly // Sebastian Silbermann // Daniel Nixon // Tony Ward // Pirasis Leelatanon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.1 import { match } from 'react-router'; import * as React from 'react'; import * as H from 'history'; export { generatePath, PromptProps, Prompt, MemoryRouterProps, MemoryRouter, RedirectProps, Redirect, RouteChildrenProps, RouteComponentProps, RouteProps, Route, RouterProps, Router, StaticRouterProps, StaticRouter, SwitchProps, Switch, match, matchPath, withRouter, RouterChildContext, useHistory, useLocation, useParams, useRouteMatch, } from 'react-router'; export interface BrowserRouterProps { basename?: string | undefined; children?: React.ReactNode; getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined; forceRefresh?: boolean | undefined; keyLength?: number | undefined; } export class BrowserRouter extends React.Component {} export interface HashRouterProps { basename?: string | undefined; children?: React.ReactNode; getUserConfirmation?: ((message: string, callback: (ok: boolean) => void) => void) | undefined; hashType?: 'slash' | 'noslash' | 'hashbang' | undefined; } export class HashRouter extends React.Component {} export interface LinkProps extends React.AnchorHTMLAttributes { component?: React.ComponentType | undefined; to: H.LocationDescriptor | ((location: H.Location) => H.LocationDescriptor); replace?: boolean | undefined; innerRef?: React.Ref | undefined; } export function Link( ...params: Parameters> ): ReturnType>; export interface Link extends React.ForwardRefExoticComponent< React.PropsWithoutRef> & React.RefAttributes > {} export interface NavLinkProps extends Omit, "className" | "style"> { activeClassName?: string | undefined; activeStyle?: React.CSSProperties | undefined; exact?: boolean | undefined; strict?: boolean | undefined; isActive?(match: match | null, location: H.Location): boolean; location?: H.Location | undefined; className?: string | ((isActive: boolean) => string) | undefined; style?: | React.CSSProperties | ((isActive: boolean) => React.CSSProperties) | undefined; sensitive?: boolean | undefined; } export function NavLink( // TODO: Define this as ...params: Parameters> when only TypeScript >= 3.1 support is needed. props: React.PropsWithoutRef> & React.RefAttributes, ): ReturnType>; export interface NavLink extends React.ForwardRefExoticComponent< React.PropsWithoutRef> & React.RefAttributes > {}