with-router.d.ts 521 B

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