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:
Benny Joo authored and GitHub committed 2025-08-14 09:51:49 -03:00
1 parent 4c01f171ae
commit 881602cf1c
4 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -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 -2
View File
@@ -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, {
+3 -3
View File
@@ -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";