Skip to content

Commit

Permalink
Exposing additional types and interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mtiller committed Nov 27, 2015
1 parent fb2b3b1 commit 814e5ba
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions react-router/react-router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ declare module "react-router/lib/useRoutes" {

}

declare module "react-router/lib/PatternUtils" {

export function formatPattern(pattern: string, params: {}): string;

}

declare module "react-router/lib/RouteUtils" {

Expand Down Expand Up @@ -396,12 +401,33 @@ declare module "react-router" {

import { createRoutes } from "react-router/lib/RouteUtils"

import { formatPattern } from "react-router/lib/PatternUtils"

import RoutingContext from "react-router/lib/RoutingContext"

import PropTypes from "react-router/lib/PropTypes"

import match from "react-router/lib/match"

// PlainRoute is defined in the API documented at:
// https://github.com/rackt/react-router/blob/master/docs/API.md
// but not included in any of the .../lib modules above.
export type PlainRoute = ReactRouter.PlainRoute

// The following definitions are also very useful to export
// because by using these types lots of potential type errors
// can be exposed:
export type EnterHook = ReactRouter.EnterHook
export type LeaveHook = ReactRouter.LeaveHook
export type ParseQueryString = ReactRouter.ParseQueryString
export type RedirectFunction = ReactRouter.RedirectFunction
export type RouteComponentProps<P,R> = ReactRouter.RouteComponentProps<P,R>;
export type RouteHook = ReactRouter.RouteHook
export type StringifyQuery = ReactRouter.StringifyQuery
export type RouterListener = ReactRouter.RouterListener
export type RouterState = ReactRouter.RouterState
export type HistoryBase = ReactRouter.HistoryBase

export {
Router,
Link,
Expand All @@ -415,6 +441,7 @@ declare module "react-router" {
RouteContext,
useRoutes,
createRoutes,
formatPattern,
RoutingContext,
PropTypes,
match
Expand Down

0 comments on commit 814e5ba

Please sign in to comment.