diff --git a/types/next/router.d.ts b/types/next/router.d.ts index a5cfb42c90..5a17bd2a53 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -10,9 +10,6 @@ export interface EventChangeOptions { export type RouterCallback = () => void; export interface RouterProps { - readyCallbacks: RouterCallback[]; - ready(cb: RouterCallback): void; - // router properties readonly components: { [key: string]: { Component: React.ComponentType; err: any }; @@ -55,6 +52,8 @@ export interface RouterProps { export interface SingletonRouter { router: RouterProps; + readyCallbacks: RouterCallback[]; + ready(cb: RouterCallback): void; } export function withRouter( diff --git a/types/next/test/next-router-tests.tsx b/types/next/test/next-router-tests.tsx index 7957f5e8a2..822b9b8e6f 100644 --- a/types/next/test/next-router-tests.tsx +++ b/types/next/test/next-router-tests.tsx @@ -2,10 +2,10 @@ import Router, * as r from "next/router"; import * as React from "react"; import * as qs from "querystring"; -Router.router.readyCallbacks.push(() => { +Router.readyCallbacks.push(() => { console.log("I'll get called when the router initializes."); }); -Router.router.ready(() => { +Router.ready(() => { console.log( "I'll get called immediately if the router initializes, or when it eventually does.", );