@types/react-router-guard
v2.3.3
Published
TypeScript definitions for react-router-guard
Downloads
33
Readme
Installation
npm install --save @types/react-router-guard
Summary
This package contains type definitions for react-router-guard (https://github.com/laptransang/react-router-guard#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-router-guard.
index.d.ts
// Type definitions for react-router-guard 2.3
// Project: https://github.com/laptransang/react-router-guard#readme
// Definitions by: TSL <https://github.com/laptransang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.7
import * as React from 'react';
import * as H from 'history';
export const history: H.History;
export {
Loadable
} from 'react-loadable';
export {
BrowserRouter,
Link,
NavLink,
Route,
Router,
Switch,
} from 'react-router-dom';
export {
Redirect,
} from 'react-router';
export function lazy<T extends React.ComponentType<any>>(
factory: () => Promise<{ default: T }>
): React.LazyExoticComponent<T>;
export interface RouterGuardConfigProps {
path: string;
component: React.LazyExoticComponent<any>;
canActivate?: Array<() => Promise<any>> | undefined;
redirect?: string | undefined;
exact?: boolean | undefined;
routes?: RouterGuardConfigProps[] | undefined;
}
export interface RouterGuardProps {
config: RouterGuardConfigProps[];
history?: H.History | undefined;
loading?: boolean | React.ReactElement | undefined;
}
export class RouterGuard<T> extends React.Component<RouterGuardProps, any> {}
Additional Details
- Last updated: Tue, 18 Jan 2022 22:01:53 GMT
- Dependencies: @types/react, @types/history, @types/react-loadable, @types/react-router-dom, @types/react-router
- Global values: none
Credits
These definitions were written by TSL.