cloudflare-next-intl 0.6.2 → 0.6.3

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 (142) hide show
  1. package/dist/src/error_handling/create_server_error_action.d.ts +19 -0
  2. package/dist/src/error_handling/create_server_error_action.js +29 -0
  3. package/dist/types/client/components/client_helper_script.d.ts +1 -0
  4. package/dist/types/client/components/client_provider.d.ts +34 -0
  5. package/dist/types/client/components/locale_link.d.ts +30 -0
  6. package/dist/types/client/components/locale_link_client.d.ts +3 -0
  7. package/dist/types/client/functions/get_cookie.bench.d.ts +1 -0
  8. package/dist/types/client/functions/get_cookie.d.ts +10 -0
  9. package/dist/types/client/functions/get_cookie.test.d.ts +1 -0
  10. package/dist/types/client/functions/set_cookie.bench.d.ts +1 -0
  11. package/dist/types/client/functions/set_cookie.d.ts +21 -0
  12. package/dist/types/client/functions/set_cookie.test.d.ts +1 -0
  13. package/dist/types/client/hooks/client_hooks.bench.d.ts +1 -0
  14. package/dist/types/client/hooks/client_hooks.d.ts +28 -0
  15. package/dist/types/client/hooks/use_path_name.bench.d.ts +1 -0
  16. package/dist/types/client/hooks/use_path_name.d.ts +10 -0
  17. package/dist/types/client/index.d.ts +4 -0
  18. package/dist/types/config/cookie_key.bench.d.ts +1 -0
  19. package/dist/types/config/cookie_key.d.ts +5 -0
  20. package/dist/types/config/cookie_key.test.d.ts +1 -0
  21. package/dist/types/config/index.d.ts +4 -0
  22. package/dist/types/config/init_config.bench.d.ts +1 -0
  23. package/dist/types/config/init_config.d.ts +18 -0
  24. package/dist/types/config/init_config.test.d.ts +1 -0
  25. package/dist/types/config/intl_config.d.ts +3 -0
  26. package/dist/types/config/intl_config.test.d.ts +1 -0
  27. package/dist/types/config/intl_sitemap.bench.d.ts +1 -0
  28. package/dist/types/config/intl_sitemap.d.ts +8 -0
  29. package/dist/types/config/intl_sitemap.test.d.ts +1 -0
  30. package/dist/types/config/middleware.bench.d.ts +1 -0
  31. package/dist/types/config/middleware.d.ts +21 -0
  32. package/dist/types/config/middleware.test.d.ts +1 -0
  33. package/dist/types/cookie_consent/client/components/clarity_script.d.ts +10 -0
  34. package/dist/types/cookie_consent/client/components/cookie_consent_analytics.bench.d.ts +1 -0
  35. package/dist/types/cookie_consent/client/components/cookie_consent_analytics.d.ts +19 -0
  36. package/dist/types/cookie_consent/client/components/cookie_consent_dialog.d.ts +35 -0
  37. package/dist/types/cookie_consent/client/components/default_dialog_styles.d.ts +2 -0
  38. package/dist/types/cookie_consent/client/components/default_dialog_text.d.ts +13 -0
  39. package/dist/types/cookie_consent/client/components/default_privacy_policy_link.d.ts +14 -0
  40. package/dist/types/cookie_consent/client/components/dialog_portal.d.ts +11 -0
  41. package/dist/types/cookie_consent/client/components/privacy_policy_update_dialog.d.ts +31 -0
  42. package/dist/types/cookie_consent/client/cookie_consent_provider.bench.d.ts +1 -0
  43. package/dist/types/cookie_consent/client/cookie_consent_provider.d.ts +39 -0
  44. package/dist/types/cookie_consent/client/use_cookie_consent.d.ts +6 -0
  45. package/dist/types/cookie_consent/gdpr_countries.bench.d.ts +1 -0
  46. package/dist/types/cookie_consent/gdpr_countries.d.ts +18 -0
  47. package/dist/types/cookie_consent/gdpr_countries.perf.test.d.ts +1 -0
  48. package/dist/types/cookie_consent/gdpr_countries.test.d.ts +1 -0
  49. package/dist/types/cookie_consent/index.d.ts +10 -0
  50. package/dist/types/cookie_consent/require_config.d.ts +7 -0
  51. package/dist/types/cookie_consent/require_config.test.d.ts +1 -0
  52. package/dist/types/cookie_consent/types.d.ts +57 -0
  53. package/dist/types/error_handling/create_server_error_action.d.ts +19 -0
  54. package/dist/types/error_handling/create_server_error_action.test.d.ts +1 -0
  55. package/dist/types/error_handling/default_ignored_console_errors.d.ts +13 -0
  56. package/dist/types/error_handling/default_ignored_console_errors.test.d.ts +1 -0
  57. package/dist/types/error_handling/format_error_message.d.ts +9 -0
  58. package/dist/types/error_handling/format_error_message.test.d.ts +1 -0
  59. package/dist/types/error_handling/index.d.ts +9 -0
  60. package/dist/types/error_handling/install_console_error_override.bench.d.ts +1 -0
  61. package/dist/types/error_handling/install_console_error_override.d.ts +29 -0
  62. package/dist/types/error_handling/install_console_error_override.perf.test.d.ts +1 -0
  63. package/dist/types/error_handling/install_console_error_override.test.d.ts +1 -0
  64. package/dist/types/error_handling/report_error.bench.d.ts +1 -0
  65. package/dist/types/error_handling/report_error.d.ts +40 -0
  66. package/dist/types/error_handling/report_error.perf.test.d.ts +1 -0
  67. package/dist/types/error_handling/report_error.test.d.ts +1 -0
  68. package/dist/types/error_handling/stringify_unknown.bench.d.ts +1 -0
  69. package/dist/types/error_handling/stringify_unknown.d.ts +12 -0
  70. package/dist/types/error_handling/stringify_unknown.test.d.ts +1 -0
  71. package/dist/types/error_handling/with_error_handling.d.ts +15 -0
  72. package/dist/types/error_handling/with_error_handling.test.d.ts +1 -0
  73. package/dist/types/firebase_auth/client/auth_actions.bench.d.ts +1 -0
  74. package/dist/types/firebase_auth/client/auth_actions.d.ts +46 -0
  75. package/dist/types/firebase_auth/client/auth_actions.test.d.ts +1 -0
  76. package/dist/types/firebase_auth/client/auth_user_cache.bench.d.ts +1 -0
  77. package/dist/types/firebase_auth/client/auth_user_cache.d.ts +4 -0
  78. package/dist/types/firebase_auth/client/auth_user_cache.test.d.ts +1 -0
  79. package/dist/types/firebase_auth/client/auth_user_provider.d.ts +36 -0
  80. package/dist/types/firebase_auth/client/firebase_client.bench.d.ts +1 -0
  81. package/dist/types/firebase_auth/client/firebase_client.d.ts +20 -0
  82. package/dist/types/firebase_auth/client/firebase_client.test.d.ts +1 -0
  83. package/dist/types/firebase_auth/client/use_auth_user.bench.d.ts +1 -0
  84. package/dist/types/firebase_auth/client/use_auth_user.d.ts +12 -0
  85. package/dist/types/firebase_auth/error_messages/default_messages.en.bench.d.ts +1 -0
  86. package/dist/types/firebase_auth/error_messages/default_messages.en.d.ts +1 -0
  87. package/dist/types/firebase_auth/error_messages/default_messages.en.test.d.ts +1 -0
  88. package/dist/types/firebase_auth/error_messages/firebase_auth_error_helper.bench.d.ts +1 -0
  89. package/dist/types/firebase_auth/error_messages/firebase_auth_error_helper.d.ts +6 -0
  90. package/dist/types/firebase_auth/error_messages/firebase_auth_error_helper.test.d.ts +1 -0
  91. package/dist/types/firebase_auth/index.d.ts +9 -0
  92. package/dist/types/firebase_auth/middleware/update_session.bench.d.ts +1 -0
  93. package/dist/types/firebase_auth/middleware/update_session.d.ts +22 -0
  94. package/dist/types/firebase_auth/middleware/update_session.test.d.ts +1 -0
  95. package/dist/types/firebase_auth/require_config.bench.d.ts +1 -0
  96. package/dist/types/firebase_auth/require_config.d.ts +8 -0
  97. package/dist/types/firebase_auth/require_config.test.d.ts +1 -0
  98. package/dist/types/firebase_auth/server/auth_user_server_provider.d.ts +29 -0
  99. package/dist/types/firebase_auth/server/firebase_server.bench.d.ts +1 -0
  100. package/dist/types/firebase_auth/server/firebase_server.d.ts +15 -0
  101. package/dist/types/firebase_auth/server/firebase_server.perf.test.d.ts +1 -0
  102. package/dist/types/firebase_auth/server/firebase_server.test.d.ts +1 -0
  103. package/dist/types/firebase_auth/server/use_auth_user_server.bench.d.ts +1 -0
  104. package/dist/types/firebase_auth/server/use_auth_user_server.d.ts +39 -0
  105. package/dist/types/firebase_auth/server/use_auth_user_server.test.d.ts +1 -0
  106. package/dist/types/firebase_auth/types.d.ts +22 -0
  107. package/dist/types/general/cache_variables.bench.d.ts +1 -0
  108. package/dist/types/general/cache_variables.d.ts +14 -0
  109. package/dist/types/general/cache_variables.test.d.ts +1 -0
  110. package/dist/types/general/general_functions.bench.d.ts +1 -0
  111. package/dist/types/general/general_functions.d.ts +2 -0
  112. package/dist/types/general/general_functions.test.d.ts +1 -0
  113. package/dist/types/general/index.d.ts +2 -0
  114. package/dist/types/general/metadata.bench.d.ts +1 -0
  115. package/dist/types/general/metadata.d.ts +38 -0
  116. package/dist/types/general/metadata.test.d.ts +1 -0
  117. package/dist/types/index.d.ts +6 -0
  118. package/dist/types/server/components/helper_script.d.ts +20 -0
  119. package/dist/types/server/components/link.d.ts +25 -0
  120. package/dist/types/server/components/server_provider.d.ts +35 -0
  121. package/dist/types/server/functions/get_user_locale.bench.d.ts +1 -0
  122. package/dist/types/server/functions/get_user_locale.d.ts +3 -0
  123. package/dist/types/server/functions/get_user_locale.test.d.ts +1 -0
  124. package/dist/types/server/functions/locale_static_params.d.ts +15 -0
  125. package/dist/types/server/functions/locale_static_params.test.d.ts +1 -0
  126. package/dist/types/server/functions/server.bench.d.ts +1 -0
  127. package/dist/types/server/functions/server.d.ts +67 -0
  128. package/dist/types/server/functions/server.perf.test.d.ts +1 -0
  129. package/dist/types/server/functions/server.test.d.ts +1 -0
  130. package/dist/types/server/functions/use_functions.bench.d.ts +1 -0
  131. package/dist/types/server/functions/use_functions.d.ts +33 -0
  132. package/dist/types/server/functions/use_functions.test.d.ts +1 -0
  133. package/dist/types/server/index.d.ts +5 -0
  134. package/dist/types/test_utils/mock_intl_config.d.ts +3 -0
  135. package/dist/types/test_utils/mock_next_server.d.ts +5 -0
  136. package/dist/types/theme_switcher/components/icons.d.ts +6 -0
  137. package/dist/types/theme_switcher/components/theme_switcher.d.ts +15 -0
  138. package/dist/types/theme_switcher/components/theme_switcher_button.d.ts +6 -0
  139. package/dist/types/theme_switcher/index.d.ts +1 -0
  140. package/dist/types/types/index.d.ts +1 -0
  141. package/dist/types/types/types.d.ts +548 -0
  142. package/package.json +5 -1
