@i18n-micro/types
Advanced tools
+28
-12
@@ -165,6 +165,6 @@ /** BCP-47 locale code string (e.g. `'en'`, `'de-DE'`, `'zh-Hans'`). */ | ||
| * Base URL for SEO meta tags (canonical, og:url, hreflang). | ||
| * - `undefined` — dynamically resolved from the current request URL | ||
| * - A concrete URL string (e.g. `'https://example.com'`) — used as-is (highest priority). | ||
| * - `undefined` — falls back to `site.url` from `nuxt-site-config` when that module is | ||
| * present, otherwise the current request origin | ||
| * (`useRequestURL().origin` on server, `window.location.origin` on client). | ||
| * Best for multi-domain deployments. | ||
| * - A concrete URL string (e.g. `'https://example.com'`) — used as-is. | ||
| * @default undefined | ||
@@ -188,2 +188,9 @@ */ | ||
| /** | ||
| * Also emit a bare-language `hreflang` derived from each locale's `iso` | ||
| * (e.g. `es-ES` → also `es`). The first regional locale in `locales` claims | ||
| * the bare tag for that language. Routing `code` is never used — only `iso || code`. | ||
| * @default false | ||
| */ | ||
| hreflangBaseLanguage?: boolean; | ||
| /** | ||
| * Register the `defineI18nRoute()` macro plugin, enabling per-page `defineI18nRoute()` calls. | ||
@@ -272,5 +279,10 @@ * @default true | ||
| /** | ||
| * URL path on which automatic language detection and redirect occur. | ||
| * - `'/'` — detect only on the root path. | ||
| * - `'*'` — detect and redirect on every path (including locale-prefixed ones). | ||
| * Where cookie / Accept-Language preference redirects may run (when `redirects` is enabled). | ||
| * - `'/'` — only `/` (deep links in the default locale stay reachable; default) | ||
| * - `'no_prefix'` — only paths without a locale prefix | ||
| * - `'*'` — every path, including rewriting an explicit locale prefix | ||
| * (e.g. `/fr/about` → `/de/about` when the cookie prefers `de`) | ||
| * - any other string — exact path match (e.g. `'/welcome'`) | ||
| * | ||
| * Prefixed strategy cleanup (e.g. `/en` → `/` under `prefix_except_default`) is not gated. | ||
| * @default '/' | ||
@@ -300,9 +312,13 @@ */ | ||
| /** | ||
| * Custom pluralization function or a path to a file exporting one. | ||
| * When a string path is provided, the file is imported at build time. | ||
| * The function receives `(key, count, params, locale, getter)` and should return | ||
| * the correct plural form as a string, or `null` to fall back to the built-in logic. | ||
| * @default built-in pluralization (singular/plural by count) | ||
| * Custom pluralization function. | ||
| * Receives `(key, count, params, locale, getter)` and should return the selected | ||
| * plural form as a string, or `null`/`undefined` to fall back to the built-in | ||
| * `defaultPlural` logic (so you can override only some locales). | ||
| * | ||
| * For the Nuxt module the function is serialized with `.toString()` into | ||
| * `.nuxt/i18n.plural.mjs` — it must be self-contained (no imports / outer scope). | ||
| * A file path string is **not** supported. | ||
| * @default built-in pluralization (form index by count) | ||
| */ | ||
| plural?: string | PluralFunc; | ||
| plural?: PluralFunc; | ||
| /** | ||
@@ -309,0 +325,0 @@ * Disable per-page translation files. |
+28
-12
@@ -165,6 +165,6 @@ /** BCP-47 locale code string (e.g. `'en'`, `'de-DE'`, `'zh-Hans'`). */ | ||
| * Base URL for SEO meta tags (canonical, og:url, hreflang). | ||
| * - `undefined` — dynamically resolved from the current request URL | ||
| * - A concrete URL string (e.g. `'https://example.com'`) — used as-is (highest priority). | ||
| * - `undefined` — falls back to `site.url` from `nuxt-site-config` when that module is | ||
| * present, otherwise the current request origin | ||
| * (`useRequestURL().origin` on server, `window.location.origin` on client). | ||
| * Best for multi-domain deployments. | ||
| * - A concrete URL string (e.g. `'https://example.com'`) — used as-is. | ||
| * @default undefined | ||
@@ -188,2 +188,9 @@ */ | ||
| /** | ||
| * Also emit a bare-language `hreflang` derived from each locale's `iso` | ||
| * (e.g. `es-ES` → also `es`). The first regional locale in `locales` claims | ||
| * the bare tag for that language. Routing `code` is never used — only `iso || code`. | ||
| * @default false | ||
| */ | ||
| hreflangBaseLanguage?: boolean; | ||
| /** | ||
| * Register the `defineI18nRoute()` macro plugin, enabling per-page `defineI18nRoute()` calls. | ||
@@ -272,5 +279,10 @@ * @default true | ||
| /** | ||
| * URL path on which automatic language detection and redirect occur. | ||
| * - `'/'` — detect only on the root path. | ||
| * - `'*'` — detect and redirect on every path (including locale-prefixed ones). | ||
| * Where cookie / Accept-Language preference redirects may run (when `redirects` is enabled). | ||
| * - `'/'` — only `/` (deep links in the default locale stay reachable; default) | ||
| * - `'no_prefix'` — only paths without a locale prefix | ||
| * - `'*'` — every path, including rewriting an explicit locale prefix | ||
| * (e.g. `/fr/about` → `/de/about` when the cookie prefers `de`) | ||
| * - any other string — exact path match (e.g. `'/welcome'`) | ||
| * | ||
| * Prefixed strategy cleanup (e.g. `/en` → `/` under `prefix_except_default`) is not gated. | ||
| * @default '/' | ||
@@ -300,9 +312,13 @@ */ | ||
| /** | ||
| * Custom pluralization function or a path to a file exporting one. | ||
| * When a string path is provided, the file is imported at build time. | ||
| * The function receives `(key, count, params, locale, getter)` and should return | ||
| * the correct plural form as a string, or `null` to fall back to the built-in logic. | ||
| * @default built-in pluralization (singular/plural by count) | ||
| * Custom pluralization function. | ||
| * Receives `(key, count, params, locale, getter)` and should return the selected | ||
| * plural form as a string, or `null`/`undefined` to fall back to the built-in | ||
| * `defaultPlural` logic (so you can override only some locales). | ||
| * | ||
| * For the Nuxt module the function is serialized with `.toString()` into | ||
| * `.nuxt/i18n.plural.mjs` — it must be self-contained (no imports / outer scope). | ||
| * A file path string is **not** supported. | ||
| * @default built-in pluralization (form index by count) | ||
| */ | ||
| plural?: string | PluralFunc; | ||
| plural?: PluralFunc; | ||
| /** | ||
@@ -309,0 +325,0 @@ * Disable per-page translation files. |
+1
-1
| { | ||
| "name": "@i18n-micro/types", | ||
| "version": "1.2.8", | ||
| "version": "1.2.10", | ||
| "description": "TypeScript definitions for the Nuxt I18n Micro ecosystem.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
61484
3%647
2.54%