next-intl 4.0.0-beta-f511797 → 4.0.0-beta-5b218d4

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 (41) hide show
  1. package/dist/types/index.react-client.d.ts +1 -1
  2. package/dist/types/index.react-server.d.ts +1 -1
  3. package/dist/types/middleware/getAlternateLinksHeaderValue.d.ts +2 -2
  4. package/dist/types/middleware/index.d.ts +1 -1
  5. package/dist/types/middleware/middleware.d.ts +2 -2
  6. package/dist/types/middleware/resolveLocale.d.ts +2 -2
  7. package/dist/types/middleware/syncCookie.d.ts +2 -2
  8. package/dist/types/middleware/utils.d.ts +1 -1
  9. package/dist/types/middleware.d.ts +1 -1
  10. package/dist/types/navigation/react-client/createNavigation.d.ts +40 -40
  11. package/dist/types/navigation/react-client/index.d.ts +2 -2
  12. package/dist/types/navigation/react-client/useBasePathname.d.ts +1 -1
  13. package/dist/types/navigation/react-server/createNavigation.d.ts +22 -22
  14. package/dist/types/navigation/react-server/index.d.ts +2 -2
  15. package/dist/types/navigation/shared/BaseLink.d.ts +1 -1
  16. package/dist/types/navigation/shared/createSharedNavigationFns.d.ts +6 -6
  17. package/dist/types/navigation/shared/syncLocaleCookie.d.ts +1 -1
  18. package/dist/types/navigation/shared/utils.d.ts +3 -3
  19. package/dist/types/navigation.react-client.d.ts +1 -1
  20. package/dist/types/navigation.react-server.d.ts +1 -1
  21. package/dist/types/plugin/createNextIntlPlugin.d.ts +1 -1
  22. package/dist/types/plugin/getNextConfig.d.ts +1 -1
  23. package/dist/types/plugin/index.d.ts +1 -1
  24. package/dist/types/plugin.d.ts +1 -1
  25. package/dist/types/react-client/index.d.ts +1 -1
  26. package/dist/types/react-server/NextIntlClientProviderServer.d.ts +1 -1
  27. package/dist/types/react-server/index.d.ts +7 -7
  28. package/dist/types/react-server/useConfig.d.ts +1 -1
  29. package/dist/types/routing/config.d.ts +1 -1
  30. package/dist/types/routing/defineRouting.d.ts +2 -2
  31. package/dist/types/routing/index.d.ts +3 -3
  32. package/dist/types/routing/validateLocales.d.ts +1 -1
  33. package/dist/types/routing.d.ts +1 -1
  34. package/dist/types/server/react-client/index.d.ts +1 -1
  35. package/dist/types/server/react-server/createRequestConfig.d.ts +1 -1
  36. package/dist/types/server/react-server/getMessages.d.ts +1 -1
  37. package/dist/types/server/react-server/index.d.ts +8 -8
  38. package/dist/types/server.react-client.d.ts +1 -1
  39. package/dist/types/server.react-server.d.ts +1 -1
  40. package/dist/types/shared/utils.d.ts +1 -1
  41. package/package.json +12 -4
@@ -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/index.tsx';
8
+ export * from './react-client/index.js';
@@ -1 +1 @@
1
- export * from './react-server/index.tsx';
1
+ export * from './react-server/index.js';
@@ -1,6 +1,6 @@
1
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';
2
+ import type { ResolvedRoutingConfig } from '../routing/config.js';
3
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.js';
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.tsx';
4
+ export { default } from './middleware.js';
@@ -1,4 +1,4 @@
1
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';
2
+ import { type RoutingConfig } from '../routing/config.js';
3
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.js';
4
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,7 @@
1
1
  import type { RequestCookies } from 'next/dist/server/web/spec-extension/cookies.js';
2
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';
3
+ import type { ResolvedRoutingConfig } from '../routing/config.js';
4
+ import type { DomainConfig, DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.js';
5
5
  export declare function getAcceptLanguageLocale<AppLocales extends Locales>(requestHeaders: Headers, locales: AppLocales, defaultLocale: Locale): string | undefined;
6
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): {
7
7
  locale: AppLocales[number];
@@ -1,7 +1,7 @@
1
1
  import type { NextRequest, NextResponse } from 'next/server.js';
2
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';
3
+ import type { InitializedLocaleCookieConfig, ResolvedRoutingConfig } from '../routing/config.js';
4
+ import type { DomainConfig, DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types.js';
5
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
6
  localeCookie: InitializedLocaleCookieConfig;
7
7
  }, domain?: DomainConfig<AppLocales>): void;
