// This file is generated automatically by Next.js
// Do not edit this file manually
// This file validates that all pages and layouts export the correct types

import type { NextRequest } from "next/server.js";
import type { ResolvingMetadata, ResolvingViewport } from "next/types.js";
import type { AppRouteHandlerRoutes, AppRoutes, LayoutRoutes, ParamMap } from "./routes.js";

type AppPageConfig<Route extends AppRoutes = AppRoutes> = {
  default:
    | React.ComponentType<{ params: Promise<ParamMap[Route]> } & any>
    | ((
        props: { params: Promise<ParamMap[Route]> } & any,
      ) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>);
  generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[];
  generateMetadata?: (
    props: { params: Promise<ParamMap[Route]> } & any,
    parent: ResolvingMetadata,
  ) => Promise<any> | any;
  generateViewport?: (
    props: { params: Promise<ParamMap[Route]> } & any,
    parent: ResolvingViewport,
  ) => Promise<any> | any;
  metadata?: any;
  viewport?: any;
};

type LayoutConfig<Route extends LayoutRoutes = LayoutRoutes> = {
  default:
    | React.ComponentType<LayoutProps<Route>>
    | ((
        props: LayoutProps<Route>,
      ) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>);
  generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[];
  generateMetadata?: (
    props: { params: Promise<ParamMap[Route]> } & any,
    parent: ResolvingMetadata,
  ) => Promise<any> | any;
  generateViewport?: (
    props: { params: Promise<ParamMap[Route]> } & any,
    parent: ResolvingViewport,
  ) => Promise<any> | any;
  metadata?: any;
  viewport?: any;
};

type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRoutes> = {
  GET?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
  POST?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
  PUT?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
  PATCH?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
  DELETE?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
  HEAD?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
  OPTIONS?: (
    request: NextRequest,
    context: { params: Promise<ParamMap[Route]> },
  ) => Promise<Response | void> | Response | void;
};

// Validate ../../app/page.tsx
{
  type __IsExpected<Specific extends AppPageConfig<"/">> = Specific;
  const handler = {} as typeof import("../../app/page.js");
  type __Check = __IsExpected<typeof handler>;
  // @ts-ignore
  type __Unused = __Check;
}

// Validate ../../app/api/chat/route.ts
{
  type __IsExpected<Specific extends RouteHandlerConfig<"/api/chat">> = Specific;
  const handler = {} as typeof import("../../app/api/chat/route.js");
  type __Check = __IsExpected<typeof handler>;
  // @ts-ignore
  type __Unused = __Check;
}

// Validate ../../app/layout.tsx
{
  type __IsExpected<Specific extends LayoutConfig<"/">> = Specific;
  const handler = {} as typeof import("../../app/layout.js");
  type __Check = __IsExpected<typeof handler>;
  // @ts-ignore
  type __Unused = __Check;
}
