import { NextRequest, NextResponse } from 'next/server'; import { GTRuntime } from 'generaltranslation/runtime'; import { NextURL } from 'next/dist/server/web/next-url'; import { createPathMatcher, createPathToSharedPathMap, normalizePathname, type PathConfig, type PathMatcher } from './createPathMatcher'; import { getSharedPath } from './matchPath'; export { createPathMatcher, createPathToSharedPathMap, getSharedPath, normalizePathname, }; export type { PathConfig, PathMatcher }; export type ResponseConfig = { type: 'next' | 'rewrite' | 'redirect'; responsePath?: string; originalUrl: NextURL; userLocale: string; clearResetCookie: boolean; headerList: Headers; localeRouting: boolean; localeRoutingEnabledCookieName: string; resetLocaleCookieName: string; localeHeaderName: string; }; /** Creates a middleware response and attaches GT routing state. */ export declare function getResponse({ type, originalUrl, responsePath, userLocale, clearResetCookie, headerList, localeRouting, localeRoutingEnabledCookieName, resetLocaleCookieName, localeHeaderName, }: ResponseConfig): NextResponse; /** * Extracts the locale from the given pathname. */ export declare function extractLocale(pathname: string): string | null; /** * Extracts dynamic parameters from a path based on a shared path pattern. */ export declare function extractDynamicParams(templatePath: string, path: string): string[]; /** * Replaces dynamic segments in a path with their actual values. */ export declare function replaceDynamicSegments(path: string, templatePath: string, sourceTemplatePath?: string): string; /** * Gets the full localized path given a shared path and locale. */ export declare function getLocalizedPath(sharedPath: string, locale: string, pathConfig: PathConfig): string | undefined; /** * Resolves the request locale from its pathname, cookies, and headers. */ export declare function getLocaleFromRequest(req: NextRequest, defaultLocale: string, approvedLocales: string[], localeRouting: boolean, prefixDefaultLocale: boolean, defaultLocalePaths: PathMatcher, referrerLocaleCookieName: string, localeCookieName: string, resetLocaleCookieName: string, gt: GTRuntime, enableSmartRouting?: boolean): { userLocale: string; pathnameLocale: string | undefined; unstandardizedPathnameLocale: string | null | undefined; clearResetCookie: boolean; }; //# sourceMappingURL=utils.d.ts.map