import { NextResponse } from "next/server"; import type { NextRequest } from "next/server"; import type { RoutingStrategy } from "../routing-strategy/interface"; export type MiddlewareOptions = { /** * The routing strategy used for determining the language and page to render */ strategy: RoutingStrategy; /** * If a redirect should occur when the detected language does not match the path * * @example * - A request is made to /about. * - The routing strategy is ambiguous & falls back to language detection * - Language is set to `de` * - The localised path would be /de/ueber-uns * - If redirect is true, the request will be redirected to /de/ueber-uns, otherwise it will stay * * @default true */ redirect?: boolean; }; export declare function Middleware(opt: MiddlewareOptions): { (request: NextRequest): NextResponse; detectLanguage: (request: NextRequest) => T; getResponse: (request: NextRequest, locale: T) => NextResponse; };