import { AllLocales, Pathnames } from '../shared/types'; type LocalePrefix = 'as-needed' | 'always' | 'never'; type RoutingBaseConfig = { /** A list of all locales that are supported. */ locales: Locales; defaultLocale: Locales[number]; /** The default locale can be used without a prefix (e.g. `/about`). If you prefer to have a prefix for the default locale as well (e.g. `/en/about`), you can switch this option to `always`. */ localePrefix?: LocalePrefix; }; export type DomainConfig = Omit, 'locales' | 'localePrefix'> & { /** The domain name (e.g. "example.com", "www.example.com" or "fr.example.com"). Note that the `x-forwarded-host` or alternatively the `host` header will be used to determine the requested domain. */ domain: string; /** The locales availabe on this particular domain. */ locales?: RoutingBaseConfig>['locales']; }; type MiddlewareConfig = RoutingBaseConfig & { /** Can be used to change the locale handling per domain. */ domains?: Array>; /** 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 */ alternateLinks?: boolean; /** By setting this to `false`, the `accept-language` header will no longer be used for locale detection. */ localeDetection?: boolean; /** Maps internal pathnames to external ones which can be localized per locale. */ pathnames?: Pathnames; }; export type MiddlewareConfigWithDefaults = MiddlewareConfig & { alternateLinks: boolean; localePrefix: LocalePrefix; localeDetection: boolean; }; export default MiddlewareConfig;