UNPKG

next-rest-framework

Version:

Next REST Framework - write type-safe, self-documenting REST APIs in Next.js

7 lines (6 loc) 280 B
import { type NextResponse, type NextRequest } from 'next/server'; import { type NextApiRequest } from 'next/types'; export type ErrorHandler = ({ req, error }: { req: NextRequest | NextApiRequest; error: unknown; }) => Promise<NextResponse | void> | NextResponse | void;