UNPKG

1.76 kBTypeScriptView Raw
1/// <reference types="node" />
2import React from 'react';
3import Router, { NextRouter } from '../next-server/lib/router/router';
4declare type SingletonRouterBase = {
5 router: Router | null;
6 readyCallbacks: Array<() => any>;
7 ready(cb: () => any): void;
8};
9export { Router, NextRouter };
10export declare type SingletonRouter = SingletonRouterBase & NextRouter;
11declare const routerEvents: readonly ["routeChangeStart", "beforeHistoryChange", "routeChangeComplete", "routeChangeError", "hashChangeStart", "hashChangeComplete"];
12export declare type RouterEvent = typeof routerEvents[number];
13declare const _default: SingletonRouter;
14export default _default;
15export { default as withRouter } from './with-router';
16export declare function useRouter(): NextRouter;
17export declare const createRouter: (args_0: string, args_1: import("querystring").ParsedUrlQuery, args_2: string, args_3: {
18 subscription: (data: import("../next-server/lib/router/router").PrivateRouteInfo, App: import("../next-server/lib/router/router").AppComponent, resetScroll: {
19 x: number;
20 y: number;
21 } | null) => Promise<void>;
22 initialProps: any;
23 pageLoader: any;
24 Component: React.ComponentType<{}>;
25 App: import("../next-server/lib/router/router").AppComponent;
26 wrapApp: (WrapAppComponent: import("../next-server/lib/router/router").AppComponent) => any;
27 err?: Error | undefined;
28 isFallback: boolean;
29 locale?: string | undefined;
30 locales?: string[] | undefined;
31 defaultLocale?: string | undefined;
32 domainLocales?: import("../next-server/server/config-shared").DomainLocales | undefined;
33 isPreview?: boolean | undefined;
34}) => Router;
35export declare function makePublicRouterInstance(router: Router): NextRouter;