UNPKG

next-intlayer

Version:

Simplify internationalization i18n in Next.js with context providers, hooks, locale detection, and multilingual content integration.

26 lines 921 B
import { type NextFetchEvent, type NextRequest, NextResponse } from 'next/server'; /** * Middleware that handles the internationalization layer * * Usage: * * ```ts * // ./src/middleware.ts * * export { intlayerMiddleware as middleware } from '@intlayer/next/middleware'; * * // applies this middleware only to files in the app directory * export const config = { * matcher: '/((?!api|static|.*\\..*|_next).*)', * }; * ``` * * Main middleware function for handling internationalization. * * @param request - The incoming Next.js request object. * @param event - The Next.js fetch event (optional). * @param response - The Next.js response object (optional). * @returns - The response to be returned to the client. */ export declare const intlayerMiddleware: (request: NextRequest, _event?: NextFetchEvent, _response?: NextResponse) => NextResponse; //# sourceMappingURL=intlayerMiddleware.d.ts.map