UNPKG

483 BTypeScriptView Raw
1import React from 'react';
2import { NextComponentType, NextPageContext } from '../next-server/lib/utils';
3import { NextRouter } from './router';
4export declare type WithRouterProps = {
5 router: NextRouter;
6};
7export declare type ExcludeRouterProps<P> = Pick<P, Exclude<keyof P, keyof WithRouterProps>>;
8export default function withRouter<P extends WithRouterProps, C = NextPageContext>(ComposedComponent: NextComponentType<C, any, P>): React.ComponentType<ExcludeRouterProps<P>>;