@i18n-micro/types 1.0.16 → 1.1.1

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/dist/index.d.ts CHANGED
@@ -64,20 +64,20 @@ export interface ModuleOptions {
64
64
  plural?: string | PluralFunc;
65
65
  disablePageLocales?: boolean;
66
66
  fallbackLocale?: string;
67
- localeCookie?: string;
67
+ localeCookie?: string | null;
68
68
  debug?: boolean;
69
69
  globalLocaleRoutes?: GlobalLocaleRoutes;
70
70
  customRegexMatcher?: string | RegExp;
71
71
  noPrefixRedirect?: boolean;
72
72
  canonicalQueryWhitelist?: string[];
73
73
  excludePatterns?: (string | RegExp)[];
74
+ localizedRouteNamePrefix?: string;
74
75
  routeLocales?: Record<string, string[]>;
75
76
  routeDisableMeta?: Record<string, boolean | string[]>;
76
77
  missingWarn?: boolean;
77
- experimental?: {
78
- i18nPreviousPageFallback?: boolean;
79
- hmr?: boolean;
80
- };
78
+ previousPageFallback?: boolean;
79
+ hmr?: boolean;
80
+ experimental?: Record<string, unknown>;
81
81
  }
82
82
  export interface ModuleOptionsExtend extends ModuleOptions {
83
83
  dateBuild: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/types",
3
- "version": "1.0.16",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "repository": "s00d/nuxt-i18n-micro",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -10,9 +10,7 @@ export interface DefineLocaleMessage {
10
10
  // Если интерфейс пустой (генератор не подключен), тип ключа — string.
11
11
  // Если в интерфейсе есть ключи, тип ключа — объединение этих ключей и string (Union Type).
12
12
  // Это позволяет использовать как строгие типы (автокомплит), так и обычные строки (динамические ключи).
13
- export type TranslationKey = keyof DefineLocaleMessage extends never
14
- ? string
15
- : keyof DefineLocaleMessage | string
13
+ export type TranslationKey = keyof DefineLocaleMessage extends never ? string : keyof DefineLocaleMessage | string
16
14
 
17
15
  /**
18
16
  * Хелпер для создания типизированных префиксов.
@@ -56,13 +54,7 @@ export type GlobalLocaleRoutes = Record<string, Record<LocaleCode, string> | fal
56
54
 
57
55
  export type Strategies = 'no_prefix' | 'prefix_except_default' | 'prefix' | 'prefix_and_default'
58
56
 
59
- export type MissingHandler = (
60
- locale: string,
61
- key: TranslationKey,
62
- routeName: string,
63
- instance?: unknown,
64
- type?: string
65
- ) => void
57
+ export type MissingHandler = (locale: string, key: TranslationKey, routeName: string, instance?: unknown, type?: string) => void
66
58
 
67
59
  export interface ModuleOptions {
68
60
  locales?: Locale[]
@@ -87,20 +79,20 @@ export interface ModuleOptions {
87
79
  plural?: string | PluralFunc
88
80
  disablePageLocales?: boolean
89
81
  fallbackLocale?: string
90
- localeCookie?: string
82
+ localeCookie?: string | null
91
83
  debug?: boolean
92
84
  globalLocaleRoutes?: GlobalLocaleRoutes
93
85
  customRegexMatcher?: string | RegExp
94
86
  noPrefixRedirect?: boolean
95
87
  canonicalQueryWhitelist?: string[]
96
88
  excludePatterns?: (string | RegExp)[]
89
+ localizedRouteNamePrefix?: string
97
90
  routeLocales?: Record<string, string[]>
98
91
  routeDisableMeta?: Record<string, boolean | string[]>
99
92
  missingWarn?: boolean
100
- experimental?: {
101
- i18nPreviousPageFallback?: boolean
102
- hmr?: boolean
103
- }
93
+ previousPageFallback?: boolean
94
+ hmr?: boolean
95
+ experimental?: Record<string, unknown>
104
96
  }
105
97
 
106
98
  export interface ModuleOptionsExtend extends ModuleOptions {
package/vite.config.mts CHANGED
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
1
  // @ts-nocheck
3
2
  import { resolve } from 'node:path'
4
3
  import { defineConfig } from 'vite'
@@ -10,7 +9,7 @@ export default defineConfig({
10
9
  entry: resolve(__dirname, 'src/index.ts'),
11
10
  name: '@i18n-micro/core',
12
11
  formats: ['cjs', 'es'],
13
- fileName: format => `index.${format === 'cjs' ? 'cjs' : 'mjs'}`,
12
+ fileName: (format) => `index.${format === 'cjs' ? 'cjs' : 'mjs'}`,
14
13
  },
15
14
  rollupOptions: {
16
15
  external: ['vue'],
@@ -19,7 +18,5 @@ export default defineConfig({
19
18
  },
20
19
  },
21
20
  },
22
- plugins: [
23
- dts(),
24
- ],
21
+ plugins: [dts()],
25
22
  })