File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ import type {
7979 NextApiRequest ,
8080 NextApiResponse ,
8181} from "next"
82- import type { AppRouteHandlerFn } from "next/dist/server/future/route-modules/app-route/module .js"
82+ import type { AppRouteHandlerFn } from "./lib/types .js"
8383import type { NextRequest } from "next/server"
8484import type { NextAuthConfig , NextAuthRequest } from "./lib/index.js"
8585export { AuthError } from "@auth/core/errors"
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import type {
1010 NextApiRequest ,
1111 NextApiResponse ,
1212} from "next"
13- import type { AppRouteHandlerFn } from "next/dist/server/future/route-modules/app-route/module "
13+ import type { AppRouteHandlerFn } from "./types.js "
1414import type { NextFetchEvent , NextMiddleware , NextRequest } from "next/server"
1515
1616/** Configure NextAuth.js. */
Original file line number Diff line number Diff line change 1+ import type { NextRequest } from "next/server"
2+
3+ /**
4+ * AppRouteHandlerFnContext is the context that is passed to the handler as the
5+ * second argument.
6+ */
7+ type AppRouteHandlerFnContext = {
8+ params ?: Record < string , string | string [ ] >
9+ }
10+ /**
11+ * Handler function for app routes. If a non-Response value is returned, an error
12+ * will be thrown.
13+ */
14+ export type AppRouteHandlerFn = (
15+ /**
16+ * Incoming request object.
17+ */
18+ req : NextRequest ,
19+ /**
20+ * Context properties on the request (including the parameters if this was a
21+ * dynamic route).
22+ */
23+ ctx : AppRouteHandlerFnContext
24+ ) => unknown
25+
26+ export type AppRouteHandlers = Record <
27+ "GET" | "POST" ,
28+ ( req : NextRequest ) => Promise < Response >
29+ >
You can’t perform that action at this time.
0 commit comments