@@ -1,5 +1,5 @@
1
1
  import type { Locale } from 'use-intl';
2
- import type { DomainConfig, DomainsConfig, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from '../routing/types.tsx';
2
+ import type { DomainConfig, DomainsConfig, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from '../routing/types.js';
3
3
  export declare function getFirstPathnameSegment(pathname: string): string;
4
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];
5
5
  export declare function formatTemplatePathname(sourcePathname: string, sourceTemplate: string, targetTemplate: string, prefix?: string): string;
@@ -1 +1 @@
1
- export { default } from './middleware/index.tsx';
1
+ export { default } from './middleware/index.js';
@@ -1,6 +1,6 @@
1
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';
2
+ import type { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config.js';
3
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.js';
4
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>): {
5
5
  Link: import("react").ForwardRefExoticComponent<Omit<{
6
6
  slot?: string | undefined;
@@ -301,10 +301,10 @@ export default function createNavigation<const AppLocales extends Locales, const
301
301
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
302
302
  href: [AppPathnames] extends [never] ? string | import("url").UrlObject : keyof AppPathnames extends infer T ? T extends keyof AppPathnames ? T extends `${string}[[...${string}` ? T | ({
303
303
  pathname: T;
304
- params?: import("../shared/StrictParams.tsx").default<T> | undefined;
304
+ params?: import("../shared/StrictParams.js").default<T> | undefined;
305
305
  } & Omit<import("url").UrlObject, "pathname">) : T extends `${string}[${string}` ? {
306
306
  pathname: T;
307
- params: import("../shared/StrictParams.tsx").default<T>;
307
+ params: import("../shared/StrictParams.js").default<T>;
308
308
  } & Omit<import("url").UrlObject, "pathname"> : T | ({
309
309
  pathname: T;
310
310
  } & Omit<import("url").UrlObject, "pathname">) : never : never;
@@ -315,21 +315,21 @@ export default function createNavigation<const AppLocales extends Locales, const
315
315
  push: (href: Parameters<(args: {
316
316
  href: [AppPathnames] extends [never] ? string | {
317
317
  pathname: string;
318
- query?: import("../shared/utils.tsx").QueryParams;
318
+ query?: import("../shared/utils.js").QueryParams;
319
319
  } : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
320
320
  pathname: T_1;
321
- params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
321
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
322
322
  } & {
323
- query?: import("../shared/utils.tsx").QueryParams;
323
+ query?: import("../shared/utils.js").QueryParams;
324
324
  }) : T_1 extends `${string}[${string}` ? {
325
325
  pathname: T_1;
326
- params: import("../shared/StrictParams.tsx").default<T_1>;
326
+ params: import("../shared/StrictParams.js").default<T_1>;
327
327
  } & {
328
- query?: import("../shared/utils.tsx").QueryParams;
328
+ query?: import("../shared/utils.js").QueryParams;
329
329
  } : T_1 | ({
330
330
  pathname: T_1;
331
331
  } & {
332
- query?: import("../shared/utils.tsx").QueryParams;
332
+ query?: import("../shared/utils.js").QueryParams;
333
333
  }) : never : never;
334
334
  locale: Locale;
335
335
  } & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
@@ -341,21 +341,21 @@ export default function createNavigation<const AppLocales extends Locales, const
341
341
  replace: (href: Parameters<(args: {
342
342
  href: [AppPathnames] extends [never] ? string | {
343
343
  pathname: string;
344
- query?: import("../shared/utils.tsx").QueryParams;
344
+ query?: import("../shared/utils.js").QueryParams;
345
345
  } : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
346
346
  pathname: T_1;
347
- params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
347
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
348
348
  } & {
349
- query?: import("../shared/utils.tsx").QueryParams;
349
+ query?: import("../shared/utils.js").QueryParams;
350
350
  }) : T_1 extends `${string}[${string}` ? {
351
351
  pathname: T_1;
352
- params: import("../shared/StrictParams.tsx").default<T_1>;
352
+ params: import("../shared/StrictParams.js").default<T_1>;
353
353
  } & {
354
- query?: import("../shared/utils.tsx").QueryParams;
354
+ query?: import("../shared/utils.js").QueryParams;
355
355
  } : T_1 | ({
356
356
  pathname: T_1;
357
357
  } & {
358
- query?: import("../shared/utils.tsx").QueryParams;
358
+ query?: import("../shared/utils.js").QueryParams;
359
359
  }) : never : never;
360
360
  locale: Locale;
361
361
  } & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
@@ -367,21 +367,21 @@ export default function createNavigation<const AppLocales extends Locales, const
367
367
  prefetch: (href: Parameters<(args: {
368
368
  href: [AppPathnames] extends [never] ? string | {
369
369
  pathname: string;
370
- query?: import("../shared/utils.tsx").QueryParams;
370
+ query?: import("../shared/utils.js").QueryParams;
371
371
  } : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
372
372
  pathname: T_1;
373
- params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
373
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
374
374
  } & {
375
- query?: import("../shared/utils.tsx").QueryParams;
375
+ query?: import("../shared/utils.js").QueryParams;
376
376
  }) : T_1 extends `${string}[${string}` ? {
377
377
  pathname: T_1;
378
- params: import("../shared/StrictParams.tsx").default<T_1>;
378
+ params: import("../shared/StrictParams.js").default<T_1>;
379
379
  } & {
380
- query?: import("../shared/utils.tsx").QueryParams;
380
+ query?: import("../shared/utils.js").QueryParams;
381
381
  } : T_1 | ({
382
382
  pathname: T_1;
383
383
  } & {
384
- query?: import("../shared/utils.tsx").QueryParams;
384
+ query?: import("../shared/utils.js").QueryParams;
385
385
  }) : never : never;
386
386
  locale: Locale;
387
387
  } & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
@@ -396,21 +396,21 @@ export default function createNavigation<const AppLocales extends Locales, const
396
396
  getPathname: (args: {
397
397
  href: [AppPathnames] extends [never] ? string | {
398
398
  pathname: string;
399
- query?: import("../shared/utils.tsx").QueryParams;
399
+ query?: import("../shared/utils.js").QueryParams;
400
400
  } : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
401
401
  pathname: T_1;
402
- params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
402
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
403
403
  } & {
404
- query?: import("../shared/utils.tsx").QueryParams;
404
+ query?: import("../shared/utils.js").QueryParams;
405
405
  }) : T_1 extends `${string}[${string}` ? {
406
406
  pathname: T_1;
407
- params: import("../shared/StrictParams.tsx").default<T_1>;
407
+ params: import("../shared/StrictParams.js").default<T_1>;
408
408
  } & {
409
- query?: import("../shared/utils.tsx").QueryParams;
409
+ query?: import("../shared/utils.js").QueryParams;
410
410
  } : T_1 | ({
411
411
  pathname: T_1;
412
412
  } & {
413
- query?: import("../shared/utils.tsx").QueryParams;
413
+ query?: import("../shared/utils.js").QueryParams;
414
414
  }) : never : never;
415
415
  locale: Locale;
416
416
  } & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
@@ -419,21 +419,21 @@ export default function createNavigation<const AppLocales extends Locales, const
419
419
  redirect: (args: Omit<{
420
420
  href: [AppPathnames] extends [never] ? string | {
421
421
  pathname: string;
422
- query?: import("../shared/utils.tsx").QueryParams;
422
+ query?: import("../shared/utils.js").QueryParams;
423
423
  } : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
424
424
  pathname: T_1;
425
- params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
425
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
426
426
  } & {
427
- query?: import("../shared/utils.tsx").QueryParams;
427
+ query?: import("../shared/utils.js").QueryParams;
428
428
  }) : T_1 extends `${string}[${string}` ? {
429
429
  pathname: T_1;
430
- params: import("../shared/StrictParams.tsx").default<T_1>;
430
+ params: import("../shared/StrictParams.js").default<T_1>;
431
431
  } & {
432
- query?: import("../shared/utils.tsx").QueryParams;
432
+ query?: import("../shared/utils.js").QueryParams;
433
433
  } : T_1 | ({
434
434
  pathname: T_1;
435
435
  } & {
436
- query?: import("../shared/utils.tsx").QueryParams;
436
+ query?: import("../shared/utils.js").QueryParams;
437
437
  }) : never : never;
438
438
  locale: Locale;
439
439
  } & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
@@ -444,21 +444,21 @@ export default function createNavigation<const AppLocales extends Locales, const
444
444
  permanentRedirect: (args: Omit<{
445
445
  href: [AppPathnames] extends [never] ? string | {
446
446
  pathname: string;
447
- query?: import("../shared/utils.tsx").QueryParams;
447
+ query?: import("../shared/utils.js").QueryParams;
448
448
  } : keyof AppPathnames extends infer T_1 ? T_1 extends keyof AppPathnames ? T_1 extends `${string}[[...${string}` ? T_1 | ({
449
449
  pathname: T_1;
450
- params?: import("../shared/StrictParams.tsx").default<T_1> | undefined;
450
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
451
451
  } & {
452
- query?: import("../shared/utils.tsx").QueryParams;
452
+ query?: import("../shared/utils.js").QueryParams;
453
453
  }) : T_1 extends `${string}[${string}` ? {
454
454
  pathname: T_1;
455
- params: import("../shared/StrictParams.tsx").default<T_1>;
455
+ params: import("../shared/StrictParams.js").default<T_1>;
456
456
  } & {
457
- query?: import("../shared/utils.tsx").QueryParams;
457
+ query?: import("../shared/utils.js").QueryParams;
458
458
  } : T_1 | ({
459
459
  pathname: T_1;
460
460
  } & {
461
- query?: import("../shared/utils.tsx").QueryParams;
461
+ query?: import("../shared/utils.js").QueryParams;
462
462
  }) : never : never;
463
463
  locale: Locale;
464
464
  } & (([AppPathnames] extends [never] ? RoutingConfigSharedNavigation<AppLocales, AppLocalePrefixMode, AppDomains> | undefined : RoutingConfigLocalizedNavigation<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>) | undefined extends undefined ? {} : AppLocalePrefixMode extends "as-needed" ? [AppDomains] extends [never] ? {} : {
@@ -1,2 +1,2 @@
1
- export { default as createNavigation } from './createNavigation.tsx';
2
- export type { QueryParams } from '../shared/utils.tsx';
1
+ export { default as createNavigation } from './createNavigation.js';
2
+ export type { QueryParams } from '../shared/utils.js';
@@ -1,4 +1,4 @@
1
- import type { LocalePrefixConfigVerbose, LocalePrefixMode, Locales } from '../../routing/types.tsx';
1
+ import type { LocalePrefixConfigVerbose, LocalePrefixMode, Locales } from '../../routing/types.js';
2
2
  export default function useBasePathname<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode>(config: {
3
3
  localePrefix: LocalePrefixConfigVerbose<AppLocales, AppLocalePrefixMode>;
4
4
  defaultLocale?: AppLocales[number];
@@ -1,5 +1,5 @@
1
- import type { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config.tsx';
2
- import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.tsx';
1
+ import type { RoutingConfigLocalizedNavigation, RoutingConfigSharedNavigation } from '../../routing/config.js';
2
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.js';
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;
@@ -302,10 +302,10 @@ export default function createNavigation<const AppLocales extends Locales, const
302
302
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | 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.tsx").default<T> | undefined;
305
+ params?: import("../shared/StrictParams.js").default<T> | undefined;
306
306
  } & Omit<import("url").UrlObject, "pathname">) : T extends `${string}[${string}` ? {
307
307
  pathname: T;
308
- params: import("../shared/StrictParams.tsx").default<T>;
308
+ params: import("../shared/StrictParams.js").default<T>;
309
309
  } & Omit<import("url").UrlObject, "pathname"> : T | ({
310
310
  pathname: T;
311
311
  } & Omit<import("url").UrlObject, "pathname">) : never : never;
@@ -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("../shared/utils.tsx").QueryParams;
316
+ query?: import("../shared/utils.js").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.tsx").default<T_1> | undefined;
319
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
320
320
  } & {
321
- query?: import("../shared/utils.tsx").QueryParams;
321
+ query?: import("../shared/utils.js").QueryParams;
322
322
  }) : T_1 extends `${string}[${string}` ? {
323
323
  pathname: T_1;
324
- params: import("../shared/StrictParams.tsx").default<T_1>;
324
+ params: import("../shared/StrictParams.js").default<T_1>;
325
325
  } & {
326
- query?: import("../shared/utils.tsx").QueryParams;
326
+ query?: import("../shared/utils.js").QueryParams;
327
327
  } : T_1 | ({
328
328
  pathname: T_1;
329
329
  } & {
330
- query?: import("../shared/utils.tsx").QueryParams;
330
+ query?: import("../shared/utils.js").QueryParams;
331
331
  }) : never : never;
332
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] ? {} : {
@@ -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("../shared/utils.tsx").QueryParams;
341
+ query?: import("../shared/utils.js").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.tsx").default<T_1> | undefined;
344
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
345
345
  } & {
346
- query?: import("../shared/utils.tsx").QueryParams;
346
+ query?: import("../shared/utils.js").QueryParams;
347
347
  }) : T_1 extends `${string}[${string}` ? {
348
348
  pathname: T_1;
349
- params: import("../shared/StrictParams.tsx").default<T_1>;
349
+ params: import("../shared/StrictParams.js").default<T_1>;
350
350
  } & {
351
- query?: import("../shared/utils.tsx").QueryParams;
351
+ query?: import("../shared/utils.js").QueryParams;
352
352
  } : T_1 | ({
353
353
  pathname: T_1;
354
354
  } & {
355
- query?: import("../shared/utils.tsx").QueryParams;
355
+ query?: import("../shared/utils.js").QueryParams;
356
356
  }) : never : never;
357
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] ? {} : {
@@ -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("../shared/utils.tsx").QueryParams;
366
+ query?: import("../shared/utils.js").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.tsx").default<T_1> | undefined;
369
+ params?: import("../shared/StrictParams.js").default<T_1> | undefined;
370
370
  } & {
371
- query?: import("../shared/utils.tsx").QueryParams;
371
+ query?: import("../shared/utils.js").QueryParams;
372
372
  }) : T_1 extends `${string}[${string}` ? {
373
373
  pathname: T_1;
374
- params: import("../shared/StrictParams.tsx").default<T_1>;
374
+ params: import("../shared/StrictParams.js").default<T_1>;
375
375
  } & {
376
- query?: import("../shared/utils.tsx").QueryParams;
376
+ query?: import("../shared/utils.js").QueryParams;
377
377
  } : T_1 | ({
378
378
  pathname: T_1;
379
379
  } & {
380
- query?: import("../shared/utils.tsx").QueryParams;
380
+ query?: import("../shared/utils.js").QueryParams;
381
381
  }) : never : never;
