@i18n-micro/types 1.1.1 → 1.1.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.
package/README.md CHANGED
@@ -53,7 +53,7 @@ const options: ModuleOptions = {
53
53
  locales,
54
54
  strategy,
55
55
  defaultLocale: 'en',
56
- includeDefaultLocaleRoute: true,
56
+ strategy: 'prefix',
57
57
  }
58
58
 
59
59
  // Define route parameters
package/dist/index.d.ts CHANGED
@@ -4,12 +4,12 @@ export interface DefineLocaleMessage {
4
4
  }
5
5
  export type TranslationKey = keyof DefineLocaleMessage extends never ? string : keyof DefineLocaleMessage | string;
6
6
  /**
7
- * Хелпер для создания типизированных префиксов.
8
- * Позволяет безопасно использовать динамические ключи.
7
+ * Helper for creating typed prefixes.
8
+ * Allows safe usage of dynamic keys.
9
9
  *
10
10
  * @example
11
11
  * ```typescript
12
- * // Допустим, есть ключи: 'errors.404', 'errors.500', 'btn.save'
12
+ * // Assuming keys: 'errors.404', 'errors.500', 'btn.save'
13
13
  * function getErrorText(code: string) {
14
14
  * return t(`errors.${code}` as ScopedKey<'errors'>)
15
15
  * }
@@ -57,7 +57,6 @@ export interface ModuleOptions {
57
57
  autoDetectPath?: string;
58
58
  disableWatcher?: boolean;
59
59
  types?: boolean;
60
- includeDefaultLocaleRoute?: boolean;
61
60
  routesLocaleLinks?: {
62
61
  [key: string]: string;
63
62
  };
@@ -77,6 +76,8 @@ export interface ModuleOptions {
77
76
  missingWarn?: boolean;
78
77
  previousPageFallback?: boolean;
79
78
  hmr?: boolean;
79
+ cacheMaxSize?: number;
80
+ cacheTtl?: number;
80
81
  experimental?: Record<string, unknown>;
81
82
  }
82
83
  export interface ModuleOptionsExtend extends ModuleOptions {
@@ -85,6 +86,7 @@ export interface ModuleOptionsExtend extends ModuleOptions {
85
86
  isSSG: boolean;
86
87
  apiBaseUrl: string;
87
88
  disablePageLocales: boolean;
89
+ redirects?: boolean;
88
90
  }
89
91
  export interface ModulePrivateOptionsExtend extends ModuleOptions {
90
92
  rootDir: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/types",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "",
5
5
  "repository": "s00d/nuxt-i18n-micro",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -1,24 +1,24 @@
1
1
  export type LocaleCode = string
2
2
 
3
- // Реестр ключей. Пользователь (через генератор) будет делать module augmentation этого интерфейса.
3
+ // Key registry. Users (via generator) will do module augmentation of this interface.
4
4
  export interface DefineLocaleMessage {
5
5
  // Module augmentation point - will be extended by @i18n-micro/types-generator
6
6
  readonly __augmentation?: never
7
7
  }
8
8
 
9
- // Логика определения типа ключа.
10
- // Если интерфейс пустой (генератор не подключен), тип ключа — string.
11
- // Если в интерфейсе есть ключи, тип ключа — объединение этих ключей и string (Union Type).
12
- // Это позволяет использовать как строгие типы (автокомплит), так и обычные строки (динамические ключи).
9
+ // Key type resolution logic.
10
+ // If the interface is empty (generator not connected), key type is string.
11
+ // If the interface has keys, key type is a union of those keys and string.
12
+ // This allows both strict types (autocomplete) and regular strings (dynamic keys).
13
13
  export type TranslationKey = keyof DefineLocaleMessage extends never ? string : keyof DefineLocaleMessage | string
14
14
 
15
15
  /**
16
- * Хелпер для создания типизированных префиксов.
17
- * Позволяет безопасно использовать динамические ключи.
16
+ * Helper for creating typed prefixes.
17
+ * Allows safe usage of dynamic keys.
18
18
  *
19
19
  * @example
20
20
  * ```typescript
21
- * // Допустим, есть ключи: 'errors.404', 'errors.500', 'btn.save'
21
+ * // Assuming keys: 'errors.404', 'errors.500', 'btn.save'
22
22
  * function getErrorText(code: string) {
23
23
  * return t(`errors.${code}` as ScopedKey<'errors'>)
24
24
  * }
@@ -74,7 +74,7 @@ export interface ModuleOptions {
74
74
  autoDetectPath?: string
75
75
  disableWatcher?: boolean
76
76
  types?: boolean
77
- includeDefaultLocaleRoute?: boolean
77
+
78
78
  routesLocaleLinks?: { [key: string]: string }
79
79
  plural?: string | PluralFunc
80
80
  disablePageLocales?: boolean
@@ -92,6 +92,8 @@ export interface ModuleOptions {
92
92
  missingWarn?: boolean
93
93
  previousPageFallback?: boolean
94
94
  hmr?: boolean
95
+ cacheMaxSize?: number
96
+ cacheTtl?: number
95
97
  experimental?: Record<string, unknown>
96
98
  }
97
99
 
@@ -101,6 +103,7 @@ export interface ModuleOptionsExtend extends ModuleOptions {
101
103
  isSSG: boolean
102
104
  apiBaseUrl: string
103
105
  disablePageLocales: boolean
106
+ redirects?: boolean
104
107
  }
105
108
 
106
109
  export interface ModulePrivateOptionsExtend extends ModuleOptions {