@i18n-micro/types 1.1.0 → 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/package.json +1 -1
- package/src/index.ts +2 -10
- package/vite.config.mts +2 -5
package/package.json
CHANGED
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[]
|
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
|
})
|