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.
Files changed (450) hide show
  1. package/config.d.ts +2 -1
  2. package/dist/cjs/development/plugin.cjs +167 -0
  3. package/dist/{development → esm/development}/config.js +1 -5
  4. package/dist/esm/development/index.react-client.js +3 -0
  5. package/dist/esm/development/index.react-server.js +8 -0
  6. package/dist/{development → esm/development}/middleware/getAlternateLinksHeaderValue.js +18 -25
  7. package/dist/esm/development/middleware/middleware.js +155 -0
  8. package/dist/{development → esm/development}/middleware/resolveLocale.js +13 -25
  9. package/dist/esm/development/middleware/syncCookie.js +20 -0
  10. package/dist/{development → esm/development}/middleware/utils.js +24 -54
  11. package/dist/esm/development/middleware.js +1 -0
  12. package/dist/{development → esm/development}/navigation/react-client/createNavigation.js +22 -29
  13. package/dist/esm/development/navigation/react-client/useBasePathname.js +27 -0
  14. package/dist/esm/development/navigation/react-server/createNavigation.js +22 -0
  15. package/dist/esm/development/navigation/react-server/getServerLocale.js +12 -0
  16. package/dist/{development → esm/development}/navigation/shared/BaseLink.js +31 -36
  17. package/dist/{development → esm/development}/navigation/shared/createSharedNavigationFns.js +39 -50
  18. package/dist/{development → esm/development}/navigation/shared/syncLocaleCookie.js +5 -9
  19. package/dist/{development → esm/development}/navigation/shared/utils.js +21 -35
  20. package/dist/esm/development/navigation.react-client.js +1 -0
  21. package/dist/esm/development/navigation.react-server.js +1 -0
  22. package/dist/esm/development/plugin/createMessagesDeclaration.js +61 -0
  23. package/dist/esm/development/plugin/createNextIntlPlugin.js +23 -0
  24. package/dist/esm/development/plugin/getNextConfig.js +82 -0
  25. package/dist/esm/development/plugin/utils.js +11 -0
  26. package/dist/esm/development/plugin.js +1 -0
  27. package/dist/esm/development/react-client/index.js +35 -0
  28. package/dist/esm/development/react-server/NextIntlClientProviderServer.js +31 -0
  29. package/dist/esm/development/react-server/useConfig.js +21 -0
  30. package/dist/esm/development/react-server/useFormatter.js +9 -0
  31. package/dist/esm/development/react-server/useLocale.js +8 -0
  32. package/dist/esm/development/react-server/useMessages.js +9 -0
  33. package/dist/esm/development/react-server/useNow.js +12 -0
  34. package/dist/esm/development/react-server/useTimeZone.js +8 -0
  35. package/dist/esm/development/react-server/useTranslations.js +9 -0
  36. package/dist/esm/development/routing/config.js +28 -0
  37. package/dist/esm/development/routing/defineRouting.js +5 -0
  38. package/dist/esm/development/routing.js +1 -0
  39. package/dist/{development → esm/development}/server/react-client/index.js +5 -16
  40. package/dist/{development → esm/development}/server/react-server/RequestLocale.js +10 -14
  41. package/dist/{development → esm/development}/server/react-server/RequestLocaleCache.js +3 -8
  42. package/dist/esm/development/server/react-server/createRequestConfig.js +2 -0
  43. package/dist/esm/development/server/react-server/getConfig.js +53 -0
  44. package/dist/esm/development/server/react-server/getConfigNow.js +10 -0
  45. package/dist/esm/development/server/react-server/getDefaultNow.js +9 -0
  46. package/dist/esm/development/server/react-server/getFormats.js +10 -0
  47. package/dist/esm/development/server/react-server/getFormatter.js +21 -0
  48. package/dist/esm/development/server/react-server/getLocale.js +10 -0
  49. package/dist/esm/development/server/react-server/getMessages.js +19 -0
  50. package/dist/esm/development/server/react-server/getNow.js +8 -0
  51. package/dist/{development → esm/development}/server/react-server/getRequestConfig.js +1 -5
  52. package/dist/esm/development/server/react-server/getServerFormatter.js +21 -0
  53. package/dist/esm/development/server/react-server/getServerTranslator.js +12 -0
  54. package/dist/esm/development/server/react-server/getTimeZone.js +13 -0
  55. package/dist/{development → esm/development}/server/react-server/getTranslations.js +7 -15
  56. package/dist/esm/development/server.react-client.js +1 -0
  57. package/dist/esm/development/server.react-server.js +8 -0
  58. package/dist/esm/development/shared/NextIntlClientProvider.js +18 -0
  59. package/dist/esm/development/shared/constants.js +4 -0
  60. package/dist/esm/development/shared/use.js +13 -0
  61. package/dist/{development → esm/development}/shared/utils.js +6 -50
  62. package/dist/esm/production/index.react-client.js +1 -0
  63. package/dist/esm/production/middleware/getAlternateLinksHeaderValue.js +1 -0
  64. package/dist/esm/production/middleware/middleware.js +1 -0
  65. package/dist/esm/production/middleware/resolveLocale.js +1 -0
  66. package/dist/esm/production/middleware/syncCookie.js +1 -0
  67. package/dist/esm/production/middleware/utils.js +1 -0
  68. package/dist/esm/production/navigation/react-client/createNavigation.js +1 -0
  69. package/dist/esm/production/navigation/react-client/useBasePathname.js +1 -0
  70. package/dist/esm/production/navigation/react-server/createNavigation.js +1 -0
  71. package/dist/esm/production/navigation/shared/BaseLink.js +2 -0
  72. package/dist/esm/production/navigation/shared/createSharedNavigationFns.js +1 -0
  73. package/dist/esm/production/navigation/shared/syncLocaleCookie.js +1 -0
  74. package/dist/esm/production/navigation/shared/utils.js +1 -0
  75. package/dist/esm/production/navigation.react-client.js +1 -0
  76. package/dist/esm/production/navigation.react-server.js +1 -0
  77. package/dist/esm/production/plugin/createMessagesDeclaration.js +1 -0
  78. package/dist/esm/production/plugin/createNextIntlPlugin.js +1 -0
  79. package/dist/esm/production/plugin/getNextConfig.js +1 -0
  80. package/dist/esm/production/plugin/utils.js +1 -0
  81. package/dist/esm/production/plugin.js +1 -0
  82. package/dist/esm/production/react-client/index.js +1 -0
  83. package/dist/esm/production/react-server/NextIntlClientProviderServer.js +1 -0
  84. package/dist/esm/production/react-server/useConfig.js +1 -0
  85. package/dist/esm/production/react-server/useFormatter.js +1 -0
  86. package/dist/esm/production/react-server/useLocale.js +1 -0
  87. package/dist/esm/production/react-server/useMessages.js +1 -0
  88. package/dist/esm/production/react-server/useNow.js +1 -0
  89. package/dist/esm/production/react-server/useTimeZone.js +1 -0
  90. package/dist/esm/production/react-server/useTranslations.js +1 -0
  91. package/dist/esm/production/routing/config.js +1 -0
  92. package/dist/esm/production/server/react-client/index.js +1 -0
  93. package/dist/esm/production/server/react-server/RequestLocale.js +1 -0
  94. package/dist/esm/production/server/react-server/getConfig.js +1 -0
  95. package/dist/esm/production/server/react-server/getConfigNow.js +1 -0
  96. package/dist/esm/production/server/react-server/getDefaultNow.js +1 -0
  97. package/dist/esm/production/server/react-server/getFormats.js +1 -0
  98. package/dist/esm/production/server/react-server/getFormatter.js +1 -0
  99. package/dist/esm/production/server/react-server/getLocale.js +1 -0
  100. package/dist/esm/production/server/react-server/getMessages.js +1 -0
  101. package/dist/esm/production/server/react-server/getNow.js +1 -0
  102. package/dist/esm/production/server/react-server/getServerFormatter.js +1 -0
  103. package/dist/esm/{server → production/server}/react-server/getTimeZone.js +1 -1
  104. package/dist/esm/production/server/react-server/getTranslations.js +1 -0
  105. package/dist/esm/production/server.react-client.js +1 -0
  106. package/dist/esm/production/server.react-server.js +1 -0
  107. package/dist/esm/production/shared/NextIntlClientProvider.js +2 -0
  108. package/dist/esm/production/shared/constants.js +1 -0
  109. package/dist/esm/production/shared/use.js +1 -0
  110. package/dist/esm/production/shared/utils.js +1 -0
  111. package/dist/types/{src/index.react-client.d.ts → index.react-client.d.ts} +1 -1
  112. package/dist/types/index.react-server.d.ts +1 -0
  113. package/dist/types/{src/middleware → middleware}/getAlternateLinksHeaderValue.d.ts +3 -3
  114. package/dist/types/{src/middleware → middleware}/index.d.ts +1 -1
  115. package/dist/types/middleware/middleware.d.ts +4 -0
  116. package/dist/types/{src/middleware → middleware}/resolveLocale.d.ts +5 -4
  117. package/dist/types/middleware/syncCookie.d.ts +7 -0
  118. package/dist/types/{src/middleware → middleware}/utils.d.ts +4 -3
  119. package/dist/types/middleware.d.ts +1 -0
  120. package/dist/types/{src/navigation → navigation}/react-client/createNavigation.d.ts +58 -57
  121. package/dist/types/navigation/react-client/index.d.ts +2 -0
  122. package/dist/types/{src/navigation → navigation}/react-client/useBasePathname.d.ts +1 -1
  123. package/dist/types/{src/navigation → navigation}/react-server/createNavigation.d.ts +30 -30
  124. package/dist/types/navigation/react-server/index.d.ts +2 -0
  125. package/dist/types/navigation/shared/BaseLink.d.ts +19 -0
  126. package/dist/types/navigation/shared/createSharedNavigationFns.d.ts +386 -0
  127. package/dist/types/{src/navigation → navigation}/shared/syncLocaleCookie.d.ts +3 -2
  128. package/dist/types/{src/navigation → navigation}/shared/utils.d.ts +5 -4
  129. package/dist/types/navigation.react-client.d.ts +1 -0
  130. package/dist/types/navigation.react-server.d.ts +1 -0
  131. package/dist/types/plugin/createMessagesDeclaration.d.ts +1 -0
  132. package/dist/types/plugin/createNextIntlPlugin.d.ts +3 -0
  133. package/dist/types/plugin/getNextConfig.d.ts +3 -0
  134. package/dist/types/plugin/index.d.ts +1 -0
  135. package/dist/types/plugin/types.d.ts +6 -0
  136. package/dist/types/plugin/utils.d.ts +2 -0
  137. package/dist/types/plugin.d.ts +1 -0
  138. package/dist/types/{src/react-client → react-client}/index.d.ts +1 -2
  139. package/dist/types/react-server/NextIntlClientProviderServer.d.ts +5 -0
  140. package/dist/types/react-server/index.d.ts +15 -0
  141. package/dist/types/{src/react-server → react-server}/testUtils.d.ts +1 -1
  142. package/dist/types/{src/react-server → react-server}/useConfig.d.ts +1 -1
  143. package/dist/types/react-server/useFormatter.d.ts +2 -0
  144. package/dist/types/react-server/useLocale.d.ts +2 -0
  145. package/dist/types/react-server/useMessages.d.ts +2 -0
  146. package/dist/types/react-server/useNow.d.ts +2 -0
  147. package/dist/types/react-server/useTimeZone.d.ts +2 -0
  148. package/dist/types/{src/routing → routing}/config.d.ts +2 -4
  149. package/dist/types/{src/routing → routing}/defineRouting.d.ts +2 -2
  150. package/dist/types/routing/index.d.ts +3 -0
  151. package/dist/types/routing.d.ts +1 -0
  152. package/dist/types/{src/server → server}/react-client/index.d.ts +1 -2
  153. package/dist/types/server/react-server/RequestLocaleCache.d.ts +3 -0
  154. package/dist/types/{src/server → server}/react-server/createRequestConfig.d.ts +1 -1
  155. package/dist/types/{src/server → server}/react-server/getConfig.d.ts +2 -3
  156. package/dist/types/server/react-server/getConfigNow.d.ts +4 -0
  157. package/dist/types/server/react-server/getDefaultNow.d.ts +3 -0
  158. package/dist/types/server/react-server/getFormats.d.ts +3 -0
  159. package/dist/types/{src/server → server}/react-server/getFormatter.d.ts +2 -2
  160. package/dist/types/server/react-server/getLocale.d.ts +4 -0
  161. package/dist/types/server/react-server/getMessages.d.ts +6 -0
  162. package/dist/types/server/react-server/getNow.d.ts +4 -0
  163. package/dist/types/{src/server → server}/react-server/getRequestConfig.d.ts +2 -19
  164. package/dist/types/server/react-server/getServerFormatter.d.ts +10 -0
  165. package/dist/types/server/react-server/getServerTranslator.d.ts +4 -0
  166. package/dist/types/server/react-server/getTimeZone.d.ts +4 -0
  167. package/dist/types/server/react-server/getTranslations.d.ts +8 -0
  168. package/dist/types/server/react-server/index.d.ts +11 -0
  169. package/dist/types/server.react-client.d.ts +1 -0
  170. package/dist/types/server.react-server.d.ts +1 -0
  171. package/dist/types/{src/shared → shared}/NextIntlClientProvider.d.ts +5 -4
  172. package/dist/types/shared/constants.d.ts +1 -0
  173. package/dist/types/shared/use.d.ts +3 -0
  174. package/dist/types/{src/shared → shared}/utils.d.ts +3 -9
  175. package/middleware.d.ts +2 -1
  176. package/navigation.d.ts +2 -1
  177. package/package.json +57 -26
  178. package/plugin.d.cts +3 -0
  179. package/plugin.d.ts +3 -7
  180. package/routing.d.ts +2 -1
  181. package/server.d.ts +2 -1
  182. package/dist/config.js +0 -7
  183. package/dist/development/_virtual/_rollupPluginBabelHelpers.js +0 -15
  184. package/dist/development/index.react-client.js +0 -21
  185. package/dist/development/index.react-server.js +0 -28
  186. package/dist/development/middleware/middleware.js +0 -169
  187. package/dist/development/middleware/syncCookie.js +0 -20
  188. package/dist/development/middleware.js +0 -9
  189. package/dist/development/navigation/react-client/ClientLink.js +0 -55
  190. package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -156
  191. package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +0 -67
  192. package/dist/development/navigation/react-client/redirects.js +0 -32
  193. package/dist/development/navigation/react-client/useBasePathname.js +0 -31
  194. package/dist/development/navigation/react-client/useBaseRouter.js +0 -72
  195. package/dist/development/navigation/react-server/ServerLink.js +0 -32
  196. package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -95
  197. package/dist/development/navigation/react-server/createNavigation.js +0 -30
  198. package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +0 -56
  199. package/dist/development/navigation/react-server/getServerLocale.js +0 -16
  200. package/dist/development/navigation/react-server/redirects.js +0 -24
  201. package/dist/development/navigation/shared/LegacyBaseLink.js +0 -57
  202. package/dist/development/navigation/shared/redirects.js +0 -25
  203. package/dist/development/navigation.react-client.js +0 -13
  204. package/dist/development/navigation.react-server.js +0 -13
  205. package/dist/development/plugin.js +0 -101
  206. package/dist/development/react-client/index.js +0 -38
  207. package/dist/development/react-client/useLocale.js +0 -28
  208. package/dist/development/react-server/NextIntlClientProviderServer.js +0 -33
  209. package/dist/development/react-server/getTranslator.js +0 -16
  210. package/dist/development/react-server/useConfig.js +0 -25
  211. package/dist/development/react-server/useFormatter.js +0 -18
  212. package/dist/development/react-server/useLocale.js +0 -15
  213. package/dist/development/react-server/useMessages.js +0 -16
  214. package/dist/development/react-server/useNow.js +0 -19
  215. package/dist/development/react-server/useTimeZone.js +0 -15
  216. package/dist/development/react-server/useTranslations.js +0 -17
  217. package/dist/development/routing/config.js +0 -35
  218. package/dist/development/routing/defineRouting.js +0 -9
  219. package/dist/development/routing.js +0 -9
  220. package/dist/development/server/react-server/RequestLocaleLegacy.js +0 -43
  221. package/dist/development/server/react-server/createRequestConfig.js +0 -16
  222. package/dist/development/server/react-server/getConfig.js +0 -73
  223. package/dist/development/server/react-server/getFormatter.js +0 -25
  224. package/dist/development/server/react-server/getLocale.js +0 -14
  225. package/dist/development/server/react-server/getMessages.js +0 -24
  226. package/dist/development/server/react-server/getNow.js +0 -17
  227. package/dist/development/server/react-server/getTimeZone.js +0 -17
  228. package/dist/development/server.react-client.js +0 -17
  229. package/dist/development/server.react-server.js +0 -24
  230. package/dist/development/shared/NextIntlClientProvider.js +0 -30
  231. package/dist/development/shared/constants.js +0 -12
  232. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +0 -1
  233. package/dist/esm/index.react-client.js +0 -1
  234. package/dist/esm/middleware/getAlternateLinksHeaderValue.js +0 -1
  235. package/dist/esm/middleware/middleware.js +0 -1
  236. package/dist/esm/middleware/resolveLocale.js +0 -1
  237. package/dist/esm/middleware/syncCookie.js +0 -1
  238. package/dist/esm/middleware/utils.js +0 -1
  239. package/dist/esm/navigation/react-client/ClientLink.js +0 -1
  240. package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -1
  241. package/dist/esm/navigation/react-client/createNavigation.js +0 -1
  242. package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +0 -1
  243. package/dist/esm/navigation/react-client/redirects.js +0 -1
  244. package/dist/esm/navigation/react-client/useBasePathname.js +0 -1
  245. package/dist/esm/navigation/react-client/useBaseRouter.js +0 -1
  246. package/dist/esm/navigation/react-server/ServerLink.js +0 -1
  247. package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -1
  248. package/dist/esm/navigation/react-server/createNavigation.js +0 -1
  249. package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +0 -1
  250. package/dist/esm/navigation/react-server/redirects.js +0 -1
  251. package/dist/esm/navigation/shared/BaseLink.js +0 -2
  252. package/dist/esm/navigation/shared/LegacyBaseLink.js +0 -2
  253. package/dist/esm/navigation/shared/createSharedNavigationFns.js +0 -1
  254. package/dist/esm/navigation/shared/redirects.js +0 -1
  255. package/dist/esm/navigation/shared/syncLocaleCookie.js +0 -1
  256. package/dist/esm/navigation/shared/utils.js +0 -1
  257. package/dist/esm/navigation.react-client.js +0 -1
  258. package/dist/esm/navigation.react-server.js +0 -1
  259. package/dist/esm/plugin.js +0 -1
  260. package/dist/esm/react-client/index.js +0 -1
  261. package/dist/esm/react-client/useLocale.js +0 -1
  262. package/dist/esm/react-server/NextIntlClientProviderServer.js +0 -1
  263. package/dist/esm/react-server/useConfig.js +0 -1
  264. package/dist/esm/react-server/useFormatter.js +0 -1
  265. package/dist/esm/react-server/useLocale.js +0 -1
  266. package/dist/esm/react-server/useMessages.js +0 -1
  267. package/dist/esm/react-server/useNow.js +0 -1
  268. package/dist/esm/react-server/useTimeZone.js +0 -1
  269. package/dist/esm/react-server/useTranslations.js +0 -1
  270. package/dist/esm/routing/config.js +0 -1
  271. package/dist/esm/server/react-client/index.js +0 -1
  272. package/dist/esm/server/react-server/RequestLocale.js +0 -1
  273. package/dist/esm/server/react-server/RequestLocaleLegacy.js +0 -1
  274. package/dist/esm/server/react-server/getConfig.js +0 -1
  275. package/dist/esm/server/react-server/getFormatter.js +0 -1
  276. package/dist/esm/server/react-server/getLocale.js +0 -1
  277. package/dist/esm/server/react-server/getMessages.js +0 -1
  278. package/dist/esm/server/react-server/getNow.js +0 -1
  279. package/dist/esm/server/react-server/getTranslations.js +0 -1
  280. package/dist/esm/server.react-client.js +0 -1
  281. package/dist/esm/server.react-server.js +0 -1
  282. package/dist/esm/shared/NextIntlClientProvider.js +0 -2
  283. package/dist/esm/shared/constants.js +0 -1
  284. package/dist/esm/shared/utils.js +0 -1
  285. package/dist/index.react-client.js +0 -7
  286. package/dist/index.react-server.js +0 -7
  287. package/dist/middleware.js +0 -7
  288. package/dist/navigation.react-client.js +0 -7
  289. package/dist/navigation.react-server.js +0 -7
  290. package/dist/plugin.js +0 -7
  291. package/dist/production/_virtual/_rollupPluginBabelHelpers.js +0 -1
  292. package/dist/production/config.js +0 -1
  293. package/dist/production/index.react-client.js +0 -1
  294. package/dist/production/index.react-server.js +0 -1
  295. package/dist/production/middleware/getAlternateLinksHeaderValue.js +0 -1
  296. package/dist/production/middleware/middleware.js +0 -1
  297. package/dist/production/middleware/resolveLocale.js +0 -1
  298. package/dist/production/middleware/syncCookie.js +0 -1
  299. package/dist/production/middleware/utils.js +0 -1
  300. package/dist/production/middleware.js +0 -1
  301. package/dist/production/navigation/react-client/ClientLink.js +0 -1
  302. package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -1
  303. package/dist/production/navigation/react-client/createNavigation.js +0 -1
  304. package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +0 -1
  305. package/dist/production/navigation/react-client/redirects.js +0 -1
  306. package/dist/production/navigation/react-client/useBasePathname.js +0 -1
  307. package/dist/production/navigation/react-client/useBaseRouter.js +0 -1
  308. package/dist/production/navigation/react-server/ServerLink.js +0 -1
  309. package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -1
  310. package/dist/production/navigation/react-server/createNavigation.js +0 -1
  311. package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +0 -1
  312. package/dist/production/navigation/react-server/getServerLocale.js +0 -1
  313. package/dist/production/navigation/react-server/redirects.js +0 -1
  314. package/dist/production/navigation/shared/BaseLink.js +0 -2
  315. package/dist/production/navigation/shared/LegacyBaseLink.js +0 -2
  316. package/dist/production/navigation/shared/createSharedNavigationFns.js +0 -1
  317. package/dist/production/navigation/shared/redirects.js +0 -1
  318. package/dist/production/navigation/shared/syncLocaleCookie.js +0 -1
  319. package/dist/production/navigation/shared/utils.js +0 -1
  320. package/dist/production/navigation.react-client.js +0 -1
  321. package/dist/production/navigation.react-server.js +0 -1
  322. package/dist/production/plugin.js +0 -1
  323. package/dist/production/react-client/index.js +0 -1
  324. package/dist/production/react-client/useLocale.js +0 -1
  325. package/dist/production/react-server/NextIntlClientProviderServer.js +0 -1
  326. package/dist/production/react-server/getTranslator.js +0 -1
  327. package/dist/production/react-server/useConfig.js +0 -1
  328. package/dist/production/react-server/useFormatter.js +0 -1
  329. package/dist/production/react-server/useLocale.js +0 -1
  330. package/dist/production/react-server/useMessages.js +0 -1
  331. package/dist/production/react-server/useNow.js +0 -1
  332. package/dist/production/react-server/useTimeZone.js +0 -1
  333. package/dist/production/react-server/useTranslations.js +0 -1
  334. package/dist/production/routing/config.js +0 -1
  335. package/dist/production/routing/defineRouting.js +0 -1
  336. package/dist/production/routing.js +0 -1
  337. package/dist/production/server/react-client/index.js +0 -1
  338. package/dist/production/server/react-server/RequestLocale.js +0 -1
  339. package/dist/production/server/react-server/RequestLocaleCache.js +0 -1
  340. package/dist/production/server/react-server/RequestLocaleLegacy.js +0 -1
  341. package/dist/production/server/react-server/createRequestConfig.js +0 -1
  342. package/dist/production/server/react-server/getConfig.js +0 -1
  343. package/dist/production/server/react-server/getFormatter.js +0 -1
  344. package/dist/production/server/react-server/getLocale.js +0 -1
  345. package/dist/production/server/react-server/getMessages.js +0 -1
  346. package/dist/production/server/react-server/getNow.js +0 -1
  347. package/dist/production/server/react-server/getRequestConfig.js +0 -1
  348. package/dist/production/server/react-server/getTimeZone.js +0 -1
  349. package/dist/production/server/react-server/getTranslations.js +0 -1
  350. package/dist/production/server.react-client.js +0 -1
  351. package/dist/production/server.react-server.js +0 -1
  352. package/dist/production/shared/NextIntlClientProvider.js +0 -2
  353. package/dist/production/shared/constants.js +0 -1
  354. package/dist/production/shared/utils.js +0 -1
  355. package/dist/routing.js +0 -7
  356. package/dist/server.react-client.js +0 -7
  357. package/dist/server.react-server.js +0 -7
  358. package/dist/types/__mocks__/react.d.ts +0 -9
  359. package/dist/types/src/index.react-server.d.ts +0 -1
  360. package/dist/types/src/middleware/getAlternateLinksHeaderValue.test.d.ts +0 -1
  361. package/dist/types/src/middleware/middleware.d.ts +0 -13
  362. package/dist/types/src/middleware/middleware.test.d.ts +0 -1
  363. package/dist/types/src/middleware/resolveLocale.test.d.ts +0 -1
  364. package/dist/types/src/middleware/syncCookie.d.ts +0 -3
  365. package/dist/types/src/middleware/utils.test.d.ts +0 -1
  366. package/dist/types/src/middleware.d.ts +0 -1
  367. package/dist/types/src/navigation/createLocalizedPathnamesNavigation.test.d.ts +0 -1
  368. package/dist/types/src/navigation/createNavigation.test.d.ts +0 -1
  369. package/dist/types/src/navigation/createSharedPathnamesNavigation.test.d.ts +0 -1
  370. package/dist/types/src/navigation/react-client/ClientLink.d.ts +0 -31
  371. package/dist/types/src/navigation/react-client/ClientLink.test.d.ts +0 -1
  372. package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +0 -91
  373. package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.test.d.ts +0 -1
  374. package/dist/types/src/navigation/react-client/createNavigation.test.d.ts +0 -1
  375. package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +0 -66
  376. package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.test.d.ts +0 -1
  377. package/dist/types/src/navigation/react-client/index.d.ts +0 -7
  378. package/dist/types/src/navigation/react-client/redirects.d.ts +0 -10
  379. package/dist/types/src/navigation/react-client/useBasePathname.test.d.ts +0 -1
  380. package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +0 -33
  381. package/dist/types/src/navigation/react-client/useBaseRouter.test.d.ts +0 -1
  382. package/dist/types/src/navigation/react-server/ServerLink.d.ts +0 -9
  383. package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +0 -70
  384. package/dist/types/src/navigation/react-server/createNavigation.test.d.ts +0 -1
  385. package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +0 -11
  386. package/dist/types/src/navigation/react-server/index.d.ts +0 -4
  387. package/dist/types/src/navigation/react-server/redirects.d.ts +0 -10
  388. package/dist/types/src/navigation/shared/BaseLink.d.ts +0 -17
  389. package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +0 -12
  390. package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +0 -386
  391. package/dist/types/src/navigation/shared/redirects.d.ts +0 -11
  392. package/dist/types/src/navigation/shared/redirects.test.d.ts +0 -1
  393. package/dist/types/src/navigation/shared/utils.test.d.ts +0 -1
  394. package/dist/types/src/navigation.react-client.d.ts +0 -1
  395. package/dist/types/src/navigation.react-server.d.ts +0 -1
  396. package/dist/types/src/plugin.d.ts +0 -1
  397. package/dist/types/src/react-client/useFormatter.test.d.ts +0 -1
  398. package/dist/types/src/react-client/useLocale.d.ts +0 -1
  399. package/dist/types/src/react-client/useLocale.test.d.ts +0 -1
  400. package/dist/types/src/react-client/useNow.test.d.ts +0 -1
  401. package/dist/types/src/react-client/useTimeZone.test.d.ts +0 -1
  402. package/dist/types/src/react-client/useTranslations.test.d.ts +0 -1
  403. package/dist/types/src/react-server/NextIntlClientProviderServer.d.ts +0 -5
  404. package/dist/types/src/react-server/NextIntlClientProviderServer.test.d.ts +0 -1
  405. package/dist/types/src/react-server/getTranslator.d.ts +0 -51
  406. package/dist/types/src/react-server/index.d.ts +0 -15
  407. package/dist/types/src/react-server/index.test.d.ts +0 -1
  408. package/dist/types/src/react-server/useFormatter.d.ts +0 -2
  409. package/dist/types/src/react-server/useLocale.d.ts +0 -2
  410. package/dist/types/src/react-server/useMessages.d.ts +0 -2
  411. package/dist/types/src/react-server/useNow.d.ts +0 -2
  412. package/dist/types/src/react-server/useTimeZone.d.ts +0 -2
  413. package/dist/types/src/react-server/useTranslations.test.d.ts +0 -1
  414. package/dist/types/src/routing/defineRouting.test.d.ts +0 -1
  415. package/dist/types/src/routing/index.d.ts +0 -3
  416. package/dist/types/src/routing/types.test.d.ts +0 -1
  417. package/dist/types/src/routing.d.ts +0 -1
  418. package/dist/types/src/server/react-client/index.test.d.ts +0 -1
  419. package/dist/types/src/server/react-server/RequestLocaleCache.d.ts +0 -2
  420. package/dist/types/src/server/react-server/RequestLocaleLegacy.d.ts +0 -1
  421. package/dist/types/src/server/react-server/getLocale.d.ts +0 -3
  422. package/dist/types/src/server/react-server/getMessages.d.ts +0 -6
  423. package/dist/types/src/server/react-server/getNow.d.ts +0 -3
  424. package/dist/types/src/server/react-server/getTimeZone.d.ts +0 -3
  425. package/dist/types/src/server/react-server/getTranslations.d.ts +0 -92
  426. package/dist/types/src/server/react-server/index.d.ts +0 -14
  427. package/dist/types/src/server/react-server/index.test.d.ts +0 -1
  428. package/dist/types/src/server.react-client.d.ts +0 -1
  429. package/dist/types/src/server.react-server.d.ts +0 -1
  430. package/dist/types/src/shared/NextIntlClientProvider.test.d.ts +0 -1
  431. package/dist/types/src/shared/constants.d.ts +0 -3
  432. package/dist/types/src/shared/utils.test.d.ts +0 -1
  433. package/dist/types/test/setup.d.ts +0 -1
  434. /package/dist/esm/{config.js → production/config.js} +0 -0
  435. /package/dist/esm/{index.react-server.js → production/index.react-server.js} +0 -0
  436. /package/dist/esm/{middleware.js → production/middleware.js} +0 -0
  437. /package/dist/esm/{navigation → production/navigation}/react-server/getServerLocale.js +0 -0
  438. /package/dist/esm/{routing → production/routing}/defineRouting.js +0 -0
  439. /package/dist/esm/{routing.js → production/routing.js} +0 -0
  440. /package/dist/esm/{server → production/server}/react-server/RequestLocaleCache.js +0 -0
  441. /package/dist/esm/{server → production/server}/react-server/createRequestConfig.js +0 -0
  442. /package/dist/esm/{server → production/server}/react-server/getRequestConfig.js +0 -0
  443. /package/dist/esm/{react-server/getTranslator.js → production/server/react-server/getServerTranslator.js} +0 -0
  444. /package/dist/types/{src/config.d.ts → config.d.ts} +0 -0
  445. /package/dist/types/{src/navigation → navigation}/react-server/getServerLocale.d.ts +0 -0
  446. /package/dist/types/{src/navigation → navigation}/shared/StrictParams.d.ts +0 -0
  447. /package/dist/types/{src/react-server → react-server}/useTranslations.d.ts +0 -0
  448. /package/dist/types/{src/routing → routing}/types.d.ts +0 -0
  449. /package/dist/types/{src/server → server}/react-server/RequestLocale.d.ts +0 -0
  450. /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};
