import { NextResponse } from 'next/server'; import type { NextRequest } from 'next/server'; import type { MiddlewareConfig } from './types'; export type { RouteOverrides, LocaleRoutes } from './types'; /** * Middleware factory to create a Next.js middleware for i18n routing and locale detection. * * This middleware sets a cookie based on the locale derived from several sources * such as the request pathname, referer, or 'Accept-Language' header. * If locale routing is enabled, it redirects to the localized pathname and * updates the locale cookie. * * Options omitted here fall back to the same options passed to `withGTConfig()`. * * @param {boolean} [config.localeRouting=true] - Flag to enable or disable automatic locale-based routing. * @param {boolean} [config.prefixDefaultLocale=false] - Flag to enable or disable prefixing the default locale to the pathname, i.e., /en/about -> /about * @param {boolean} [config.enableSmartRouting=true] - Keep automatic locale negotiation. Disable to treat returning visitors' unprefixed URLs as default-locale routes. * @param {boolean} [config.ignoreSourceMaps=true] - Flag to enable or disable ignoring source maps * @param {PathConfig} [config.pathConfig] - Path configuration for locale routing * @param {RouteOverrides} [config.routeOverrides] - Locale-relative paths to rewrite from /{locale}/{path} to /{locale}/{locale}/{path} * @param {LocaleRoutes} [config.localeRoutes] - Shared paths available per locale; other paths fall back to the default locale * @returns {function} - A middleware function that processes the request and response. */ export declare function createNextMiddleware(options?: MiddlewareConfig): (req: NextRequest) => NextResponse; //# sourceMappingURL=createNextMiddleware.d.ts.map