import type { NextResponse } from 'next/server.js'; import type { DomainsConfig, LocalePrefix, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from './types.js'; type CookieAttributes = Pick['2']>, 'maxAge' | 'domain' | 'partitioned' | 'path' | 'priority' | 'sameSite' | 'secure' | 'name'>; export type RoutingConfig | undefined, AppDomains extends DomainsConfig | undefined> = { /** * All available locales. * @see https://next-intl.dev/docs/routing */ locales: AppLocales; /** * Used when no locale matches. * @see https://next-intl.dev/docs/routing */ defaultLocale: AppLocales[number]; /** * Configures whether and which prefix is shown for a given locale. * @see https://next-intl.dev/docs/routing/configuration#locale-prefix **/ localePrefix?: LocalePrefix; /** * Can be used to change the locale handling per domain. * @see https://next-intl.dev/docs/routing/configuration#domains **/ domains?: AppDomains; /** * Can be used to disable the locale cookie or to customize it. * @see https://next-intl.dev/docs/routing/middleware#locale-cookie */ localeCookie?: boolean | CookieAttributes; /** * Sets the `Link` response header to notify search engines about content in other languages (defaults to `true`). See https://developers.google.com/search/docs/specialty/international/localized-versions#http * @see https://next-intl.dev/docs/routing/middleware#alternate-links **/ alternateLinks?: boolean; /** * By setting this to `false`, the cookie as well as the `accept-language` header will no longer be used for locale detection. * @see https://next-intl.dev/docs/routing/middleware#locale-detection **/ localeDetection?: boolean; } & ([AppPathnames] extends [never] ? {} : { /** * A map of localized pathnames per locale. * @see https://next-intl.dev/docs/routing/configuration#pathnames **/ pathnames: AppPathnames; }); export type RoutingConfigSharedNavigation = never> = Omit, 'defaultLocale' | 'locales' | 'pathnames'> & Partial, 'defaultLocale' | 'locales'>>; export type RoutingConfigLocalizedNavigation, AppDomains extends DomainsConfig = never> = Omit, 'defaultLocale' | 'pathnames'> & Partial, 'defaultLocale'>> & { pathnames: AppPathnames; }; export type ResolvedRoutingConfig | undefined, AppDomains extends DomainsConfig | undefined> = Omit, 'localePrefix' | 'localeCookie' | 'alternateLinks' | 'localeDetection'> & { localePrefix: LocalePrefixConfigVerbose; localeCookie: InitializedLocaleCookieConfig; alternateLinks: boolean; localeDetection: boolean; }; export declare function receiveRoutingConfig | undefined, AppDomains extends DomainsConfig | undefined, Config extends Partial>>(input: Config): Omit & { localePrefix: { mode: "never"; } | { mode: "always"; prefixes?: Partial> | undefined; } | { mode: "as-needed"; prefixes?: Partial> | undefined; }; localeCookie: InitializedLocaleCookieConfig; localeDetection: boolean | NonNullable["localeDetection"]>; alternateLinks: boolean | NonNullable["alternateLinks"]>; }; export type InitializedLocaleCookieConfig = false | LocaleCookieConfig; export type LocaleCookieConfig = Omit & Required>; export {};