@i18n-micro/types 1.2.3 → 1.2.5
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/README.md +12 -0
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/package.json +24 -24
package/README.md
CHANGED
|
@@ -68,12 +68,15 @@ const routeParams: I18nRouteParams = {
|
|
|
68
68
|
### Types and Interfaces
|
|
69
69
|
|
|
70
70
|
#### `Locale`
|
|
71
|
+
|
|
71
72
|
Represents a locale configuration.
|
|
72
73
|
|
|
73
74
|
#### `LocaleCode`
|
|
75
|
+
|
|
74
76
|
Represents a locale code (e.g., `'en'`, `'de'`).
|
|
75
77
|
|
|
76
78
|
#### `Strategies`
|
|
79
|
+
|
|
77
80
|
Represents the available routing strategies.
|
|
78
81
|
|
|
79
82
|
```typescript
|
|
@@ -81,30 +84,39 @@ export type Strategies = 'no_prefix' | 'prefix_except_default' | 'prefix' | 'pre
|
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
#### `ModuleOptions`
|
|
87
|
+
|
|
84
88
|
Represents the configuration options for the `nuxt-i18n-micro` module.
|
|
85
89
|
|
|
86
90
|
#### `ModuleOptionsExtend`
|
|
91
|
+
|
|
87
92
|
Extends `ModuleOptions` with additional properties.
|
|
88
93
|
|
|
89
94
|
#### `I18nRouteParams`
|
|
95
|
+
|
|
90
96
|
Represents route parameters for different locales.
|
|
91
97
|
|
|
92
98
|
#### `Params`
|
|
99
|
+
|
|
93
100
|
Represents a key-value pair of parameters for interpolation.
|
|
94
101
|
|
|
95
102
|
#### `PluralFunc`
|
|
103
|
+
|
|
96
104
|
Represents a function for handling pluralization in translations.
|
|
97
105
|
|
|
98
106
|
#### `GlobalLocaleRoutes`
|
|
107
|
+
|
|
99
108
|
Represents global route configurations for different locales.
|
|
100
109
|
|
|
101
110
|
#### `Translations`
|
|
111
|
+
|
|
102
112
|
Represents a key-value pair of translations.
|
|
103
113
|
|
|
104
114
|
#### `Translation`
|
|
115
|
+
|
|
105
116
|
Represents a translation value, which can be a string, number, boolean, nested translations, or `null`.
|
|
106
117
|
|
|
107
118
|
#### `PluralTranslations`
|
|
119
|
+
|
|
108
120
|
Represents translations for singular and plural forms.
|
|
109
121
|
|
|
110
122
|
## Contributing
|
package/dist/index.d.cts
CHANGED
|
@@ -60,7 +60,8 @@ export interface Locale {
|
|
|
60
60
|
iso?: string;
|
|
61
61
|
/**
|
|
62
62
|
* Open Graph locale for `og:locale` / `og:locale:alternate` meta `content` (e.g. `ar_AE`).
|
|
63
|
-
*
|
|
63
|
+
* When omitted, `iso` is converted to OG format when possible (`en-US` → `en_US`).
|
|
64
|
+
* If conversion is not possible, `og:locale` tags are not emitted (dev warning when `missingWarn` is enabled).
|
|
64
65
|
*/
|
|
65
66
|
og?: string;
|
|
66
67
|
/**
|
|
@@ -213,6 +214,11 @@ export interface ModuleOptions {
|
|
|
213
214
|
* @default true
|
|
214
215
|
*/
|
|
215
216
|
components?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Preload index-page translations in Nitro global middleware (server-only, private config).
|
|
219
|
+
* @default false
|
|
220
|
+
*/
|
|
221
|
+
serverTranslationPreload?: boolean;
|
|
216
222
|
/**
|
|
217
223
|
* The locale to use when no locale can be determined from URL or user preferences.
|
|
218
224
|
* Also used as the fallback locale for missing translations when `fallbackLocale` is not set.
|
|
@@ -509,6 +515,8 @@ export interface ModulePrivateOptionsExtend extends ModuleOptions {
|
|
|
509
515
|
routesLocaleLinks?: {
|
|
510
516
|
[key: string]: string;
|
|
511
517
|
};
|
|
518
|
+
/** Preload index translations in Nitro global middleware. */
|
|
519
|
+
serverTranslationPreload?: boolean;
|
|
512
520
|
}
|
|
513
521
|
/** Object shape for a translation value that contains singular/plural forms. */
|
|
514
522
|
export interface PluralTranslations {
|
package/dist/index.d.ts
CHANGED
|
@@ -60,7 +60,8 @@ export interface Locale {
|
|
|
60
60
|
iso?: string;
|
|
61
61
|
/**
|
|
62
62
|
* Open Graph locale for `og:locale` / `og:locale:alternate` meta `content` (e.g. `ar_AE`).
|
|
63
|
-
*
|
|
63
|
+
* When omitted, `iso` is converted to OG format when possible (`en-US` → `en_US`).
|
|
64
|
+
* If conversion is not possible, `og:locale` tags are not emitted (dev warning when `missingWarn` is enabled).
|
|
64
65
|
*/
|
|
65
66
|
og?: string;
|
|
66
67
|
/**
|
|
@@ -213,6 +214,11 @@ export interface ModuleOptions {
|
|
|
213
214
|
* @default true
|
|
214
215
|
*/
|
|
215
216
|
components?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Preload index-page translations in Nitro global middleware (server-only, private config).
|
|
219
|
+
* @default false
|
|
220
|
+
*/
|
|
221
|
+
serverTranslationPreload?: boolean;
|
|
216
222
|
/**
|
|
217
223
|
* The locale to use when no locale can be determined from URL or user preferences.
|
|
218
224
|
* Also used as the fallback locale for missing translations when `fallbackLocale` is not set.
|
|
@@ -509,6 +515,8 @@ export interface ModulePrivateOptionsExtend extends ModuleOptions {
|
|
|
509
515
|
routesLocaleLinks?: {
|
|
510
516
|
[key: string]: string;
|
|
511
517
|
};
|
|
518
|
+
/** Preload index translations in Nitro global middleware. */
|
|
519
|
+
serverTranslationPreload?: boolean;
|
|
512
520
|
}
|
|
513
521
|
/** Object shape for a translation value that contains singular/plural forms. */
|
|
514
522
|
export interface PluralTranslations {
|
package/package.json
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-micro/types",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "TypeScript definitions for the Nuxt I18n Micro ecosystem.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"i18n",
|
|
7
|
+
"nuxt",
|
|
8
|
+
"types",
|
|
9
|
+
"typescript"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/types#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/s00d/nuxt-i18n-micro/issues"
|
|
9
14
|
},
|
|
10
15
|
"license": "MIT",
|
|
11
|
-
"type": "module",
|
|
12
|
-
"sideEffects": false,
|
|
13
16
|
"author": {
|
|
14
17
|
"name": "s00d",
|
|
15
18
|
"email": "Virus191288@gmail.com",
|
|
16
19
|
"url": "https://s00d.github.io/"
|
|
17
20
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"url": "https://github.com/s00d/nuxt-i18n-micro
|
|
21
|
-
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=18"
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/s00d/nuxt-i18n-micro.git",
|
|
24
|
+
"directory": "packages/types"
|
|
24
25
|
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"sideEffects": false,
|
|
25
33
|
"main": "dist/index.cjs",
|
|
26
34
|
"types": "dist/index.d.ts",
|
|
27
35
|
"exports": {
|
|
@@ -38,25 +46,17 @@
|
|
|
38
46
|
},
|
|
39
47
|
"./package.json": "./package.json"
|
|
40
48
|
},
|
|
41
|
-
"files": [
|
|
42
|
-
"dist",
|
|
43
|
-
"README.md",
|
|
44
|
-
"LICENSE"
|
|
45
|
-
],
|
|
46
49
|
"publishConfig": {
|
|
47
50
|
"access": "public"
|
|
48
51
|
},
|
|
49
|
-
"keywords": [
|
|
50
|
-
"nuxt",
|
|
51
|
-
"i18n",
|
|
52
|
-
"typescript",
|
|
53
|
-
"types"
|
|
54
|
-
],
|
|
55
52
|
"devDependencies": {
|
|
56
53
|
"publint": "^0.3.17",
|
|
57
54
|
"vite": "^7.3.1",
|
|
58
55
|
"vite-plugin-dts": "^4.5.4"
|
|
59
56
|
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=18"
|
|
59
|
+
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "vite build",
|
|
62
62
|
"check:package": "publint"
|