mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
* Improve typing of withRouter Hoist typings of static methods. * Fix declaration order * Add test case
13 lines
433 B
TypeScript
13 lines
433 B
TypeScript
import { ComponentClass, StatelessComponent } from "react";
|
|
|
|
interface Options {
|
|
withRef?: boolean;
|
|
}
|
|
|
|
type ComponentConstructor<P> = ComponentClass<P> | StatelessComponent<P>;
|
|
|
|
declare function withRouter<P, S>(component: ComponentConstructor<P> & S, options?: Options): ComponentClass<P> & S;
|
|
declare function withRouter<P>(component: ComponentConstructor<P>, options?: Options): ComponentClass<P>;
|
|
|
|
export default withRouter;
|