next-intl 3.24.0 → 3.25.1
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/dist/development/middleware/middleware.js +2 -1
- package/dist/esm/middleware/middleware.js +1 -1
- package/dist/production/middleware/middleware.js +1 -1
- package/dist/types/src/navigation/react-client/createNavigation.d.ts +24 -24
- package/dist/types/src/navigation/react-client/index.d.ts +1 -0
- package/dist/types/src/navigation/react-client/redirects.d.ts +2 -2
- package/dist/types/src/navigation/react-server/createNavigation.d.ts +12 -12
- package/dist/types/src/navigation/react-server/redirects.d.ts +2 -2
- package/dist/types/src/routing/index.d.ts +2 -1
- package/dist/types/src/server/react-server/index.d.ts +1 -1
- package/package.json +3 -3
|
@@ -56,7 +56,8 @@ options) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function redirect(url, redirectDomain) {
|
|
59
|
-
const urlObj = new URL(
|
|
59
|
+
const urlObj = new URL(url, request.url);
|
|
60
|
+
urlObj.pathname = utils$1.normalizeTrailingSlash(urlObj.pathname);
|
|
60
61
|
if (domainsConfig.length > 0 && !redirectDomain && domain) {
|
|
61
62
|
const bestMatchingDomain = utils.getBestMatchingDomain(domain, locale, domainsConfig);
|
|
62
63
|
if (bestMatchingDomain) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as o}from"../routing/config.js";import{HEADER_LOCALE_NAME as l}from"../shared/constants.js";import{matchesPathname as t,normalizeTrailingSlash as
|
|
1
|
+
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as o}from"../routing/config.js";import{HEADER_LOCALE_NAME as l}from"../shared/constants.js";import{matchesPathname as t,normalizeTrailingSlash as a,getLocalePrefix as r}from"../shared/utils.js";import n from"./getAlternateLinksHeaderValue.js";import i from"./resolveLocale.js";import s from"./syncCookie.js";import{sanitizePathname as c,isLocaleSupportedOnDomain as d,getNormalizedPathname as f,getPathnameMatch as m,getInternalTemplate as h,formatTemplatePathname as u,formatPathname as x,getBestMatchingDomain as p,applyBasePath as v,getLocaleAsPrefix as U}from"./utils.js";function P(P,k){var L,g,j;const w=o({...P,alternateLinks:null!==(L=null==k?void 0:k.alternateLinks)&&void 0!==L?L:P.alternateLinks,localeDetection:null!==(g=null==k?void 0:k.localeDetection)&&void 0!==g?g:P.localeDetection,localeCookie:null!==(j=null==k?void 0:k.localeCookie)&&void 0!==j?j:P.localeCookie});return function(o){var P;let k;try{k=decodeURI(o.nextUrl.pathname)}catch(o){return e.next()}const L=c(k),{domain:g,locale:j}=i(w,o.headers,o.cookies,L),C=g?g.defaultLocale===j:j===w.defaultLocale,b=(null===(P=w.domains)||void 0===P?void 0:P.filter((e=>d(j,e))))||[],y=null!=w.domains&&!g;function D(t){const a=new URL(t,o.url);o.nextUrl.basePath&&(a.pathname=v(a.pathname,o.nextUrl.basePath));const r=new Headers(o.headers);return r.set(l,j),e.rewrite(a,{request:{headers:r}})}function R(l,t){const r=new URL(l,o.url);if(r.pathname=a(r.pathname),b.length>0&&!t&&g){const e=p(g,j,b);e&&(t=e.domain,e.defaultLocale===j&&"as-needed"===w.localePrefix.mode&&(r.pathname=f(r.pathname,w.locales,w.localePrefix)))}var n,i;t&&(r.host=t,o.headers.get("x-forwarded-host")&&(r.protocol=null!==(n=o.headers.get("x-forwarded-proto"))&&void 0!==n?n:o.nextUrl.protocol,r.port=null!==(i=o.headers.get("x-forwarded-port"))&&void 0!==i?i:""));return o.nextUrl.basePath&&(r.pathname=v(r.pathname,o.nextUrl.basePath)),e.redirect(r.toString())}const q=f(L,w.locales,w.localePrefix),H=m(L,w.locales,w.localePrefix),z=null!=H,A="never"===w.localePrefix.mode||C&&"as-needed"===w.localePrefix.mode;let I,S,V=q;const B=w.pathnames;if(B){let e;if([e,S]=h(B,q,j),S){const l=B[S],a="string"==typeof l?l:l[j];if(t(a,q))V=u(q,a,S);else{let t;t=e?"string"==typeof l?l:l[e]:S;const n=A?void 0:r(j,w.localePrefix),i=u(q,t,a);I=R(x(i,n,o.nextUrl.search))}}}if(!I)if("/"!==V||z){const e=x(V,U(j),o.nextUrl.search);if(z){const l=x(q,H.prefix,o.nextUrl.search);if("never"===w.localePrefix.mode)I=R(x(q,void 0,o.nextUrl.search));else if(H.exact)if(C&&A)I=R(x(q,void 0,o.nextUrl.search));else if(w.domains){const o=p(g,H.locale,b);I=(null==g?void 0:g.domain)===(null==o?void 0:o.domain)||y?D(e):R(l,null==o?void 0:o.domain)}else I=D(e);else I=R(l)}else I=A?D(e):R(x(q,r(j,w.localePrefix),o.nextUrl.search))}else I=A?D(x(V,U(j),o.nextUrl.search)):R(x(q,r(j,w.localePrefix),o.nextUrl.search));return w.localeDetection&&w.localeCookie&&s(o,I,j,w.localeCookie),"never"!==w.localePrefix.mode&&w.alternateLinks&&w.locales.length>1&&I.headers.set("Link",n({routing:w,localizedPathnames:null!=S&&B?B[S]:void 0,request:o,resolvedLocale:j})),I}}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,h,m;const f=a.receiveRoutingConfig({...s,alternateLinks:null!==(d=null==c?void 0:c.alternateLinks)&&void 0!==d?d:s.alternateLinks,localeDetection:null!==(h=null==c?void 0:c.localeDetection)&&void 0!==h?h:s.localeDetection,localeCookie:null!==(m=null==c?void 0:c.localeCookie)&&void 0!==m?m:s.localeCookie});return function(a){var s;let c;try{c=decodeURI(a.nextUrl.pathname)}catch(a){return e.NextResponse.next()}const d=i.sanitizePathname(c),{domain:h,locale:m}=n.default(f,a.headers,a.cookies,d),u=h?h.defaultLocale===m:m===f.defaultLocale,x=(null===(s=f.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(m,e))))||[],P=null!=f.domains&&!h;function p(l){const o=new URL(l,a.url);a.nextUrl.basePath&&(o.pathname=i.applyBasePath(o.pathname,a.nextUrl.basePath));const n=new Headers(a.headers);return n.set(t.HEADER_LOCALE_NAME,m),e.NextResponse.rewrite(o,{request:{headers:n}})}function v(t,o){const n=new URL(t,a.url);if(n.pathname=l.normalizeTrailingSlash(n.pathname),x.length>0&&!o&&h){const e=i.getBestMatchingDomain(h,m,x);e&&(o=e.domain,e.defaultLocale===m&&"as-needed"===f.localePrefix.mode&&(n.pathname=i.getNormalizedPathname(n.pathname,f.locales,f.localePrefix)))}var r,s;o&&(n.host=o,a.headers.get("x-forwarded-host")&&(n.protocol=null!==(r=a.headers.get("x-forwarded-proto"))&&void 0!==r?r:a.nextUrl.protocol,n.port=null!==(s=a.headers.get("x-forwarded-port"))&&void 0!==s?s:""));return a.nextUrl.basePath&&(n.pathname=i.applyBasePath(n.pathname,a.nextUrl.basePath)),e.NextResponse.redirect(n.toString())}const g=i.getNormalizedPathname(d,f.locales,f.localePrefix),L=i.getPathnameMatch(d,f.locales,f.localePrefix),U=null!=L,k="never"===f.localePrefix.mode||u&&"as-needed"===f.localePrefix.mode;let q,j,C=g;const D=f.pathnames;if(D){let e;if([e,j]=i.getInternalTemplate(D,g,m),j){const t=D[j],o="string"==typeof t?t:t[m];if(l.matchesPathname(o,g))C=i.formatTemplatePathname(g,o,j);else{let n;n=e?"string"==typeof t?t:t[e]:j;const r=k?void 0:l.getLocalePrefix(m,f.localePrefix),s=i.formatTemplatePathname(g,n,o);q=v(i.formatPathname(s,r,a.nextUrl.search))}}}if(!q)if("/"!==C||U){const e=i.formatPathname(C,i.getLocaleAsPrefix(m),a.nextUrl.search);if(U){const t=i.formatPathname(g,L.prefix,a.nextUrl.search);if("never"===f.localePrefix.mode)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(L.exact)if(u&&k)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(f.domains){const a=i.getBestMatchingDomain(h,L.locale,x);q=(null==h?void 0:h.domain)===(null==a?void 0:a.domain)||P?p(e):v(t,null==a?void 0:a.domain)}else q=p(e);else q=v(t)}else q=k?p(e):v(i.formatPathname(g,l.getLocalePrefix(m,f.localePrefix),a.nextUrl.search))}else q=k?p(i.formatPathname(C,i.getLocaleAsPrefix(m),a.nextUrl.search)):v(i.formatPathname(g,l.getLocalePrefix(m,f.localePrefix),a.nextUrl.search));return f.localeDetection&&f.localeCookie&&r.default(a,q,m,f.localeCookie),"never"!==f.localePrefix.mode&&f.alternateLinks&&f.locales.length>1&&q.headers.set("Link",o.default({routing:f,localizedPathnames:null!=j&&D?D[j]:void 0,request:a,resolvedLocale:m})),q}};
|
|
@@ -314,21 +314,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
314
314
|
push: (href: Parameters<(args: {
|
|
315
315
|
href: [AppPathnames] extends [never] ? string | {
|
|
316
316
|
pathname: string;
|
|
317
|
-
query?: import("
|
|
317
|
+
query?: import(".").QueryParams;
|
|
318
318
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
319
319
|
pathname: T_1;
|
|
320
320
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
321
321
|
} & {
|
|
322
|
-
query?: import("
|
|
322
|
+
query?: import(".").QueryParams;
|
|
323
323
|
}) : T_1 extends `${string}[${string}` ? {
|
|
324
324
|
pathname: T_1;
|
|
325
325
|
params: import("../shared/StrictParams").default<T_1>;
|
|
326
326
|
} & {
|
|
327
|
-
query?: import("
|
|
327
|
+
query?: import(".").QueryParams;
|
|
328
328
|
} : T_1 | ({
|
|
329
329
|
pathname: T_1;
|
|
330
330
|
} & {
|
|
331
|
-
query?: import("
|
|
331
|
+
query?: import(".").QueryParams;
|
|
332
332
|
}) : never : never;
|
|
333
333
|
locale: string;
|
|
334
334
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
@@ -340,21 +340,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
340
340
|
replace: (href: Parameters<(args: {
|
|
341
341
|
href: [AppPathnames] extends [never] ? string | {
|
|
342
342
|
pathname: string;
|
|
343
|
-
query?: import("
|
|
343
|
+
query?: import(".").QueryParams;
|
|
344
344
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
345
345
|
pathname: T_1;
|
|
346
346
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
347
347
|
} & {
|
|
348
|
-
query?: import("
|
|
348
|
+
query?: import(".").QueryParams;
|
|
349
349
|
}) : T_1 extends `${string}[${string}` ? {
|
|
350
350
|
pathname: T_1;
|
|
351
351
|
params: import("../shared/StrictParams").default<T_1>;
|
|
352
352
|
} & {
|
|
353
|
-
query?: import("
|
|
353
|
+
query?: import(".").QueryParams;
|
|
354
354
|
} : T_1 | ({
|
|
355
355
|
pathname: T_1;
|
|
356
356
|
} & {
|
|
357
|
-
query?: import("
|
|
357
|
+
query?: import(".").QueryParams;
|
|
358
358
|
}) : never : never;
|
|
359
359
|
locale: string;
|
|
360
360
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
@@ -366,21 +366,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
366
366
|
prefetch: (href: Parameters<(args: {
|
|
367
367
|
href: [AppPathnames] extends [never] ? string | {
|
|
368
368
|
pathname: string;
|
|
369
|
-
query?: import("
|
|
369
|
+
query?: import(".").QueryParams;
|
|
370
370
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
371
371
|
pathname: T_1;
|
|
372
372
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
373
373
|
} & {
|
|
374
|
-
query?: import("
|
|
374
|
+
query?: import(".").QueryParams;
|
|
375
375
|
}) : T_1 extends `${string}[${string}` ? {
|
|
376
376
|
pathname: T_1;
|
|
377
377
|
params: import("../shared/StrictParams").default<T_1>;
|
|
378
378
|
} & {
|
|
379
|
-
query?: import("
|
|
379
|
+
query?: import(".").QueryParams;
|
|
380
380
|
} : T_1 | ({
|
|
381
381
|
pathname: T_1;
|
|
382
382
|
} & {
|
|
383
|
-
query?: import("
|
|
383
|
+
query?: import(".").QueryParams;
|
|
384
384
|
}) : never : never;
|
|
385
385
|
locale: string;
|
|
386
386
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
@@ -395,21 +395,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
395
395
|
getPathname: (args: {
|
|
396
396
|
href: [AppPathnames] extends [never] ? string | {
|
|
397
397
|
pathname: string;
|
|
398
|
-
query?: import("
|
|
398
|
+
query?: import(".").QueryParams;
|
|
399
399
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
400
400
|
pathname: T_1;
|
|
401
401
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
402
402
|
} & {
|
|
403
|
-
query?: import("
|
|
403
|
+
query?: import(".").QueryParams;
|
|
404
404
|
}) : T_1 extends `${string}[${string}` ? {
|
|
405
405
|
pathname: T_1;
|
|
406
406
|
params: import("../shared/StrictParams").default<T_1>;
|
|
407
407
|
} & {
|
|
408
|
-
query?: import("
|
|
408
|
+
query?: import(".").QueryParams;
|
|
409
409
|
} : T_1 | ({
|
|
410
410
|
pathname: T_1;
|
|
411
411
|
} & {
|
|
412
|
-
query?: import("
|
|
412
|
+
query?: import(".").QueryParams;
|
|
413
413
|
}) : never : never;
|
|
414
414
|
locale: string;
|
|
415
415
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
@@ -418,21 +418,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
418
418
|
redirect: (args: Omit<{
|
|
419
419
|
href: [AppPathnames] extends [never] ? string | {
|
|
420
420
|
pathname: string;
|
|
421
|
-
query?: import("
|
|
421
|
+
query?: import(".").QueryParams;
|
|
422
422
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
423
423
|
pathname: T_1;
|
|
424
424
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
425
425
|
} & {
|
|
426
|
-
query?: import("
|
|
426
|
+
query?: import(".").QueryParams;
|
|
427
427
|
}) : T_1 extends `${string}[${string}` ? {
|
|
428
428
|
pathname: T_1;
|
|
429
429
|
params: import("../shared/StrictParams").default<T_1>;
|
|
430
430
|
} & {
|
|
431
|
-
query?: import("
|
|
431
|
+
query?: import(".").QueryParams;
|
|
432
432
|
} : T_1 | ({
|
|
433
433
|
pathname: T_1;
|
|
434
434
|
} & {
|
|
435
|
-
query?: import("
|
|
435
|
+
query?: import(".").QueryParams;
|
|
436
436
|
}) : never : never;
|
|
437
437
|
locale: string;
|
|
438
438
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
@@ -443,21 +443,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
443
443
|
permanentRedirect: (args: Omit<{
|
|
444
444
|
href: [AppPathnames] extends [never] ? string | {
|
|
445
445
|
pathname: string;
|
|
446
|
-
query?: import("
|
|
446
|
+
query?: import(".").QueryParams;
|
|
447
447
|
} : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
|
|
448
448
|
pathname: T_1;
|
|
449
449
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
450
450
|
} & {
|
|
451
|
-
query?: import("
|
|
451
|
+
query?: import(".").QueryParams;
|
|
452
452
|
}) : T_1 extends `${string}[${string}` ? {
|
|
453
453
|
pathname: T_1;
|
|
454
454
|
params: import("../shared/StrictParams").default<T_1>;
|
|
455
455
|
} & {
|
|
456
|
-
query?: import("
|
|
456
|
+
query?: import(".").QueryParams;
|
|
457
457
|
} : T_1 | ({
|
|
458
458
|
pathname: T_1;
|
|
459
459
|
} & {
|
|
460
|
-
query?: import("
|
|
460
|
+
query?: import(".").QueryParams;
|
|
461
461
|
}) : never : never;
|
|
462
462
|
locale: string;
|
|
463
463
|
} & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as createSharedPathnamesNavigation } from './createSharedPathnamesNavigation';
|
|
2
2
|
export { default as createLocalizedPathnamesNavigation } from './createLocalizedPathnamesNavigation';
|
|
3
3
|
export { default as createNavigation } from './createNavigation';
|
|
4
|
+
export type { QueryParams } from '../shared/utils';
|
|
4
5
|
import type { Locales, Pathnames as PathnamesDeprecatedExport } from '../../routing/types';
|
|
5
6
|
/** @deprecated Please import from `next-intl/routing` instead. */
|
|
6
7
|
export type Pathnames<AppLocales extends Locales> = PathnamesDeprecatedExport<AppLocales>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const clientRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing
|
|
1
|
+
export declare const clientRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing").LocalePrefixMode>(params: {
|
|
2
2
|
pathname: string;
|
|
3
3
|
locale: import("../../routing/types").Locales[number];
|
|
4
4
|
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
|
|
5
5
|
}, type?: import("next/navigation").RedirectType | undefined) => never)>[0], "locale">, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
6
|
-
export declare const clientPermanentRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing
|
|
6
|
+
export declare const clientPermanentRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing").LocalePrefixMode>(params: {
|
|
7
7
|
pathname: string;
|
|
8
8
|
locale: import("../../routing/types").Locales[number];
|
|
9
9
|
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
|
|
@@ -313,21 +313,21 @@ 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("../react-client").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
319
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
320
320
|
} & {
|
|
321
|
-
query?: import("../
|
|
321
|
+
query?: import("../react-client").QueryParams;
|
|
322
322
|
}) : T_1 extends `${string}[${string}` ? {
|
|
323
323
|
pathname: T_1;
|
|
324
324
|
params: import("../shared/StrictParams").default<T_1>;
|
|
325
325
|
} & {
|
|
326
|
-
query?: import("../
|
|
326
|
+
query?: import("../react-client").QueryParams;
|
|
327
327
|
} : T_1 | ({
|
|
328
328
|
pathname: T_1;
|
|
329
329
|
} & {
|
|
330
|
-
query?: import("../
|
|
330
|
+
query?: import("../react-client").QueryParams;
|
|
331
331
|
}) : never : never;
|
|
332
332
|
locale: string;
|
|
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] ? {} : {
|
|
@@ -338,21 +338,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
338
338
|
permanentRedirect: (args: Omit<{
|
|
339
339
|
href: [AppPathnames] extends [never] ? string | {
|
|
340
340
|
pathname: string;
|
|
341
|
-
query?: import("../
|
|
341
|
+
query?: import("../react-client").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
344
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
345
345
|
} & {
|
|
346
|
-
query?: import("../
|
|
346
|
+
query?: import("../react-client").QueryParams;
|
|
347
347
|
}) : T_1 extends `${string}[${string}` ? {
|
|
348
348
|
pathname: T_1;
|
|
349
349
|
params: import("../shared/StrictParams").default<T_1>;
|
|
350
350
|
} & {
|
|
351
|
-
query?: import("../
|
|
351
|
+
query?: import("../react-client").QueryParams;
|
|
352
352
|
} : T_1 | ({
|
|
353
353
|
pathname: T_1;
|
|
354
354
|
} & {
|
|
355
|
-
query?: import("../
|
|
355
|
+
query?: import("../react-client").QueryParams;
|
|
356
356
|
}) : never : never;
|
|
357
357
|
locale: string;
|
|
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] ? {} : {
|
|
@@ -363,21 +363,21 @@ export default function createNavigation<const AppLocales extends Locales, const
|
|
|
363
363
|
getPathname: (args: {
|
|
364
364
|
href: [AppPathnames] extends [never] ? string | {
|
|
365
365
|
pathname: string;
|
|
366
|
-
query?: import("../
|
|
366
|
+
query?: import("../react-client").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
369
|
params?: import("../shared/StrictParams").default<T_1> | undefined;
|
|
370
370
|
} & {
|
|
371
|
-
query?: import("../
|
|
371
|
+
query?: import("../react-client").QueryParams;
|
|
372
372
|
}) : T_1 extends `${string}[${string}` ? {
|
|
373
373
|
pathname: T_1;
|
|
374
374
|
params: import("../shared/StrictParams").default<T_1>;
|
|
375
375
|
} & {
|
|
376
|
-
query?: import("../
|
|
376
|
+
query?: import("../react-client").QueryParams;
|
|
377
377
|
} : T_1 | ({
|
|
378
378
|
pathname: T_1;
|
|
379
379
|
} & {
|
|
380
|
-
query?: import("../
|
|
380
|
+
query?: import("../react-client").QueryParams;
|
|
381
381
|
}) : never : never;
|
|
382
382
|
locale: string;
|
|
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] ? {} : {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const serverRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing
|
|
1
|
+
export declare const serverRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing").LocalePrefixMode>(params: {
|
|
2
2
|
pathname: string;
|
|
3
3
|
locale: import("../../routing/types").Locales[number];
|
|
4
4
|
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
|
|
5
5
|
}, type?: import("next/navigation").RedirectType | undefined) => never)>[0], "locale">, type?: import("next/navigation").RedirectType | undefined) => never;
|
|
6
|
-
export declare const serverPermanentRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing
|
|
6
|
+
export declare const serverPermanentRedirect: (params: Omit<Parameters<(<AppLocales extends import("../../routing/types").Locales, AppLocalePrefixMode extends import("../../routing").LocalePrefixMode>(params: {
|
|
7
7
|
pathname: string;
|
|
8
8
|
locale: import("../../routing/types").Locales[number];
|
|
9
9
|
localePrefix: import("../../routing/types").LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-only APIs available via `next-intl/server`.
|
|
3
3
|
*/
|
|
4
|
-
export { default as getRequestConfig } from './getRequestConfig';
|
|
4
|
+
export { default as getRequestConfig, type GetRequestConfigParams, type RequestConfig } from './getRequestConfig';
|
|
5
5
|
export { default as getFormatter } from './getFormatter';
|
|
6
6
|
export { default as getNow } from './getNow';
|
|
7
7
|
export { default as getTimeZone } from './getTimeZone';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@formatjs/intl-localematcher": "^0.5.4",
|
|
90
90
|
"negotiator": "^1.0.0",
|
|
91
|
-
"use-intl": "^3.
|
|
91
|
+
"use-intl": "^3.25.1"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
95
95
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "e7baf7194fd179163bcdee405bb00e49657f09b6"
|
|
98
98
|
}
|