@@ -5,4 +5,4 @@
5
5
  * Note that the `react-server` environment (i.e. RSC) imports
6
6
  * from `./react-server` instead.
7
7
  */
8
- export * from './react-client';
8
+ export * from './react-client/index.tsx';
@@ -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
  */
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The middleware, available as `next-intl/middleware`.
3
3
  */
4
- export { default } from './middleware';
4
+ export { default } from './middleware.tsx';
@@ -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 { ResolvedRoutingConfig } from '../routing/config';
3
- import { DomainConfig, DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types';
4
- export declare function getAcceptLanguageLocale<AppLocales extends Locales>(requestHeaders: Headers, locales: AppLocales, defaultLocale: string): string | undefined;
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 { DomainConfig, DomainsConfig, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from '../routing/types';
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: string, domain: DomainConfig<AppLocales>): boolean;
22
- export declare function getBestMatchingDomain<AppLocales extends Locales>(curHostDomain: DomainConfig<AppLocales> | undefined, locale: string, domainsConfig: DomainsConfig<AppLocales>): DomainConfig<AppLocales> | undefined;
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 { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config';
2
- import { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types';
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: string;
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?: string;
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: string;
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?: string;
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: string;
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?: string;
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: string;
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: string;
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: string;
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
  };
@@ -0,0 +1,2 @@
1
+ export { default as createNavigation } from './createNavigation.tsx';
2
+ export type { QueryParams } from '../shared/utils.tsx';
@@ -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("../react-client").QueryParams;
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("../react-client").QueryParams;
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("../react-client").QueryParams;
326
+ query?: import("../shared/utils.tsx").QueryParams;
327
327
  } : T_1 | ({
328
328
  pathname: T_1;
329
329
  } & {
330
- query?: import("../react-client").QueryParams;
330
+ query?: import("../shared/utils.tsx").QueryParams;
331
331
  }) : never : never;
332
- locale: string;
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("../react-client").QueryParams;
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("../react-client").QueryParams;
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("../react-client").QueryParams;
351
+ query?: import("../shared/utils.tsx").QueryParams;
352
352
  } : T_1 | ({
353
353
  pathname: T_1;
354
354
  } & {
355
- query?: import("../react-client").QueryParams;
355
+ query?: import("../shared/utils.tsx").QueryParams;
356
356
  }) : never : never;
357
- locale: string;
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("../react-client").QueryParams;
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("../react-client").QueryParams;
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("../react-client").QueryParams;
376
+ query?: import("../shared/utils.tsx").QueryParams;
377
377
  } : T_1 | ({
378
378
  pathname: T_1;
379
379
  } & {
380
- query?: import("../react-client").QueryParams;
380
+ query?: import("../shared/utils.tsx").QueryParams;
381
381
  }) : never : never;
382
- locale: string;
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,2 @@
1
+ export { default as createNavigation } from './createNavigation.tsx';
2
+ export type { Pathnames } from '../../routing/types.tsx';
@@ -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;