Files
DefinitelyTyped/types/react-router-config/index.d.ts
Forbes Lindesay 8f8f6c4392 [react] Use HTMLDialogElement for the dialog node (#23053)
* [react] Use HTMLDialogElement for the dialog node

* Actually add the `open` property

* This update requires typescript 2.6

* Update dependents of react to also require typescript 2.6
2018-02-12 12:55:52 +00:00

32 lines
1.0 KiB
TypeScript

// Type definitions for react-router-config 1.0
// Project: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config
// Definitions by: François Nguyen <https://github.com/lith-light-g>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
import * as React from "react";
import { RouteComponentProps, match } from "react-router";
import { Location } from "history";
export interface RouteConfigComponentProps<T> extends RouteComponentProps<T> {
route?: RouteConfig;
}
export interface RouteConfig {
location?: Location;
component?: React.ComponentType<RouteConfigComponentProps<any> | {}>;
path?: string;
exact?: boolean;
strict?: boolean;
routes?: RouteConfig[];
}
export interface MatchedRoute<T> {
route: RouteConfig;
match: match<T>;
}
export function matchRoutes<T>(routes: RouteConfig[], pathname: string): Array<MatchedRoute<T>>;
export function renderRoutes(routes: RouteConfig[] | undefined, extraProps?: any): JSX.Element;