refactor: Get rid of usages of Next.js private interfaces in our codebase (#23080)
* chore: do not use nextjs private interfaces * fix type check * fix * fix * refactor
This commit is contained in:
@@ -13,5 +13,5 @@ export type PageProps = {
|
||||
|
||||
export type LayoutProps = { params: Promise<Params>; children: React.ReactElement };
|
||||
|
||||
export { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
|
||||
export { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
|
||||
export type ReadonlyHeaders = Awaited<ReturnType<typeof import("next/headers").headers>>;
|
||||
export type ReadonlyRequestCookies = Awaited<ReturnType<typeof import("next/headers").cookies>>;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import type { SearchParams } from "app/_types";
|
||||
import { type Params } from "app/_types";
|
||||
import type { ReadonlyHeaders, ReadonlyRequestCookies } from "app/_types";
|
||||
import type { GetServerSidePropsContext, NextApiRequest } from "next";
|
||||
import { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
|
||||
import { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
|
||||
|
||||
const createProxifiedObject = (object: Record<string, string>) =>
|
||||
new Proxy(object, {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { IncomingMessage } from "http";
|
||||
import type { NextPageContext } from "next";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
import type { AppContextType } from "next/dist/shared/lib/utils";
|
||||
import React from "react";
|
||||
import CacheProvider from "react-inlinesvg/provider";
|
||||
|
||||
@@ -32,8 +32,8 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
MyApp.getInitialProps = async (ctx: AppContextType) => {
|
||||
const { req } = ctx.ctx;
|
||||
MyApp.getInitialProps = async ({ ctx }: { ctx: NextPageContext }) => {
|
||||
const { req } = ctx;
|
||||
|
||||
let newLocale = "en";
|
||||
|
||||
|
||||
@@ -2,11 +2,12 @@ import { parse } from "accept-language-parser";
|
||||
import { lookup } from "bcp-47-match";
|
||||
import type { GetTokenParams } from "next-auth/jwt";
|
||||
import { getToken } from "next-auth/jwt";
|
||||
import { type ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
|
||||
import { type ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
|
||||
|
||||
import { i18n } from "@calcom/config/next-i18next.config";
|
||||
|
||||
type ReadonlyHeaders = Awaited<ReturnType<typeof import("next/headers").headers>>;
|
||||
type ReadonlyRequestCookies = Awaited<ReturnType<typeof import("next/headers").cookies>>;
|
||||
|
||||
/**
|
||||
* This is a slimmed down version of the `getServerSession` function from
|
||||
* `next-auth`.
|
||||
|
||||
Reference in New Issue
Block a user