@@ -0,0 +1,14 @@
1
+ import type { TranslationObject, TranslatorReturnType } from "../types/types";
2
+ /**
3
+ * Sets the current locale.
4
+ * @param locale The language to set.
5
+ */
6
+ export declare function setLocaleCache(locale: string): void;
7
+ export declare function setLocaleAsync(params: Promise<{
8
+ locale: string;
9
+ }>): Promise<void>;
10
+ export declare function getLocaleCache(): string | undefined;
11
+ export declare function setMessageForLocaleCache(locale: string, message: TranslationObject): void;
12
+ export declare function getMessageCache(locale?: string): TranslationObject | undefined;
13
+ export declare function setTranslationCache(cache: string, value: TranslatorReturnType): void;
14
+ export declare function getTranslationCache(cacheKey: string): TranslatorReturnType | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TranslationObject, TranslatorReturnType } from "../types/types";
2
+ export declare function getTranslationsImpl(locale: string, messages: TranslationObject, namespace: string, cacheKey?: string): TranslatorReturnType;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { setLocaleCache as setLocale, setLocaleAsync } from './cache_variables';
2
+ export { alternatesLinks } from './metadata';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Builds the `alternates` field for Next's `generateMetadata` — a canonical
3
+ * URL plus per-locale `hreflang` links, exported memoized as `alternatesLinks`
4
+ * from `cloudflare-next-intl/metadata`.
5
+ *
6
+ * @param url Absolute base URL of your site (no locale, no path),
7
+ * e.g. `"https://example.com"`.
8
+ * @param locale The current page's locale — used to decide the
9
+ * `canonical` URL (only set for `defaultLocale` unless you pass one).
10
+ * @param linkPart The path segment after the locale, e.g. `"/about"`.
11
+ * Pass `"/"` or omit for the root page.
12
+ * @param canonical Optional override for the canonical URL.
13
+ * @returns `{ canonical, languages }` ready to spread into `Metadata.alternates`,
14
+ * or `undefined` if building the links threw (logged, not re-thrown).
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * export async function generateMetadata({ params }) {
19
+ * const { locale } = await params;
20
+ * return {
21
+ * alternates: alternatesLinks({ url: "https://example.com", locale, linkPart: "/about" }),
22
+ * };
23
+ * }
24
+ * ```
25
+ */
26
+ export declare function iAlternatesLinks({ locale, url, canonical, linkPart }: {
27
+ url: string;
28
+ locale: string;
29
+ linkPart?: string;
30
+ canonical?: string;
31
+ }): {
32
+ canonical?: string;
33
+ languages: Record<string, string>;
34
+ } | undefined;
35
+ export declare const alternatesLinks: typeof iAlternatesLinks;
36
+ declare function iLanguages(url: string, linkPart?: string): Record<string, string>;
37
+ export declare const languages: typeof iLanguages;
38
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from './config';
2
+ export * from './general';
3
+ export * from './server';
4
+ export * from './client';
5
+ export * from './theme_switcher';
6
+ export * from './types';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Server component exported as `IntlHelperScript` from
3
+ * `cloudflare-next-intl/IntlHelperScript`. Renders inline bootstrap
4
+ * `<script>` tags that run before hydration to avoid FOUC/flicker:
5
+ * - syncs dark-mode class from the theme cookie (or `prefers-color-scheme`)
6
+ * - redirects to the locale-prefixed URL if the locale cookie disagrees
7
+ * with the current path (covers client-side navigation edge cases)
8
+ * - (prod only) checks `BUILD_ID` and force-reloads on stale deploys
9
+ *
10
+ * Place it once in your root layout's `<head>`, alongside `IntlProvider`.
11
+ * No props.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <head>
16
+ * <IntlHelperScript />
17
+ * </head>
18
+ * ```
19
+ */
20
+ export default function HelperScript(): Component | null;
@@ -0,0 +1,25 @@
1
+ import { type LinkProps } from 'next/link';
2
+ import { type ComponentProps } from 'react';
3
+ type NextLinkProps = Omit<ComponentProps<'a'>, keyof LinkProps> & Omit<LinkProps, 'locale'>;
4
+ /**
5
+ * Server-safe, locale-aware drop-in replacement for `next/link`. Import
6
+ * from `cloudflare-next-intl/Link` (a separate subpath from the client-side
7
+ * `LocaleLink`).
8
+ *
9
+ * Prepends the current locale segment to `href` automatically when the
10
+ * current locale isn't the `defaultLocale` — you never build the
11
+ * `/en/about`-style path yourself. To link to a SPECIFIC locale (a language
12
+ * switcher) use `LocaleLink` instead, which takes an explicit `locale` prop.
13
+ *
14
+ * All other `next/link` props (`prefetch`, `replace`, `scroll`, etc.) and
15
+ * standard `<a>` props are passed straight through.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * import Link from "cloudflare-next-intl/Link";
20
+ *
21
+ * <Link href="/about">About</Link> // -> "/about" or "/de/about"
22
+ * ```
23
+ */
24
+ declare const Link: import("react").ForwardRefExoticComponent<Omit<NextLinkProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
25
+ export default Link;
@@ -0,0 +1,35 @@
1
+ import type { TranslationObject } from "../../types/types";
2
+ /**
3
+ * Server component that provides locale/messages context to the rest of the
4
+ * tree. Exported publicly as `IntlProvider` from `cloudflare-next-intl/serverProvider`.
5
+ *
6
+ * Wrap this around your app once, near the root layout, below `[locale]`.
7
+ * It seeds the server-side locale/message caches (for `getLocale`/`getTranslations`)
8
+ * and also passes them to the client `LocaleContext` (for `useLocale`/`useTranslations`
9
+ * in client components).
10
+ *
11
+ * @param language The current route's locale (typically the `[locale]` route
12
+ * param). Must be one of your configured `locales` — calls `notFound()`
13
+ * otherwise.
14
+ * @param messages Optional pre-loaded messages for `language`. If omitted,
15
+ * they're loaded via `getMessage(language)`.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * export default async function RootLayout({ children, params }) {
20
+ * const { locale } = await params;
21
+ * return (
22
+ * <html lang={locale}>
23
+ * <body>
24
+ * <IntlProvider language={locale}>{children}</IntlProvider>
25
+ * </body>
26
+ * </html>
27
+ * );
28
+ * }
29
+ * ```
30
+ */
31
+ export default function LocationzationProvider({ language, messages, children }: {
32
+ language: string;
33
+ messages?: TranslationObject;
34
+ children: React.ReactNode;
35
+ }): Promise<Component>;
@@ -0,0 +1,3 @@
1
+ export declare const languageDetecotr: typeof languageDetecotrImpl;
2
+ declare function languageDetecotrImpl(acceptLanguageHeader: string | null): string;
3
+ export {};
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generates the `[locale]` route params for every configured locale — pass
3
+ * directly as your `[locale]/layout.tsx`'s `generateStaticParams` so Next
4
+ * pre-renders/statically-generates a route for each locale.
5
+ *
6
+ * @returns One `{ locale }` object per entry in your `setIntlConfig({ locales })`.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * export const generateStaticParams = getLocaleStaticParams;
11
+ * ```
12
+ */
13
+ export declare function getLocaleStaticParams(): {
14
+ locale: string;
15
+ }[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,67 @@
1
+ import type { TranslationObject, TranslatorReturnType } from "../../types/types";
2
+ /**
3
+ * Loads and caches messages for a specific locale using dynamic import.
4
+ * Prevents redundant file loads and handles import errors gracefully.
5
+ * @param locale The locale for which to load messages.
6
+ * @returns A promise that resolves to the TranslationObject for the given locale.
7
+ */
8
+ declare function iGetMessage(locale: string): Promise<TranslationObject>;
9
+ /**
10
+ * Server-only: loads (and caches) the translation messages for a locale.
11
+ * Use {@link getTranslations} instead unless you need the raw message object.
12
+ *
13
+ * @param locale The locale to load messages for (e.g. `"en"`).
14
+ * @returns The `TranslationObject` for that locale.
15
+ * @throws via `notFound()` if `locale` isn't in your configured locales.
16
+ */
17
+ export declare const getMessage: typeof iGetMessage;
18
+ /**
19
+ * Retrieves a translation function for a specific namespace and locale.
20
+ * This function handles caching of both translation files and memoized translation functions.
21
+ * @param namespace The dot-separated namespace (e.g., "common.buttons").
22
+ * @param locale Optional: The specific locale to use. If not provided, it will be determined.
23
+ * @returns A promise that resolves to a function, which takes a key and returns the translated string.
24
+ */
25
+ declare function iGetTranslations(namespace: string, locale?: string): Promise<TranslatorReturnType>;
26
+ /**
27
+ * Server Component only: gets a translation function for a namespace.
28
+ *
29
+ * @param namespace Dot-separated key prefix into your messages file
30
+ * (e.g. `"HomePage"`, `"Common.buttons"`).
31
+ * @param locale Optional. Defaults to {@link getLocale}'s result — pass
32
+ * this explicitly only if you already resolved the locale (e.g. from route
33
+ * params) to avoid an extra lookup.
34
+ * @returns A function `(key: string) => string` that looks up `key` inside
35
+ * `namespace`.
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * export default async function Page() {
40
+ * const t = await getTranslations("HomePage");
41
+ * return <h1>{t("title")}</h1>;
42
+ * }
43
+ * ```
44
+ */
45
+ export declare const getTranslations: typeof iGetTranslations;
46
+ /**
47
+ * Determines the current locale. It first checks for an explicitly set locale,
48
+ * and finally reads from cookies.
49
+ * @returns A promise that resolves to the determined Language.
50
+ */
51
+ declare function iGetLocale(): Promise<string>;
52
+ /**
53
+ * Server Component only: resolves the current request's locale.
54
+ *
55
+ * Order of resolution: an explicitly-set locale (e.g. via `IntlProvider`)
56
+ * takes priority, then falls back to the `NEXT_LOCALE`-style cookie set by
57
+ * `intlMiddleware`, then to `defaultLocale` from your `setIntlConfig` config.
58
+ *
59
+ * @returns The resolved locale string (e.g. `"en"`).
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ * const locale = await getLocale();
64
+ * ```
65
+ */
66
+ export declare const getLocale: typeof iGetLocale;
67
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { TranslatorReturnType } from "../../types/types";
2
+ /**
3
+ * React Server Component `useLocale`, reached via the `cloudflare-next-intl/use`
4
+ * subpath's `react-server` condition (resolved automatically — you always
5
+ * just `import { useLocale } from "cloudflare-next-intl/use"`; the matching
6
+ * client-hook version from `client_hooks.ts` is used automatically in client
7
+ * components instead).
8
+ *
9
+ * Uses React's `use()` on the locale promise resolved by `getLocale()`/
10
+ * `IntlProvider` — must be called within a component tree wrapped in
11
+ * `IntlProvider`.
12
+ *
13
+ * @returns The current locale (e.g. `"en"`).
14
+ * @throws If called without an `IntlProvider` above it in the tree.
15
+ * @example
16
+ * const locale = useLocale(); // "en"
17
+ */
18
+ export declare function useLocaleImpl(): string;
19
+ export declare const useLocale: typeof useLocaleImpl;
20
+ /**
21
+ * React Server Component `useTranslations` — see {@link useLocaleImpl} for
22
+ * the `react-server`/client resolution note.
23
+ *
24
+ * @param namespace Dot-separated key prefix into your messages file.
25
+ * @returns A `(key: string) => string` translation function.
26
+ * @throws If called without an `IntlProvider` above it in the tree.
27
+ * @example
28
+ * const t = useTranslations("Index");
29
+ * return <h1>{t("title")}</h1>;
30
+ */
31
+ declare function useTranslationsImpl(namespace: string): TranslatorReturnType;
32
+ export declare const useTranslations: typeof useTranslationsImpl;
33
+ export {};
@@ -0,0 +1,5 @@
1
+ export { getMessage as getMessage, getTranslations, getLocale } from './functions/server';
2
+ export { default as IntlProvider } from './components/server_provider';
3
+ export { default as Link } from './components/link';
4
+ export { default as IntlHelperScript } from './components/helper_script';
5
+ export { getLocaleStaticParams } from './functions/locale_static_params';
@@ -0,0 +1,3 @@
1
+ import type { RoutingConfig } from '../types/types';
2
+ declare const mockIntlConfig: RoutingConfig<readonly ['en', 'de'], 'as-needed'>;
3
+ export default mockIntlConfig;
@@ -0,0 +1,5 @@
1
+ import { NextRequest } from 'next/server';
2
+ export declare function makeTestRequest(url: string, init?: {
3
+ cookies?: Record<string, string>;
4
+ headers?: Record<string, string>;
5
+ }): NextRequest;
@@ -0,0 +1,6 @@
1
+ export declare function Sun({ className }: {
2
+ className: string;
3
+ }): Component;
4
+ export declare function Moon({ className }: {
5
+ className: string;
6
+ }): Component;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Light/dark theme toggle button, exported as `ThemeSwitcher` from
3
+ * `cloudflare-next-intl/ThemeSwitcher`. Persists the choice via the
4
+ * theme cookie this package's `IntlHelperScript` reads on load (so the
5
+ * correct theme applies before hydration, no flash).
6
+ *
7
+ * @param lightLabelText Accessible label shown/used when in light mode.
8
+ * @param darkLabelText Accessible label shown/used when in dark mode.
9
+ * @param className Optional class applied to the underlying button.
10
+ */
11
+ export default function ThemeSwticher(params: {
12
+ className?: string;
13
+ lightLabelText: string;
14
+ darkLabelText: string;
15
+ }): Component;
@@ -0,0 +1,6 @@
1
+ export default function ThemeSwticherButton({ className, lightLabelText, darkLabelText, children, }: {
2
+ className?: string;
3
+ lightLabelText: string;
4
+ darkLabelText: string;
5
+ children: React.ReactNode;
6
+ }): Component;
@@ -0,0 +1 @@
1
+ export { default as ThemeSwitcher } from './components/theme_switcher';
@@ -0,0 +1 @@
1
+ export type { CookieAttributes, LocalePrefixMode, Locales, ReturnType, RoutingConfig, TranslationEntry, TranslationObject, TranslatorReturnType, Alternates, changeFrequency, IntlSitemap, CookieConsentRoutingConfig, CookieConsentAnalyticsConfig, CookieConsentCloudflareContext, CookieConsentGetCloudflareContext, } from './types';