382
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] ? {} : {
@@ -1,2 +1,2 @@
1
- export { default as createNavigation } from './createNavigation.tsx';
2
- export type { Pathnames } from '../../routing/types.tsx';
1
+ export { default as createNavigation } from './createNavigation.js';
2
+ export type { Pathnames } from '../../routing/types.js';
@@ -1,7 +1,7 @@
1
1
  import { type LinkProps } from 'next/link.js';
2
2
  import { type ComponentProps } from 'react';
3
3
  import { type Locale } from 'use-intl';
4
- import type { InitializedLocaleCookieConfig } from '../../routing/config.tsx';
4
+ import type { InitializedLocaleCookieConfig } from '../../routing/config.js';
5
5
  type NextLinkProps = Omit<ComponentProps<'a'>, keyof LinkProps> & Omit<LinkProps, 'locale'>;
6
6
  type Props = NextLinkProps & {
7
7
  locale?: Locale;
@@ -1,7 +1,7 @@
1
1
  import type { Locale } from 'use-intl';
2
- import { type RoutingConfigLocalizedNavigation, type RoutingConfigSharedNavigation } from '../../routing/config.tsx';
3
- import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.tsx';
4
- import { type HrefOrHrefWithParams, type QueryParams } from './utils.tsx';
2
+ import { type RoutingConfigLocalizedNavigation, type RoutingConfigSharedNavigation } from '../../routing/config.js';
3
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.js';
4
+ import { type HrefOrHrefWithParams, type QueryParams } from './utils.js';
5
5
  type PromiseOrValue<Type> = Type | Promise<Type>;
6
6
  /**
7
7
  * Shared implementations for `react-server` and `react-client`
@@ -17,7 +17,7 @@ export default function createSharedNavigationFns<const AppLocales extends Local
17
17
  mode: "as-needed";
18
18
  prefixes?: Partial<Record<string, string>> | undefined;
19
19
  };
20
- localeCookie: import("../../routing/config.tsx").InitializedLocaleCookieConfig;
20
+ localeCookie: import("../../routing/config.js").InitializedLocaleCookieConfig;
21
21
  localeDetection: NonNullable<boolean | undefined>;
22
22
  alternateLinks: NonNullable<boolean | undefined>;
23
23
  };
@@ -320,10 +320,10 @@ export default function createSharedNavigationFns<const AppLocales extends Local
320
320
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
321
321
  href: [AppPathnames] extends [never] ? string | import("url").UrlObject : keyof AppPathnames extends infer T ? T extends keyof AppPathnames ? T extends `${string}[[...${string}` ? T | ({
322
322
  pathname: T;
323
- params?: import("./StrictParams.tsx").default<T> | undefined;
323
+ params?: import("./StrictParams.js").default<T> | undefined;
324
324
  } & Omit<import("url").UrlObject, "pathname">) : T extends `${string}[${string}` ? {
325
325
  pathname: T;
326
- params: import("./StrictParams.tsx").default<T>;
326
+ params: import("./StrictParams.js").default<T>;
327
327
  } & Omit<import("url").UrlObject, "pathname"> : T | ({
328
328
  pathname: T;
329
329
  } & Omit<import("url").UrlObject, "pathname">) : never : never;
@@ -1,5 +1,5 @@
1
1
  import type { Locale } from 'use-intl';
2
- import type { InitializedLocaleCookieConfig } from '../../routing/config.tsx';
2
+ import type { InitializedLocaleCookieConfig } from '../../routing/config.js';
3
3
  /**
4
4
  * We have to keep the cookie value in sync as Next.js might
5
5
  * skip a request to the server due to its router cache.
@@ -1,9 +1,9 @@
1
1
  import type { ParsedUrlQueryInput } from 'node:querystring';
2
2
  import type { UrlObject } from 'url';
3
3
  import type { Locale } from 'use-intl';
4
- import type { ResolvedRoutingConfig } from '../../routing/config.tsx';
5
- import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.tsx';
6
- import type StrictParams from './StrictParams.tsx';
4
+ import type { ResolvedRoutingConfig } from '../../routing/config.js';
5
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../../routing/types.js';
6
+ import type StrictParams from './StrictParams.js';
7
7
  type SearchParamValue = ParsedUrlQueryInput[keyof ParsedUrlQueryInput];
8
8
  type HrefOrHrefWithParamsImpl<Pathname, Other> = Pathname extends `${string}[[...${string}` ? // Optional catch-all
9
9
  Pathname | ({
@@ -1 +1 @@
1
- export * from './navigation/react-client/index.tsx';
1
+ export * from './navigation/react-client/index.js';
@@ -1 +1 @@
1
- export * from './navigation/react-server/index.tsx';
1
+ export * from './navigation/react-server/index.js';
@@ -1,3 +1,3 @@
1
1
  import type { NextConfig } from 'next';
2
- import type { PluginConfig } from './types.tsx';
2
+ import type { PluginConfig } from './types.js';
3
3
  export default function createNextIntlPlugin(i18nPathOrConfig?: string | PluginConfig): (nextConfig?: NextConfig) => NextConfig;
@@ -1,3 +1,3 @@
1
1
  import type { NextConfig } from 'next';
2
- import type { PluginConfig } from './types.tsx';
2
+ import type { PluginConfig } from './types.js';
3
3
  export default function getNextConfig(pluginConfig: PluginConfig, nextConfig?: NextConfig): NextConfig & Partial<NextConfig>;
@@ -1 +1 @@
1
- export { default } from './createNextIntlPlugin.tsx';
1
+ export { default } from './createNextIntlPlugin.js';
@@ -1 +1 @@
1
- export { default } from './plugin/index.tsx';
1
+ export { default } from './plugin/index.js';
@@ -11,4 +11,4 @@ import { useFormatter as base_useFormatter, useTranslations as base_useTranslati
11
11
  export * from 'use-intl';
12
12
  export declare const useTranslations: typeof base_useTranslations;
13
13
  export declare const useFormatter: typeof base_useFormatter;
14
- export { default as NextIntlClientProvider } from '../shared/NextIntlClientProvider.tsx';
14
+ export { default as NextIntlClientProvider } from '../shared/NextIntlClientProvider.js';
@@ -1,5 +1,5 @@
1
1
  import type { ComponentProps } from 'react';
2
- import BaseNextIntlClientProvider from '../shared/NextIntlClientProvider.tsx';
2
+ import BaseNextIntlClientProvider from '../shared/NextIntlClientProvider.js';
3
3
  type Props = ComponentProps<typeof BaseNextIntlClientProvider>;
4
4
  export default function NextIntlClientProviderServer({ formats, locale, now, timeZone, ...rest }: Props): Promise<import("react/jsx-runtime").JSX.Element>;
5
5
  export {};
@@ -5,11 +5,11 @@
5
5
  *
6
6
  * Make sure this mirrors the API from '../react-client'.
7
7
  */
8
- export { default as useLocale } from './useLocale.tsx';
9
- export { default as useTranslations } from './useTranslations.tsx';
10
- export { default as useFormatter } from './useFormatter.tsx';
11
- export { default as useNow } from './useNow.tsx';
12
- export { default as useTimeZone } from './useTimeZone.tsx';
13
- export { default as useMessages } from './useMessages.tsx';
14
- export { default as NextIntlClientProvider } from './NextIntlClientProviderServer.tsx';
8
+ export { default as useLocale } from './useLocale.js';
9
+ export { default as useTranslations } from './useTranslations.js';
10
+ export { default as useFormatter } from './useFormatter.js';
11
+ export { default as useNow } from './useNow.js';
12
+ export { default as useTimeZone } from './useTimeZone.js';
13
+ export { default as useMessages } from './useMessages.js';
14
+ export { default as NextIntlClientProvider } from './NextIntlClientProviderServer.js';
15
15
  export * from 'use-intl/core';
@@ -1,2 +1,2 @@
1
- import getConfig from '../server/react-server/getConfig.tsx';
1
+ import getConfig from '../server/react-server/getConfig.js';
2
2
  export default function useConfig(hookName: string): Awaited<ReturnType<typeof getConfig>>;
@@ -1,5 +1,5 @@
1
1
  import type { NextResponse } from 'next/server.js';
2
- import type { DomainsConfig, LocalePrefix, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from './types.tsx';
2
+ import type { DomainsConfig, LocalePrefix, LocalePrefixConfigVerbose, LocalePrefixMode, Locales, Pathnames } from './types.js';
3
3
  type CookieAttributes = Pick<NonNullable<Parameters<typeof NextResponse.prototype.cookies.set>['2']>, 'maxAge' | 'domain' | 'partitioned' | 'path' | 'priority' | 'sameSite' | 'secure' | 'name'>;
4
4
  export type RoutingConfig<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined> = {
5
5
  /**
@@ -1,3 +1,3 @@
1
- import type { RoutingConfig } from './config.tsx';
2
- import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from './types.tsx';
1
+ import type { RoutingConfig } from './config.js';
2
+ import type { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from './types.js';
3
3
  export default function defineRouting<const AppLocales extends Locales, const AppLocalePrefixMode extends LocalePrefixMode = 'always', const AppPathnames extends Pathnames<AppLocales> = never, const AppDomains extends DomainsConfig<AppLocales> = never>(config: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>): RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>;
@@ -1,3 +1,3 @@
1
- export type { Pathnames, LocalePrefix, DomainsConfig, LocalePrefixMode } from './types.tsx';
2
- export { default as defineRouting } from './defineRouting.tsx';
3
- export type { RoutingConfig } from './config.tsx';
1
+ export type { Pathnames, LocalePrefix, DomainsConfig, LocalePrefixMode } from './types.js';
2
+ export { default as defineRouting } from './defineRouting.js';
3
+ export type { RoutingConfig } from './config.js';
@@ -1,2 +1,2 @@
1
- import type { Locales } from './types.tsx';
1
+ import type { Locales } from './types.js';
2
2
  export default function validateLocales(locales: Locales): void;
@@ -1 +1 @@
1
- export * from './routing/index.tsx';
1
+ export * from './routing/index.js';
@@ -1,4 +1,4 @@
1
- import type { getFormatter as getFormatter_type, getLocale as getLocale_type, getMessages as getMessages_type, getNow as getNow_type, getRequestConfig as getRequestConfig_type, getTimeZone as getTimeZone_type, setRequestLocale as setRequestLocale_type } from '../react-server/index.tsx';
1
+ import type { getFormatter as getFormatter_type, getLocale as getLocale_type, getMessages as getMessages_type, getNow as getNow_type, getRequestConfig as getRequestConfig_type, getTimeZone as getTimeZone_type, setRequestLocale as setRequestLocale_type } from '../react-server/index.js';
2
2
  export declare function getRequestConfig(...args: Parameters<typeof getRequestConfig_type>): ReturnType<typeof getRequestConfig_type>;
3
3
  export declare const getFormatter: typeof getFormatter_type;
4
4
  export declare const getNow: typeof getNow_type;
@@ -1,3 +1,3 @@
1
- import type { GetRequestConfigParams, RequestConfig } from './getRequestConfig.tsx';
1
+ import type { GetRequestConfigParams, RequestConfig } from './getRequestConfig.js';
2
2
  declare const _default: (params: GetRequestConfigParams) => RequestConfig | Promise<RequestConfig>;
3
3
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import type { Locale, useMessages as useMessagesType } from 'use-intl';
2
- import getConfig from './getConfig.tsx';
2
+ import getConfig from './getConfig.js';
3
3
  export declare function getMessagesFromConfig(config: Awaited<ReturnType<typeof getConfig>>): ReturnType<typeof useMessagesType>;
4
4
  export default function getMessages(opts?: {
5
5
  locale?: Locale;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Server-only APIs available via `next-intl/server`.
3
3
  */
4
- export { default as getRequestConfig, type GetRequestConfigParams, type RequestConfig } from './getRequestConfig.tsx';
5
- export { default as getFormatter } from './getFormatter.tsx';
6
- export { default as getNow } from './getNow.tsx';
7
- export { default as getTimeZone } from './getTimeZone.tsx';
8
- export { default as getTranslations } from './getTranslations.tsx';
9
- export { default as getMessages } from './getMessages.tsx';
10
- export { default as getLocale } from './getLocale.tsx';
11
- export { setCachedRequestLocale as setRequestLocale } from './RequestLocaleCache.tsx';
4
+ export { default as getRequestConfig, type GetRequestConfigParams, type RequestConfig } from './getRequestConfig.js';
5
+ export { default as getFormatter } from './getFormatter.js';
6
+ export { default as getNow } from './getNow.js';
7
+ export { default as getTimeZone } from './getTimeZone.js';
8
+ export { default as getTranslations } from './getTranslations.js';
9
+ export { default as getMessages } from './getMessages.js';
10
+ export { default as getLocale } from './getLocale.js';
11
+ export { setCachedRequestLocale as setRequestLocale } from './RequestLocaleCache.js';
@@ -1 +1 @@
1
- export * from './server/react-client/index.tsx';
1
+ export * from './server/react-client/index.js';
@@ -1 +1 @@
1
- export * from './server/react-server/index.tsx';
1
+ export * from './server/react-server/index.js';
@@ -1,5 +1,5 @@
1
1
  import type { LinkProps } from 'next/link.js';
2
- import type { LocalePrefixConfigVerbose, LocalePrefixMode, Locales } from '../routing/types.tsx';
2
+ import type { LocalePrefixConfigVerbose, LocalePrefixMode, Locales } from '../routing/types.js';
3
3
  type Href = LinkProps['href'];
4
4
  export declare function isLocalizableHref(href: Href): boolean;
5
5
  export declare function unprefixPathname(pathname: string, prefix: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "4.0.0-beta-f511797",
3
+ "version": "4.0.0-beta-5b218d4",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -17,7 +17,15 @@
17
17
  "url": "https://github.com/amannn/next-intl"
18
18
  },
19
19
  "scripts": {
20
- "prepublishOnly": "turbo build && cp ../../README.md ."
20
+ "build": "rm -rf dist && rollup -c",
21
+ "test": "TZ=Europe/Berlin vitest",
22
+ "lint": "pnpm run lint:source && pnpm run lint:package",
23
+ "lint:source": "eslint src test && tsc --noEmit && pnpm run lint:prettier",
24
+ "lint:package": "publint && attw --pack --ignore-rules=cjs-resolves-to-esm",
25
+ "lint:prettier": "prettier src --check",
26
+ "prepublishOnly": "turbo build && cp ../../README.md .",
27
+ "postpublish": "git checkout . && rm ./README.md",
28
+ "size": "size-limit"
21
29
  },
22
30
  "type": "module",
23
31
  "main": "./dist/esm/production/index.react-client.js",
@@ -104,7 +112,7 @@
104
112
  "dependencies": {
105
113
  "@formatjs/intl-localematcher": "^0.5.4",
106
114
  "negotiator": "^1.0.0",
107
- "use-intl": "4.0.0-beta-f511797"
115
+ "use-intl": "4.0.0-beta-5b218d4"
108
116
  },
109
117
  "peerDependencies": {
110
118
  "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
@@ -116,5 +124,5 @@
116
124
  "optional": true
117
125
  }
118
126
  },
119
- "gitHead": "325ff7dd2a27286607e22c4ed2de7cc2248c7384"
127
+ "gitHead": "1ea3a6b31662c37c0dcd2800ada448ece5cd0641"
120
128
  }