next-intl 3.25.0 → 4.0.0-beta-00a79d4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.d.ts +2 -1
- package/dist/cjs/development/plugin.cjs +167 -0
- package/dist/{development → esm/development}/config.js +1 -5
- package/dist/esm/development/index.react-client.js +3 -0
- package/dist/esm/development/index.react-server.js +8 -0
- package/dist/{development → esm/development}/middleware/getAlternateLinksHeaderValue.js +18 -25
- package/dist/esm/development/middleware/middleware.js +155 -0
- package/dist/{development → esm/development}/middleware/resolveLocale.js +13 -25
- package/dist/esm/development/middleware/syncCookie.js +20 -0
- package/dist/{development → esm/development}/middleware/utils.js +24 -54
- package/dist/esm/development/middleware.js +1 -0
- package/dist/{development → esm/development}/navigation/react-client/createNavigation.js +22 -29
- package/dist/esm/development/navigation/react-client/useBasePathname.js +27 -0
- package/dist/esm/development/navigation/react-server/createNavigation.js +22 -0
- package/dist/esm/development/navigation/react-server/getServerLocale.js +12 -0
- package/dist/{development → esm/development}/navigation/shared/BaseLink.js +31 -36
- package/dist/{development → esm/development}/navigation/shared/createSharedNavigationFns.js +39 -50
- package/dist/{development → esm/development}/navigation/shared/syncLocaleCookie.js +5 -9
- package/dist/{development → esm/development}/navigation/shared/utils.js +21 -35
- package/dist/esm/development/navigation.react-client.js +1 -0
- package/dist/esm/development/navigation.react-server.js +1 -0
- package/dist/esm/development/plugin/createMessagesDeclaration.js +61 -0
- package/dist/esm/development/plugin/createNextIntlPlugin.js +23 -0
- package/dist/esm/development/plugin/getNextConfig.js +82 -0
- package/dist/esm/development/plugin/utils.js +11 -0
- package/dist/esm/development/plugin.js +1 -0
- package/dist/esm/development/react-client/index.js +35 -0
- package/dist/esm/development/react-server/NextIntlClientProviderServer.js +31 -0
- package/dist/esm/development/react-server/useConfig.js +21 -0
- package/dist/esm/development/react-server/useFormatter.js +9 -0
- package/dist/esm/development/react-server/useLocale.js +8 -0
- package/dist/esm/development/react-server/useMessages.js +9 -0
- package/dist/esm/development/react-server/useNow.js +12 -0
- package/dist/esm/development/react-server/useTimeZone.js +8 -0
- package/dist/esm/development/react-server/useTranslations.js +9 -0
- package/dist/esm/development/routing/config.js +28 -0
- package/dist/esm/development/routing/defineRouting.js +5 -0
- package/dist/esm/development/routing.js +1 -0
- package/dist/{development → esm/development}/server/react-client/index.js +5 -16
- package/dist/{development → esm/development}/server/react-server/RequestLocale.js +10 -14
- package/dist/{development → esm/development}/server/react-server/RequestLocaleCache.js +3 -8
- package/dist/esm/development/server/react-server/createRequestConfig.js +2 -0
- package/dist/esm/development/server/react-server/getConfig.js +53 -0
- package/dist/esm/development/server/react-server/getConfigNow.js +10 -0
- package/dist/esm/development/server/react-server/getDefaultNow.js +9 -0
- package/dist/esm/development/server/react-server/getFormats.js +10 -0
- package/dist/esm/development/server/react-server/getFormatter.js +21 -0
- package/dist/esm/development/server/react-server/getLocale.js +10 -0
- package/dist/esm/development/server/react-server/getMessages.js +19 -0
- package/dist/esm/development/server/react-server/getNow.js +8 -0
- package/dist/{development → esm/development}/server/react-server/getRequestConfig.js +1 -5
- package/dist/esm/development/server/react-server/getServerFormatter.js +21 -0
- package/dist/esm/development/server/react-server/getServerTranslator.js +12 -0
- package/dist/esm/development/server/react-server/getTimeZone.js +13 -0
- package/dist/{development → esm/development}/server/react-server/getTranslations.js +7 -15
- package/dist/esm/development/server.react-client.js +1 -0
- package/dist/esm/development/server.react-server.js +8 -0
- package/dist/esm/development/shared/NextIntlClientProvider.js +18 -0
- package/dist/esm/development/shared/constants.js +4 -0
- package/dist/esm/development/shared/use.js +13 -0
- package/dist/{development → esm/development}/shared/utils.js +6 -50
- package/dist/esm/production/index.react-client.js +1 -0
- package/dist/esm/production/middleware/getAlternateLinksHeaderValue.js +1 -0
- package/dist/esm/production/middleware/middleware.js +1 -0
- package/dist/esm/production/middleware/resolveLocale.js +1 -0
- package/dist/esm/production/middleware/syncCookie.js +1 -0
- package/dist/esm/production/middleware/utils.js +1 -0
- package/dist/esm/production/navigation/react-client/createNavigation.js +1 -0
- package/dist/esm/production/navigation/react-client/useBasePathname.js +1 -0
- package/dist/esm/production/navigation/react-server/createNavigation.js +1 -0
- package/dist/esm/production/navigation/shared/BaseLink.js +2 -0
- package/dist/esm/production/navigation/shared/createSharedNavigationFns.js +1 -0
- package/dist/esm/production/navigation/shared/syncLocaleCookie.js +1 -0
- package/dist/esm/production/navigation/shared/utils.js +1 -0
- package/dist/esm/production/navigation.react-client.js +1 -0
- package/dist/esm/production/navigation.react-server.js +1 -0
- package/dist/esm/production/plugin/createMessagesDeclaration.js +1 -0
- package/dist/esm/production/plugin/createNextIntlPlugin.js +1 -0
- package/dist/esm/production/plugin/getNextConfig.js +1 -0
- package/dist/esm/production/plugin/utils.js +1 -0
- package/dist/esm/production/plugin.js +1 -0
- package/dist/esm/production/react-client/index.js +1 -0
- package/dist/esm/production/react-server/NextIntlClientProviderServer.js +1 -0
- package/dist/esm/production/react-server/useConfig.js +1 -0
- package/dist/esm/production/react-server/useFormatter.js +1 -0
- package/dist/esm/production/react-server/useLocale.js +1 -0
- package/dist/esm/production/react-server/useMessages.js +1 -0
- package/dist/esm/production/react-server/useNow.js +1 -0
- package/dist/esm/production/react-server/useTimeZone.js +1 -0
- package/dist/esm/production/react-server/useTranslations.js +1 -0
- package/dist/esm/production/routing/config.js +1 -0
- package/dist/esm/production/server/react-client/index.js +1 -0
- package/dist/esm/production/server/react-server/RequestLocale.js +1 -0
- package/dist/esm/production/server/react-server/getConfig.js +1 -0
- package/dist/esm/production/server/react-server/getConfigNow.js +1 -0
- package/dist/esm/production/server/react-server/getDefaultNow.js +1 -0
- package/dist/esm/production/server/react-server/getFormats.js +1 -0
- package/dist/esm/production/server/react-server/getFormatter.js +1 -0
- package/dist/esm/production/server/react-server/getLocale.js +1 -0
- package/dist/esm/production/server/react-server/getMessages.js +1 -0
- package/dist/esm/production/server/react-server/getNow.js +1 -0
- package/dist/esm/production/server/react-server/getServerFormatter.js +1 -0
- package/dist/esm/{server → production/server}/react-server/getTimeZone.js +1 -1
- package/dist/esm/production/server/react-server/getTranslations.js +1 -0
- package/dist/esm/production/server.react-client.js +1 -0
- package/dist/esm/production/server.react-server.js +1 -0
- package/dist/esm/production/shared/NextIntlClientProvider.js +2 -0
- package/dist/esm/production/shared/constants.js +1 -0
- package/dist/esm/production/shared/use.js +1 -0
- package/dist/esm/production/shared/utils.js +1 -0
- package/dist/types/{src/index.react-client.d.ts → index.react-client.d.ts} +1 -1
- package/dist/types/index.react-server.d.ts +1 -0
- package/dist/types/{src/middleware → middleware}/getAlternateLinksHeaderValue.d.ts +3 -3
- package/dist/types/{src/middleware → middleware}/index.d.ts +1 -1
- package/dist/types/middleware/middleware.d.ts +4 -0
- package/dist/types/{src/middleware → middleware}/resolveLocale.d.ts +5 -4
- package/dist/types/middleware/syncCookie.d.ts +7 -0
- package/dist/types/{src/middleware → middleware}/utils.d.ts +4 -3
- package/dist/types/middleware.d.ts +1 -0
- package/dist/types/{src/navigation → navigation}/react-client/createNavigation.d.ts +58 -57
- package/dist/types/navigation/react-client/index.d.ts +2 -0
- package/dist/types/{src/navigation → navigation}/react-client/useBasePathname.d.ts +1 -1
- package/dist/types/{src/navigation → navigation}/react-server/createNavigation.d.ts +30 -30
- package/dist/types/navigation/react-server/index.d.ts +2 -0
- package/dist/types/navigation/shared/BaseLink.d.ts +19 -0
- package/dist/types/navigation/shared/createSharedNavigationFns.d.ts +386 -0
- package/dist/types/{src/navigation → navigation}/shared/syncLocaleCookie.d.ts +3 -2
- package/dist/types/{src/navigation → navigation}/shared/utils.d.ts +5 -4
- package/dist/types/navigation.react-client.d.ts +1 -0
- package/dist/types/navigation.react-server.d.ts +1 -0
- package/dist/types/plugin/createMessagesDeclaration.d.ts +1 -0
- package/dist/types/plugin/createNextIntlPlugin.d.ts +3 -0
- package/dist/types/plugin/getNextConfig.d.ts +3 -0
- package/dist/types/plugin/index.d.ts +1 -0
- package/dist/types/plugin/types.d.ts +6 -0
- package/dist/types/plugin/utils.d.ts +2 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/{src/react-client → react-client}/index.d.ts +1 -2
- package/dist/types/react-server/NextIntlClientProviderServer.d.ts +5 -0
- package/dist/types/react-server/index.d.ts +15 -0
- package/dist/types/{src/react-server → react-server}/testUtils.d.ts +1 -1
- package/dist/types/{src/react-server → react-server}/useConfig.d.ts +1 -1
- package/dist/types/react-server/useFormatter.d.ts +2 -0
- package/dist/types/react-server/useLocale.d.ts +2 -0
- package/dist/types/react-server/useMessages.d.ts +2 -0
- package/dist/types/react-server/useNow.d.ts +2 -0
- package/dist/types/react-server/useTimeZone.d.ts +2 -0
- package/dist/types/{src/routing → routing}/config.d.ts +2 -4
- package/dist/types/{src/routing → routing}/defineRouting.d.ts +2 -2
- package/dist/types/routing/index.d.ts +3 -0
- package/dist/types/routing.d.ts +1 -0
- package/dist/types/{src/server → server}/react-client/index.d.ts +1 -2
- package/dist/types/server/react-server/RequestLocaleCache.d.ts +3 -0
- package/dist/types/{src/server → server}/react-server/createRequestConfig.d.ts +1 -1
- package/dist/types/{src/server → server}/react-server/getConfig.d.ts +2 -3
- package/dist/types/server/react-server/getConfigNow.d.ts +4 -0
- package/dist/types/server/react-server/getDefaultNow.d.ts +3 -0
- package/dist/types/server/react-server/getFormats.d.ts +3 -0
- package/dist/types/{src/server → server}/react-server/getFormatter.d.ts +2 -2
- package/dist/types/server/react-server/getLocale.d.ts +4 -0
- package/dist/types/server/react-server/getMessages.d.ts +6 -0
- package/dist/types/server/react-server/getNow.d.ts +4 -0
- package/dist/types/{src/server → server}/react-server/getRequestConfig.d.ts +2 -19
- package/dist/types/server/react-server/getServerFormatter.d.ts +10 -0
- package/dist/types/server/react-server/getServerTranslator.d.ts +4 -0
- package/dist/types/server/react-server/getTimeZone.d.ts +4 -0
- package/dist/types/server/react-server/getTranslations.d.ts +8 -0
- package/dist/types/server/react-server/index.d.ts +11 -0
- package/dist/types/server.react-client.d.ts +1 -0
- package/dist/types/server.react-server.d.ts +1 -0
- package/dist/types/{src/shared → shared}/NextIntlClientProvider.d.ts +5 -4
- package/dist/types/shared/constants.d.ts +1 -0
- package/dist/types/shared/use.d.ts +3 -0
- package/dist/types/{src/shared → shared}/utils.d.ts +3 -9
- package/middleware.d.ts +2 -1
- package/navigation.d.ts +2 -1
- package/package.json +57 -26
- package/plugin.d.cts +3 -0
- package/plugin.d.ts +3 -7
- package/routing.d.ts +2 -1
- package/server.d.ts +2 -1
- package/dist/config.js +0 -7
- package/dist/development/_virtual/_rollupPluginBabelHelpers.js +0 -15
- package/dist/development/index.react-client.js +0 -21
- package/dist/development/index.react-server.js +0 -28
- package/dist/development/middleware/middleware.js +0 -169
- package/dist/development/middleware/syncCookie.js +0 -20
- package/dist/development/middleware.js +0 -9
- package/dist/development/navigation/react-client/ClientLink.js +0 -55
- package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -156
- package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +0 -67
- package/dist/development/navigation/react-client/redirects.js +0 -32
- package/dist/development/navigation/react-client/useBasePathname.js +0 -31
- package/dist/development/navigation/react-client/useBaseRouter.js +0 -72
- package/dist/development/navigation/react-server/ServerLink.js +0 -32
- package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -95
- package/dist/development/navigation/react-server/createNavigation.js +0 -30
- package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +0 -56
- package/dist/development/navigation/react-server/getServerLocale.js +0 -16
- package/dist/development/navigation/react-server/redirects.js +0 -24
- package/dist/development/navigation/shared/LegacyBaseLink.js +0 -57
- package/dist/development/navigation/shared/redirects.js +0 -25
- package/dist/development/navigation.react-client.js +0 -13
- package/dist/development/navigation.react-server.js +0 -13
- package/dist/development/plugin.js +0 -101
- package/dist/development/react-client/index.js +0 -38
- package/dist/development/react-client/useLocale.js +0 -28
- package/dist/development/react-server/NextIntlClientProviderServer.js +0 -33
- package/dist/development/react-server/getTranslator.js +0 -16
- package/dist/development/react-server/useConfig.js +0 -25
- package/dist/development/react-server/useFormatter.js +0 -18
- package/dist/development/react-server/useLocale.js +0 -15
- package/dist/development/react-server/useMessages.js +0 -16
- package/dist/development/react-server/useNow.js +0 -19
- package/dist/development/react-server/useTimeZone.js +0 -15
- package/dist/development/react-server/useTranslations.js +0 -17
- package/dist/development/routing/config.js +0 -35
- package/dist/development/routing/defineRouting.js +0 -9
- package/dist/development/routing.js +0 -9
- package/dist/development/server/react-server/RequestLocaleLegacy.js +0 -43
- package/dist/development/server/react-server/createRequestConfig.js +0 -16
- package/dist/development/server/react-server/getConfig.js +0 -73
- package/dist/development/server/react-server/getFormatter.js +0 -25
- package/dist/development/server/react-server/getLocale.js +0 -14
- package/dist/development/server/react-server/getMessages.js +0 -24
- package/dist/development/server/react-server/getNow.js +0 -17
- package/dist/development/server/react-server/getTimeZone.js +0 -17
- package/dist/development/server.react-client.js +0 -17
- package/dist/development/server.react-server.js +0 -24
- package/dist/development/shared/NextIntlClientProvider.js +0 -30
- package/dist/development/shared/constants.js +0 -12
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +0 -1
- package/dist/esm/index.react-client.js +0 -1
- package/dist/esm/middleware/getAlternateLinksHeaderValue.js +0 -1
- package/dist/esm/middleware/middleware.js +0 -1
- package/dist/esm/middleware/resolveLocale.js +0 -1
- package/dist/esm/middleware/syncCookie.js +0 -1
- package/dist/esm/middleware/utils.js +0 -1
- package/dist/esm/navigation/react-client/ClientLink.js +0 -1
- package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-client/createNavigation.js +0 -1
- package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-client/redirects.js +0 -1
- package/dist/esm/navigation/react-client/useBasePathname.js +0 -1
- package/dist/esm/navigation/react-client/useBaseRouter.js +0 -1
- package/dist/esm/navigation/react-server/ServerLink.js +0 -1
- package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-server/createNavigation.js +0 -1
- package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-server/redirects.js +0 -1
- package/dist/esm/navigation/shared/BaseLink.js +0 -2
- package/dist/esm/navigation/shared/LegacyBaseLink.js +0 -2
- package/dist/esm/navigation/shared/createSharedNavigationFns.js +0 -1
- package/dist/esm/navigation/shared/redirects.js +0 -1
- package/dist/esm/navigation/shared/syncLocaleCookie.js +0 -1
- package/dist/esm/navigation/shared/utils.js +0 -1
- package/dist/esm/navigation.react-client.js +0 -1
- package/dist/esm/navigation.react-server.js +0 -1
- package/dist/esm/plugin.js +0 -1
- package/dist/esm/react-client/index.js +0 -1
- package/dist/esm/react-client/useLocale.js +0 -1
- package/dist/esm/react-server/NextIntlClientProviderServer.js +0 -1
- package/dist/esm/react-server/useConfig.js +0 -1
- package/dist/esm/react-server/useFormatter.js +0 -1
- package/dist/esm/react-server/useLocale.js +0 -1
- package/dist/esm/react-server/useMessages.js +0 -1
- package/dist/esm/react-server/useNow.js +0 -1
- package/dist/esm/react-server/useTimeZone.js +0 -1
- package/dist/esm/react-server/useTranslations.js +0 -1
- package/dist/esm/routing/config.js +0 -1
- package/dist/esm/server/react-client/index.js +0 -1
- package/dist/esm/server/react-server/RequestLocale.js +0 -1
- package/dist/esm/server/react-server/RequestLocaleLegacy.js +0 -1
- package/dist/esm/server/react-server/getConfig.js +0 -1
- package/dist/esm/server/react-server/getFormatter.js +0 -1
- package/dist/esm/server/react-server/getLocale.js +0 -1
- package/dist/esm/server/react-server/getMessages.js +0 -1
- package/dist/esm/server/react-server/getNow.js +0 -1
- package/dist/esm/server/react-server/getTranslations.js +0 -1
- package/dist/esm/server.react-client.js +0 -1
- package/dist/esm/server.react-server.js +0 -1
- package/dist/esm/shared/NextIntlClientProvider.js +0 -2
- package/dist/esm/shared/constants.js +0 -1
- package/dist/esm/shared/utils.js +0 -1
- package/dist/index.react-client.js +0 -7
- package/dist/index.react-server.js +0 -7
- package/dist/middleware.js +0 -7
- package/dist/navigation.react-client.js +0 -7
- package/dist/navigation.react-server.js +0 -7
- package/dist/plugin.js +0 -7
- package/dist/production/_virtual/_rollupPluginBabelHelpers.js +0 -1
- package/dist/production/config.js +0 -1
- package/dist/production/index.react-client.js +0 -1
- package/dist/production/index.react-server.js +0 -1
- package/dist/production/middleware/getAlternateLinksHeaderValue.js +0 -1
- package/dist/production/middleware/middleware.js +0 -1
- package/dist/production/middleware/resolveLocale.js +0 -1
- package/dist/production/middleware/syncCookie.js +0 -1
- package/dist/production/middleware/utils.js +0 -1
- package/dist/production/middleware.js +0 -1
- package/dist/production/navigation/react-client/ClientLink.js +0 -1
- package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-client/createNavigation.js +0 -1
- package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-client/redirects.js +0 -1
- package/dist/production/navigation/react-client/useBasePathname.js +0 -1
- package/dist/production/navigation/react-client/useBaseRouter.js +0 -1
- package/dist/production/navigation/react-server/ServerLink.js +0 -1
- package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-server/createNavigation.js +0 -1
- package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-server/getServerLocale.js +0 -1
- package/dist/production/navigation/react-server/redirects.js +0 -1
- package/dist/production/navigation/shared/BaseLink.js +0 -2
- package/dist/production/navigation/shared/LegacyBaseLink.js +0 -2
- package/dist/production/navigation/shared/createSharedNavigationFns.js +0 -1
- package/dist/production/navigation/shared/redirects.js +0 -1
- package/dist/production/navigation/shared/syncLocaleCookie.js +0 -1
- package/dist/production/navigation/shared/utils.js +0 -1
- package/dist/production/navigation.react-client.js +0 -1
- package/dist/production/navigation.react-server.js +0 -1
- package/dist/production/plugin.js +0 -1
- package/dist/production/react-client/index.js +0 -1
- package/dist/production/react-client/useLocale.js +0 -1
- package/dist/production/react-server/NextIntlClientProviderServer.js +0 -1
- package/dist/production/react-server/getTranslator.js +0 -1
- package/dist/production/react-server/useConfig.js +0 -1
- package/dist/production/react-server/useFormatter.js +0 -1
- package/dist/production/react-server/useLocale.js +0 -1
- package/dist/production/react-server/useMessages.js +0 -1
- package/dist/production/react-server/useNow.js +0 -1
- package/dist/production/react-server/useTimeZone.js +0 -1
- package/dist/production/react-server/useTranslations.js +0 -1
- package/dist/production/routing/config.js +0 -1
- package/dist/production/routing/defineRouting.js +0 -1
- package/dist/production/routing.js +0 -1
- package/dist/production/server/react-client/index.js +0 -1
- package/dist/production/server/react-server/RequestLocale.js +0 -1
- package/dist/production/server/react-server/RequestLocaleCache.js +0 -1
- package/dist/production/server/react-server/RequestLocaleLegacy.js +0 -1
- package/dist/production/server/react-server/createRequestConfig.js +0 -1
- package/dist/production/server/react-server/getConfig.js +0 -1
- package/dist/production/server/react-server/getFormatter.js +0 -1
- package/dist/production/server/react-server/getLocale.js +0 -1
- package/dist/production/server/react-server/getMessages.js +0 -1
- package/dist/production/server/react-server/getNow.js +0 -1
- package/dist/production/server/react-server/getRequestConfig.js +0 -1
- package/dist/production/server/react-server/getTimeZone.js +0 -1
- package/dist/production/server/react-server/getTranslations.js +0 -1
- package/dist/production/server.react-client.js +0 -1
- package/dist/production/server.react-server.js +0 -1
- package/dist/production/shared/NextIntlClientProvider.js +0 -2
- package/dist/production/shared/constants.js +0 -1
- package/dist/production/shared/utils.js +0 -1
- package/dist/routing.js +0 -7
- package/dist/server.react-client.js +0 -7
- package/dist/server.react-server.js +0 -7
- package/dist/types/__mocks__/react.d.ts +0 -9
- package/dist/types/src/index.react-server.d.ts +0 -1
- package/dist/types/src/middleware/getAlternateLinksHeaderValue.test.d.ts +0 -1
- package/dist/types/src/middleware/middleware.d.ts +0 -13
- package/dist/types/src/middleware/middleware.test.d.ts +0 -1
- package/dist/types/src/middleware/resolveLocale.test.d.ts +0 -1
- package/dist/types/src/middleware/syncCookie.d.ts +0 -3
- package/dist/types/src/middleware/utils.test.d.ts +0 -1
- package/dist/types/src/middleware.d.ts +0 -1
- package/dist/types/src/navigation/createLocalizedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/createNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/createSharedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/ClientLink.d.ts +0 -31
- package/dist/types/src/navigation/react-client/ClientLink.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +0 -91
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/createNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +0 -66
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/index.d.ts +0 -7
- package/dist/types/src/navigation/react-client/redirects.d.ts +0 -10
- package/dist/types/src/navigation/react-client/useBasePathname.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +0 -33
- package/dist/types/src/navigation/react-client/useBaseRouter.test.d.ts +0 -1
- package/dist/types/src/navigation/react-server/ServerLink.d.ts +0 -9
- package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +0 -70
- package/dist/types/src/navigation/react-server/createNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +0 -11
- package/dist/types/src/navigation/react-server/index.d.ts +0 -4
- package/dist/types/src/navigation/react-server/redirects.d.ts +0 -10
- package/dist/types/src/navigation/shared/BaseLink.d.ts +0 -17
- package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +0 -12
- package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +0 -386
- package/dist/types/src/navigation/shared/redirects.d.ts +0 -11
- package/dist/types/src/navigation/shared/redirects.test.d.ts +0 -1
- package/dist/types/src/navigation/shared/utils.test.d.ts +0 -1
- package/dist/types/src/navigation.react-client.d.ts +0 -1
- package/dist/types/src/navigation.react-server.d.ts +0 -1
- package/dist/types/src/plugin.d.ts +0 -1
- package/dist/types/src/react-client/useFormatter.test.d.ts +0 -1
- package/dist/types/src/react-client/useLocale.d.ts +0 -1
- package/dist/types/src/react-client/useLocale.test.d.ts +0 -1
- package/dist/types/src/react-client/useNow.test.d.ts +0 -1
- package/dist/types/src/react-client/useTimeZone.test.d.ts +0 -1
- package/dist/types/src/react-client/useTranslations.test.d.ts +0 -1
- package/dist/types/src/react-server/NextIntlClientProviderServer.d.ts +0 -5
- package/dist/types/src/react-server/NextIntlClientProviderServer.test.d.ts +0 -1
- package/dist/types/src/react-server/getTranslator.d.ts +0 -51
- package/dist/types/src/react-server/index.d.ts +0 -15
- package/dist/types/src/react-server/index.test.d.ts +0 -1
- package/dist/types/src/react-server/useFormatter.d.ts +0 -2
- package/dist/types/src/react-server/useLocale.d.ts +0 -2
- package/dist/types/src/react-server/useMessages.d.ts +0 -2
- package/dist/types/src/react-server/useNow.d.ts +0 -2
- package/dist/types/src/react-server/useTimeZone.d.ts +0 -2
- package/dist/types/src/react-server/useTranslations.test.d.ts +0 -1
- package/dist/types/src/routing/defineRouting.test.d.ts +0 -1
- package/dist/types/src/routing/index.d.ts +0 -3
- package/dist/types/src/routing/types.test.d.ts +0 -1
- package/dist/types/src/routing.d.ts +0 -1
- package/dist/types/src/server/react-client/index.test.d.ts +0 -1
- package/dist/types/src/server/react-server/RequestLocaleCache.d.ts +0 -2
- package/dist/types/src/server/react-server/RequestLocaleLegacy.d.ts +0 -1
- package/dist/types/src/server/react-server/getLocale.d.ts +0 -3
- package/dist/types/src/server/react-server/getMessages.d.ts +0 -6
- package/dist/types/src/server/react-server/getNow.d.ts +0 -3
- package/dist/types/src/server/react-server/getTimeZone.d.ts +0 -3
- package/dist/types/src/server/react-server/getTranslations.d.ts +0 -92
- package/dist/types/src/server/react-server/index.d.ts +0 -14
- package/dist/types/src/server/react-server/index.test.d.ts +0 -1
- package/dist/types/src/server.react-client.d.ts +0 -1
- package/dist/types/src/server.react-server.d.ts +0 -1
- package/dist/types/src/shared/NextIntlClientProvider.test.d.ts +0 -1
- package/dist/types/src/shared/constants.d.ts +0 -3
- package/dist/types/src/shared/utils.test.d.ts +0 -1
- package/dist/types/test/setup.d.ts +0 -1
- /package/dist/esm/{config.js → production/config.js} +0 -0
- /package/dist/esm/{index.react-server.js → production/index.react-server.js} +0 -0
- /package/dist/esm/{middleware.js → production/middleware.js} +0 -0
- /package/dist/esm/{navigation → production/navigation}/react-server/getServerLocale.js +0 -0
- /package/dist/esm/{routing → production/routing}/defineRouting.js +0 -0
- /package/dist/esm/{routing.js → production/routing.js} +0 -0
- /package/dist/esm/{server → production/server}/react-server/RequestLocaleCache.js +0 -0
- /package/dist/esm/{server → production/server}/react-server/createRequestConfig.js +0 -0
- /package/dist/esm/{server → production/server}/react-server/getRequestConfig.js +0 -0
- /package/dist/esm/{react-server/getTranslator.js → production/server/react-server/getServerTranslator.js} +0 -0
- /package/dist/types/{src/config.d.ts → config.d.ts} +0 -0
- /package/dist/types/{src/navigation → navigation}/react-server/getServerLocale.d.ts +0 -0
- /package/dist/types/{src/navigation → navigation}/shared/StrictParams.d.ts +0 -0
- /package/dist/types/{src/react-server → react-server}/useTranslations.d.ts +0 -0
- /package/dist/types/{src/routing → routing}/types.d.ts +0 -0
- /package/dist/types/{src/server → server}/react-server/RequestLocale.d.ts +0 -0
- /package/dist/types/{src/shared → shared}/types.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){return function(t){return"object"==typeof t?null==t.host&&null==t.hostname:!/^[a-z]+:/i.test(t)}(t)&&!function(t){const n="object"==typeof t?t.pathname:t;return null!=n&&!n.startsWith("/")}(t)}function n(t,n){return t.replace(new RegExp(`^${n}`),"")||"/"}function e(t,n){let e=t;return/^\/(\?.*)?$/.test(n)&&(n=n.slice(1)),e+=n,e}function r(t,n){return n===t||n.startsWith(`${t}/`)}function u(t){const n=function(){try{return"true"===process.env._next_intl_trailing_slash}catch{return!1}}();if("/"!==t){const e=t.endsWith("/");n&&!e?t+="/":!n&&e&&(t=t.slice(0,-1))}return t}function i(t,n){const e=u(t),r=u(n);return o(e).test(r)}function c(t,n){return"never"!==n.mode&&n.prefixes?.[t]||"/"+t}function o(t){const n=t.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp(`^${n}$`)}function f(t){return t.includes("[[...")}function s(t){return t.includes("[...")}function l(t){return t.includes("[")}function a(t,n){const e=t.split("/"),r=n.split("/"),u=Math.max(e.length,r.length);for(let t=0;t<u;t++){const n=e[t],u=r[t];if(!n&&u)return-1;if(n&&!u)return 1;if(n||u){if(!l(n)&&l(u))return-1;if(l(n)&&!l(u))return 1;if(!s(n)&&s(u))return-1;if(s(n)&&!s(u))return 1;if(!f(n)&&f(u))return-1;if(f(n)&&!f(u))return 1}}return 0}function p(t){return t.sort(a)}export{c as getLocalePrefix,p as getSortedPathnames,r as hasPathnamePrefixed,t as isLocalizableHref,i as matchesPathname,u as normalizeTrailingSlash,e as prefixPathname,o as templateToRegex,n as unprefixPathname};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './react-server/index.tsx';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NextRequest } from 'next/server';
|
|
2
|
-
import { ResolvedRoutingConfig } from '../routing/config';
|
|
3
|
-
import { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types';
|
|
1
|
+
import type { NextRequest } from 'next/server.js';
|
|
2
|
+
import type { ResolvedRoutingConfig } from '../routing/config.tsx';
|
|
3
|
+
import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.tsx';
|
|
4
4
|
/**
|
|
5
5
|
* See https://developers.google.com/search/docs/specialty/international/localized-versions
|
|
6
6
|
*/
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type NextRequest, NextResponse } from 'next/server.js';
|
|
2
|
+
import { type RoutingConfig } from '../routing/config.tsx';
|
|
3
|
+
import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.tsx';
|
|
4
|
+
export default function createMiddleware<const AppLocales extends Locales, const AppLocalePrefixMode extends LocalePrefixMode = 'always', const AppPathnames extends Pathnames<AppLocales> = never, const AppDomains extends DomainsConfig<AppLocales> = never>(routing: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>): (request: NextRequest) => NextResponse<unknown>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { RequestCookies } from 'next/dist/server/web/spec-extension/cookies';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import type { RequestCookies } from 'next/dist/server/web/spec-extension/cookies.js';
|
|
2
|
+
import type { Locale } from 'use-intl';
|
|
3
|
+
import type { ResolvedRoutingConfig } from '../routing/config.tsx';
|
|
4
|
+
import type { DomainConfig, DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.tsx';
|
|
5
|
+
export declare function getAcceptLanguageLocale<AppLocales extends Locales>(requestHeaders: Headers, locales: AppLocales, defaultLocale: Locale): string | undefined;
|
|
5
6
|
export default function resolveLocale<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined>(routing: Omit<ResolvedRoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'pathnames'>, requestHeaders: Headers, requestCookies: RequestCookies, pathname: string): {
|
|
6
7
|
locale: AppLocales[number];
|
|
7
8
|
domain?: DomainConfig<AppLocales>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NextRequest, NextResponse } from 'next/server.js';
|
|
2
|
+
import type { Locale } from 'use-intl';
|
|
3
|
+
import type { InitializedLocaleCookieConfig, ResolvedRoutingConfig } from '../routing/config.tsx';
|
|
4
|
+
import type { DomainConfig, DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.tsx';
|
|
5
|
+
export default function syncCookie<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined>(request: NextRequest, response: NextResponse, locale: Locale, routing: Pick<ResolvedRoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'locales' | 'defaultLocale'> & {
|
|
6
|
+
localeCookie: InitializedLocaleCookieConfig;
|
|
7
|
+
}, domain?: DomainConfig<AppLocales>): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Locale } from 'use-intl';
|
|
2
|
+
import type { DomainConfig, DomainsConfig, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from '../routing/types.tsx';
|
|
2
3
|
export declare function getFirstPathnameSegment(pathname: string): string;
|
|
3
4
|
export declare function getInternalTemplate<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(pathnames: AppPathnames, pathname: string, locale: AppLocales[number]): [AppLocales[number] | undefined, keyof AppPathnames | undefined];
|
|
4
5
|
export declare function formatTemplatePathname(sourcePathname: string, sourceTemplate: string, targetTemplate: string, prefix?: string): string;
|
|
@@ -18,8 +19,8 @@ export declare function getRouteParams(template: string, pathname: string): Reco
|
|
|
18
19
|
export declare function formatPathnameTemplate(template: string, params?: object): string;
|
|
19
20
|
export declare function formatPathname(pathname: string, prefix: string | undefined, search: string | undefined): string;
|
|
20
21
|
export declare function getHost(requestHeaders: Headers): string | undefined;
|
|
21
|
-
export declare function isLocaleSupportedOnDomain<AppLocales extends Locales>(locale:
|
|
22
|
-
export declare function getBestMatchingDomain<AppLocales extends Locales>(curHostDomain: DomainConfig<AppLocales> | undefined, locale:
|
|
22
|
+
export declare function isLocaleSupportedOnDomain<AppLocales extends Locales>(locale: Locale, domain: DomainConfig<AppLocales>): boolean;
|
|
23
|
+
export declare function getBestMatchingDomain<AppLocales extends Locales>(curHostDomain: DomainConfig<AppLocales> | undefined, locale: Locale, domainsConfig: DomainsConfig<AppLocales>): DomainConfig<AppLocales> | undefined;
|
|
23
24
|
export declare function applyBasePath(pathname: string, basePath: string): string;
|
|
24
25
|
export declare function getLocaleAsPrefix<AppLocales extends Locales>(locale: AppLocales[number]): string;
|
|
25
26
|
export declare function sanitizePathname(pathname: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './middleware/index.tsx';
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type Locale } from 'use-intl';
|
|
2
|
+
import type { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config.tsx';
|
|
3
|
+
import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.tsx';
|
|
3
4
|
export default function createNavigation<const AppLocales extends Locales, const AppLocalePrefixMode extends LocalePrefixMode = 'always', const AppPathnames extends Pathnames<AppLocales> = never, const AppDomains extends DomainsConfig<AppLocales> = never>(routing?: [AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>): {
|
|
4
5
|
Link: import("react").ForwardRefExoticComponent<Omit<{
|
|
5
|
-
locale?: string | undefined;
|
|
6
6
|
slot?: string | undefined;
|
|
7
7
|
style?: import("react").CSSProperties | undefined;
|
|
8
8
|
title?: string | undefined;
|
|
9
|
+
locale?: Locale | undefined;
|
|
9
10
|
onError?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
10
11
|
children?: import("react").ReactNode | undefined;
|
|
11
12
|
ref?: import("react").LegacyRef<HTMLAnchorElement> | undefined;
|
|
12
13
|
replace?: boolean | undefined;
|
|
14
|
+
prefix?: string | undefined;
|
|
15
|
+
key?: import("react").Key | null | undefined;
|
|
13
16
|
as?: (string | import("url").UrlObject) | undefined;
|
|
14
17
|
scroll?: boolean | undefined;
|
|
15
18
|
shallow?: boolean | undefined;
|
|
@@ -52,7 +55,6 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
52
55
|
content?: string | undefined;
|
|
53
56
|
datatype?: string | undefined;
|
|
54
57
|
inlist?: any;
|
|
55
|
-
prefix?: string | undefined;
|
|
56
58
|
property?: string | undefined;
|
|
57
59
|
rel?: string | undefined;
|
|
58
60
|
resource?: string | undefined;
|
|
@@ -297,13 +299,12 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
297
299
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
298
300
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
299
301
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
300
|
-
key?: import("react").Key | null | undefined;
|
|
301
302
|
href: [AppPathnames] extends [never] ? string | import("url").UrlObject : keyof AppPathnames extends infer T ? T extends keyof AppPathnames ? T extends `${string}[[...${string}` ? T | ({
|
|
302
303
|
pathname: T;
|
|
303
|
-
params?: import("../shared/StrictParams").default<T> | undefined;
|
|
304
|
+
params?: import("../shared/StrictParams.tsx").default<T> | undefined;
|
|
304
305
|
} & Omit<import("url").UrlObject, "pathname">) : T extends `${string}[${string}` ? {
|
|
305
306
|
pathname: T;
|
|
306
|
-
params: import("../shared/StrictParams").default<T>;
|
|
307
|
+
params: import("../shared/StrictParams.tsx").default<T>;
|
|
307
308
|
} & Omit<import("url").UrlObject, "pathname"> : T | ({
|
|
308
309
|
pathname: T;
|
|
309
310
|
} & Omit<import("url").UrlObject, "pathname">) : never : never;
|
|
@@ -314,79 +315,79 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
314
315
|
push: (href: Parameters<(args: {
|
|
315
316
|
href: [AppPathnames] extends [never] ? string | {
|
|
316
317
|
pathname: string;
|
|
317
|
-
query?: import(".").QueryParams;
|
|
318
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
318
319
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
319
320
|
pathname: T_1;
|
|
320
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
321
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
321
322
|
} & {
|
|
322
|
-
query?: import(".").QueryParams;
|
|
323
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
323
324
|
}) : T_1 extends `${string}[${string}` ? {
|
|
324
325
|
pathname: T_1;
|
|
325
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
326
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
326
327
|
} & {
|
|
327
|
-
query?: import(".").QueryParams;
|
|
328
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
328
329
|
} : T_1 | ({
|
|
329
330
|
pathname: T_1;
|
|
330
331
|
} & {
|
|
331
|
-
query?: import(".").QueryParams;
|
|
332
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
332
333
|
}) : never : never;
|
|
333
|
-
locale:
|
|
334
|
+
locale: Locale;
|
|
334
335
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
335
336
|
domain: AppDomains[number]["domain"];
|
|
336
|
-
} : {})) => string>[0]["href"], options?: (Partial<import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions> & {
|
|
337
|
-
locale?:
|
|
337
|
+
} : {})) => string>[0]["href"], options?: (Partial<import("next/dist/shared/lib/app-router-context.shared-runtime.js").NavigateOptions> & {
|
|
338
|
+
locale?: Locale;
|
|
338
339
|
}) | undefined) => void;
|
|
339
340
|
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#userouter */
|
|
340
341
|
replace: (href: Parameters<(args: {
|
|
341
342
|
href: [AppPathnames] extends [never] ? string | {
|
|
342
343
|
pathname: string;
|
|
343
|
-
query?: import(".").QueryParams;
|
|
344
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
344
345
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
345
346
|
pathname: T_1;
|
|
346
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
347
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
347
348
|
} & {
|
|
348
|
-
query?: import(".").QueryParams;
|
|
349
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
349
350
|
}) : T_1 extends `${string}[${string}` ? {
|
|
350
351
|
pathname: T_1;
|
|
351
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
352
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
352
353
|
} & {
|
|
353
|
-
query?: import(".").QueryParams;
|
|
354
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
354
355
|
} : T_1 | ({
|
|
355
356
|
pathname: T_1;
|
|
356
357
|
} & {
|
|
357
|
-
query?: import(".").QueryParams;
|
|
358
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
358
359
|
}) : never : never;
|
|
359
|
-
locale:
|
|
360
|
+
locale: Locale;
|
|
360
361
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
361
362
|
domain: AppDomains[number]["domain"];
|
|
362
|
-
} : {})) => string>[0]["href"], options?: (Partial<import("next/dist/shared/lib/app-router-context.shared-runtime").NavigateOptions> & {
|
|
363
|
-
locale?:
|
|
363
|
+
} : {})) => string>[0]["href"], options?: (Partial<import("next/dist/shared/lib/app-router-context.shared-runtime.js").NavigateOptions> & {
|
|
364
|
+
locale?: Locale;
|
|
364
365
|
}) | undefined) => void;
|
|
365
366
|
/** @see https://next-intl-docs.vercel.app/docs/routing/navigation#userouter */
|
|
366
367
|
prefetch: (href: Parameters<(args: {
|
|
367
368
|
href: [AppPathnames] extends [never] ? string | {
|
|
368
369
|
pathname: string;
|
|
369
|
-
query?: import(".").QueryParams;
|
|
370
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
370
371
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
371
372
|
pathname: T_1;
|
|
372
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
373
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
373
374
|
} & {
|
|
374
|
-
query?: import(".").QueryParams;
|
|
375
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
375
376
|
}) : T_1 extends `${string}[${string}` ? {
|
|
376
377
|
pathname: T_1;
|
|
377
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
378
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
378
379
|
} & {
|
|
379
|
-
query?: import(".").QueryParams;
|
|
380
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
380
381
|
} : T_1 | ({
|
|
381
382
|
pathname: T_1;
|
|
382
383
|
} & {
|
|
383
|
-
query?: import(".").QueryParams;
|
|
384
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
384
385
|
}) : never : never;
|
|
385
|
-
locale:
|
|
386
|
+
locale: Locale;
|
|
386
387
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
387
388
|
domain: AppDomains[number]["domain"];
|
|
388
|
-
} : {})) => string>[0]["href"], options?: (Partial<import("next/dist/shared/lib/app-router-context.shared-runtime").PrefetchOptions> & {
|
|
389
|
-
locale?:
|
|
389
|
+
} : {})) => string>[0]["href"], options?: (Partial<import("next/dist/shared/lib/app-router-context.shared-runtime.js").PrefetchOptions> & {
|
|
390
|
+
locale?: Locale;
|
|
390
391
|
}) | undefined) => void;
|
|
391
392
|
back(): void;
|
|
392
393
|
forward(): void;
|
|
@@ -395,74 +396,74 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
395
396
|
getPathname: (args: {
|
|
396
397
|
href: [AppPathnames] extends [never] ? string | {
|
|
397
398
|
pathname: string;
|
|
398
|
-
query?: import(".").QueryParams;
|
|
399
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
399
400
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
400
401
|
pathname: T_1;
|
|
401
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
402
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
402
403
|
} & {
|
|
403
|
-
query?: import(".").QueryParams;
|
|
404
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
404
405
|
}) : T_1 extends `${string}[${string}` ? {
|
|
405
406
|
pathname: T_1;
|
|
406
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
407
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
407
408
|
} & {
|
|
408
|
-
query?: import(".").QueryParams;
|
|
409
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
409
410
|
} : T_1 | ({
|
|
410
411
|
pathname: T_1;
|
|
411
412
|
} & {
|
|
412
|
-
query?: import(".").QueryParams;
|
|
413
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
413
414
|
}) : never : never;
|
|
414
|
-
locale:
|
|
415
|
+
locale: Locale;
|
|
415
416
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
416
417
|
domain: AppDomains[number]["domain"];
|
|
417
418
|
} : {})) => string;
|
|
418
419
|
redirect: (args: Omit<{
|
|
419
420
|
href: [AppPathnames] extends [never] ? string | {
|
|
420
421
|
pathname: string;
|
|
421
|
-
query?: import(".").QueryParams;
|
|
422
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
422
423
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
423
424
|
pathname: T_1;
|
|
424
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
425
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
425
426
|
} & {
|
|
426
|
-
query?: import(".").QueryParams;
|
|
427
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
427
428
|
}) : T_1 extends `${string}[${string}` ? {
|
|
428
429
|
pathname: T_1;
|
|
429
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
430
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
430
431
|
} & {
|
|
431
|
-
query?: import(".").QueryParams;
|
|
432
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
432
433
|
} : T_1 | ({
|
|
433
434
|
pathname: T_1;
|
|
434
435
|
} & {
|
|
435
|
-
query?: import(".").QueryParams;
|
|
436
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
436
437
|
}) : never : never;
|
|
437
|
-
locale:
|
|
438
|
+
locale: Locale;
|
|
438
439
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
439
440
|
domain: AppDomains[number]["domain"];
|
|
440
441
|
} : {}), "domain"> & Partial<([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
441
442
|
domain: AppDomains[number]["domain"];
|
|
442
|
-
} : {}>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
443
|
+
} : {}>, type?: import("next/navigation.js").RedirectType | undefined) => never;
|
|
443
444
|
permanentRedirect: (args: Omit<{
|
|
444
445
|
href: [AppPathnames] extends [never] ? string | {
|
|
445
446
|
pathname: string;
|
|
446
|
-
query?: import(".").QueryParams;
|
|
447
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
447
448
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
448
449
|
pathname: T_1;
|
|
449
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
450
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
450
451
|
} & {
|
|
451
|
-
query?: import(".").QueryParams;
|
|
452
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
452
453
|
}) : T_1 extends `${string}[${string}` ? {
|
|
453
454
|
pathname: T_1;
|
|
454
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
455
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
455
456
|
} & {
|
|
456
|
-
query?: import(".").QueryParams;
|
|
457
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
457
458
|
} : T_1 | ({
|
|
458
459
|
pathname: T_1;
|
|
459
460
|
} & {
|
|
460
|
-
query?: import(".").QueryParams;
|
|
461
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
461
462
|
}) : never : never;
|
|
462
|
-
locale:
|
|
463
|
+
locale: Locale;
|
|
463
464
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
464
465
|
domain: AppDomains[number]["domain"];
|
|
465
466
|
} : {}), "domain"> & Partial<([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
466
467
|
domain: AppDomains[number]["domain"];
|
|
467
|
-
} : {}>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
468
|
+
} : {}>, type?: import("next/navigation.js").RedirectType | undefined) => never;
|
|
468
469
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LocalePrefixConfigVerbose, LocalePrefixMode, Locales } from '../../routing/types';
|
|
1
|
+
import type { LocalePrefixConfigVerbose, LocalePrefixMode, Locales } from '../../routing/types.tsx';
|
|
2
2
|
export default function useBasePathname<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode>(localePrefix: LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>): string | null;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config';
|
|
2
|
-
import { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types';
|
|
1
|
+
import type { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config.tsx';
|
|
2
|
+
import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.tsx';
|
|
3
3
|
export default function createNavigation<const AppLocales extends Locales, const AppLocalePrefixMode extends LocalePrefixMode = 'always', const AppPathnames extends Pathnames<AppLocales> = never, const AppDomains extends DomainsConfig<AppLocales> = never>(routing?: [AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>): {
|
|
4
4
|
usePathname: () => never;
|
|
5
5
|
useRouter: () => never;
|
|
6
6
|
Link: import("react").ForwardRefExoticComponent<Omit<{
|
|
7
|
-
locale?: string | undefined;
|
|
8
7
|
slot?: string | undefined;
|
|
9
8
|
style?: import("react").CSSProperties | undefined;
|
|
10
9
|
title?: string | undefined;
|
|
10
|
+
locale?: import("use-intl").Locale | undefined;
|
|
11
11
|
onError?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
12
12
|
children?: import("react").ReactNode | undefined;
|
|
13
13
|
ref?: import("react").LegacyRef<HTMLAnchorElement> | undefined;
|
|
14
14
|
replace?: boolean | undefined;
|
|
15
|
+
prefix?: string | undefined;
|
|
16
|
+
key?: import("react").Key | null | undefined;
|
|
15
17
|
as?: (string | import("url").UrlObject) | undefined;
|
|
16
18
|
scroll?: boolean | undefined;
|
|
17
19
|
shallow?: boolean | undefined;
|
|
@@ -54,7 +56,6 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
54
56
|
content?: string | undefined;
|
|
55
57
|
datatype?: string | undefined;
|
|
56
58
|
inlist?: any;
|
|
57
|
-
prefix?: string | undefined;
|
|
58
59
|
property?: string | undefined;
|
|
59
60
|
rel?: string | undefined;
|
|
60
61
|
resource?: string | undefined;
|
|
@@ -299,13 +300,12 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
299
300
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
300
301
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
301
302
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
302
|
-
key?: import("react").Key | null | undefined;
|
|
303
303
|
href: [AppPathnames] extends [never] ? string | import("url").UrlObject : keyof AppPathnames extends infer T ? T extends keyof AppPathnames ? T extends `${string}[[...${string}` ? T | ({
|
|
304
304
|
pathname: T;
|
|
305
|
-
params?: import("../shared/StrictParams").default<T> | undefined;
|
|
305
|
+
params?: import("../shared/StrictParams.tsx").default<T> | undefined;
|
|
306
306
|
} & Omit<import("url").UrlObject, "pathname">) : T extends `${string}[${string}` ? {
|
|
307
307
|
pathname: T;
|
|
308
|
-
params: import("../shared/StrictParams").default<T>;
|
|
308
|
+
params: import("../shared/StrictParams.tsx").default<T>;
|
|
309
309
|
} & Omit<import("url").UrlObject, "pathname"> : T | ({
|
|
310
310
|
pathname: T;
|
|
311
311
|
} & Omit<import("url").UrlObject, "pathname">) : never : never;
|
|
@@ -313,73 +313,73 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
313
313
|
redirect: (args: Omit<{
|
|
314
314
|
href: [AppPathnames] extends [never] ? string | {
|
|
315
315
|
pathname: string;
|
|
316
|
-
query?: import("../
|
|
316
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
317
317
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
318
318
|
pathname: T_1;
|
|
319
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
319
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
320
320
|
} & {
|
|
321
|
-
query?: import("../
|
|
321
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
322
322
|
}) : T_1 extends `${string}[${string}` ? {
|
|
323
323
|
pathname: T_1;
|
|
324
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
324
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
325
325
|
} & {
|
|
326
|
-
query?: import("../
|
|
326
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
327
327
|
} : T_1 | ({
|
|
328
328
|
pathname: T_1;
|
|
329
329
|
} & {
|
|
330
|
-
query?: import("../
|
|
330
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
331
331
|
}) : never : never;
|
|
332
|
-
locale:
|
|
332
|
+
locale: import("use-intl").Locale;
|
|
333
333
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
334
334
|
domain: AppDomains[number]["domain"];
|
|
335
335
|
} : {}), "domain"> & Partial<([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
336
336
|
domain: AppDomains[number]["domain"];
|
|
337
|
-
} : {}>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
337
|
+
} : {}>, type?: import("next/navigation.js").RedirectType | undefined) => never;
|
|
338
338
|
permanentRedirect: (args: Omit<{
|
|
339
339
|
href: [AppPathnames] extends [never] ? string | {
|
|
340
340
|
pathname: string;
|
|
341
|
-
query?: import("../
|
|
341
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
342
342
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
343
343
|
pathname: T_1;
|
|
344
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
344
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
345
345
|
} & {
|
|
346
|
-
query?: import("../
|
|
346
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
347
347
|
}) : T_1 extends `${string}[${string}` ? {
|
|
348
348
|
pathname: T_1;
|
|
349
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
349
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
350
350
|
} & {
|
|
351
|
-
query?: import("../
|
|
351
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
352
352
|
} : T_1 | ({
|
|
353
353
|
pathname: T_1;
|
|
354
354
|
} & {
|
|
355
|
-
query?: import("../
|
|
355
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
356
356
|
}) : never : never;
|
|
357
|
-
locale:
|
|
357
|
+
locale: import("use-intl").Locale;
|
|
358
358
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
359
359
|
domain: AppDomains[number]["domain"];
|
|
360
360
|
} : {}), "domain"> & Partial<([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
361
361
|
domain: AppDomains[number]["domain"];
|
|
362
|
-
} : {}>, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
362
|
+
} : {}>, type?: import("next/navigation.js").RedirectType | undefined) => never;
|
|
363
363
|
getPathname: (args: {
|
|
364
364
|
href: [AppPathnames] extends [never] ? string | {
|
|
365
365
|
pathname: string;
|
|
366
|
-
query?: import("../
|
|
366
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
367
367
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
368
368
|
pathname: T_1;
|
|
369
|
-
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
369
|
+
params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
|
|
370
370
|
} & {
|
|
371
|
-
query?: import("../
|
|
371
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
372
372
|
}) : T_1 extends `${string}[${string}` ? {
|
|
373
373
|
pathname: T_1;
|
|
374
|
-
params: import("../shared/StrictParams").default<T_1>;
|
|
374
|
+
params: import("../shared/StrictParams.tsx").default<T_1>;
|
|
375
375
|
} & {
|
|
376
|
-
query?: import("../
|
|
376
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
377
377
|
} : T_1 | ({
|
|
378
378
|
pathname: T_1;
|
|
379
379
|
} & {
|
|
380
|
-
query?: import("../
|
|
380
|
+
query?: import("../shared/utils.tsx").QueryParams;
|
|
381
381
|
}) : never : never;
|
|
382
|
-
locale:
|
|
382
|
+
locale: import("use-intl").Locale;
|
|
383
383
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
384
384
|
domain: AppDomains[number]["domain"];
|
|
385
385
|
} : {})) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type LinkProps } from 'next/link.js';
|
|
2
|
+
import { type ComponentProps } from 'react';
|
|
3
|
+
import { type Locale } from 'use-intl';
|
|
4
|
+
import type { InitializedLocaleCookieConfig } from '../../routing/config.tsx';
|
|
5
|
+
type NextLinkProps = Omit<ComponentProps<'a'>, keyof LinkProps> & Omit<LinkProps, 'locale'>;
|
|
6
|
+
type Props = NextLinkProps & {
|
|
7
|
+
locale?: Locale;
|
|
8
|
+
defaultLocale?: Locale;
|
|
9
|
+
localeCookie: InitializedLocaleCookieConfig;
|
|
10
|
+
/** Special case for `localePrefix: 'as-needed'` and `domains`. */
|
|
11
|
+
unprefixed?: {
|
|
12
|
+
domains: {
|
|
13
|
+
[domain: string]: Locale;
|
|
14
|
+
};
|
|
15
|
+
pathname: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
19
|
+
export default _default;
|