@i18n-micro/types 1.2.3 → 1.2.4

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 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
@@ -213,6 +213,11 @@ export interface ModuleOptions {
213
213
  * @default true
214
214
  */
215
215
  components?: boolean;
216
+ /**
217
+ * Preload index-page translations in Nitro global middleware (server-only, private config).
218
+ * @default false
219
+ */
220
+ serverTranslationPreload?: boolean;
216
221
  /**
217
222
  * The locale to use when no locale can be determined from URL or user preferences.
218
223
  * Also used as the fallback locale for missing translations when `fallbackLocale` is not set.
@@ -509,6 +514,8 @@ export interface ModulePrivateOptionsExtend extends ModuleOptions {
509
514
  routesLocaleLinks?: {
510
515
  [key: string]: string;
511
516
  };
517
+ /** Preload index translations in Nitro global middleware. */
518
+ serverTranslationPreload?: boolean;
512
519
  }
513
520
  /** Object shape for a translation value that contains singular/plural forms. */
514
521
  export interface PluralTranslations {
package/dist/index.d.ts CHANGED
@@ -213,6 +213,11 @@ export interface ModuleOptions {
213
213
  * @default true
214
214
  */
215
215
  components?: boolean;
216
+ /**
217
+ * Preload index-page translations in Nitro global middleware (server-only, private config).
218
+ * @default false
219
+ */
220
+ serverTranslationPreload?: boolean;
216
221
  /**
217
222
  * The locale to use when no locale can be determined from URL or user preferences.
218
223
  * Also used as the fallback locale for missing translations when `fallbackLocale` is not set.
@@ -509,6 +514,8 @@ export interface ModulePrivateOptionsExtend extends ModuleOptions {
509
514
  routesLocaleLinks?: {
510
515
  [key: string]: string;
511
516
  };
517
+ /** Preload index translations in Nitro global middleware. */
518
+ serverTranslationPreload?: boolean;
512
519
  }
513
520
  /** Object shape for a translation value that contains singular/plural forms. */
514
521
  export interface PluralTranslations {
package/package.json CHANGED
@@ -1,27 +1,35 @@
1
1
  {
2
2
  "name": "@i18n-micro/types",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "TypeScript definitions for the Nuxt I18n Micro ecosystem.",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/s00d/nuxt-i18n-micro.git",
8
- "directory": "packages/types"
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
- "homepage": "https://github.com/s00d/nuxt-i18n-micro/tree/main/packages/types#readme",
19
- "bugs": {
20
- "url": "https://github.com/s00d/nuxt-i18n-micro/issues"
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"