@storybook/nextjs-vite
Version:
Storybook for Next.js and Vite: Develop, document, and test UI components in isolation
47 lines (43 loc) • 1.45 kB
TypeScript
import * as React from 'react';
import * as next_dist_client_with_router from 'next/dist/client/with-router';
import * as next from 'next';
import * as singletonRouter from 'next/dist/client/router';
import singletonRouter__default from 'next/dist/client/router';
export * from 'next/dist/client/router';
export { default } from 'next/dist/client/router';
import { NextRouter } from 'next/router';
import { Mock } from 'storybook/test';
/**
* Creates a next/router router API mock. Used internally.
*
* @ignore
* @internal
*/
declare const createRouter: (overrides: Partial<NextRouter>) => NextRouter;
declare const getRouter: () => {
push: Mock;
replace: Mock;
reload: Mock;
back: Mock;
forward: Mock;
prefetch: Mock;
beforePopState: Mock;
events: {
on: Mock;
off: Mock;
emit: Mock;
};
} & {
route: string;
asPath: string;
basePath: string;
pathname: string;
query: {};
isFallback: boolean;
isLocaleDomain: boolean;
isReady: boolean;
isPreview: boolean;
};
declare const useRouter: Mock<typeof singletonRouter.useRouter>;
declare const withRouter: Mock<(ComposedComponent: next.NextComponentType<next.NextPageContext, any, next_dist_client_with_router.WithRouterProps>) => React.ComponentType<next_dist_client_with_router.ExcludeRouterProps<next_dist_client_with_router.WithRouterProps>>>;
export { createRouter, getRouter, useRouter, withRouter };