@yiiamee/multilinguist 1.2.4 → 1.2.6

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/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@yiiamee/multilinguist",
3
3
  "configKey": "multilinguist",
4
- "version": "0.0.1",
4
+ "version": "1.2.5",
5
5
  "compatibility": {
6
- "nuxt": "^3.14.0"
6
+ "nuxt": "^3.0.0"
7
7
  },
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -30,15 +30,18 @@ function GenerateLocaleKeysPlugin(defaultLocaleFromConfig, localesPath, outPath)
30
30
  ``,
31
31
  `declare module '#app' {`,
32
32
  ` interface NuxtApp {`,
33
- " $t: (key: LocaleKey, variables?: Record<string, string>) => string;",
33
+ " $t<K extends LocaleKey>(key: K, variables?: Record<string, string>): string; ",
34
+ " t<K extends LocaleKey>(key: K, variables?: Record<string, string>): string; ",
34
35
  ` }`,
35
36
  `}`,
36
37
  ``,
37
38
  `declare module 'vue' {`,
38
39
  ` interface ComponentCustomProperties {`,
39
- " $t: (key: LocaleKey, variables?: Record<string, string>) => string;",
40
+ " $t<K extends LocaleKey>(key: K, variables?: Record<string, string>): string; ",
41
+ " t<K extends LocaleKey>(key: K, variables?: Record<string, string>): string; ",
40
42
  ` }`,
41
- `}`
43
+ `}`,
44
+ ``
42
45
  ].join("\n");
43
46
  fs.mkdirSync(path.dirname(outPath), { recursive: true });
44
47
  fs.writeFileSync(outPath, output, "utf-8");
@@ -61,9 +64,9 @@ const module = defineNuxtModule({
61
64
  meta: {
62
65
  name: "@yiiamee/multilinguist",
63
66
  configKey: "multilinguist",
64
- version: "0.0.1",
67
+ version: "1.2.5",
65
68
  compatibility: {
66
- nuxt: "^3.14.0"
69
+ nuxt: "^3.0.0"
67
70
  }
68
71
  },
69
72
  setup(moduleOptions, nuxtApp) {
@@ -4,7 +4,7 @@ export type TranslationMap = readonly string[];
4
4
  export type Locale<T extends TranslationMap> = T[number];
5
5
  export type LocaleKeys<T extends TranslationMap> = T[keyof T];
6
6
  export type TMultilinguistResponse<T extends TranslationMap> = {
7
- t: (key: LocaleKey, variables?: Record<string, string>) => string;
7
+ t<K extends LocaleKey>(key: K, variables?: Record<string, string>): string;
8
8
  setLocale: (locale: Locale<T>) => void;
9
9
  initLocalization: () => Promise<void>;
10
10
  locale: Ref<Locale<T>>;
@@ -1,5 +1,5 @@
1
1
  export default function useMultilinguist(): {
2
- t: (key: LocaleKey, variables?: Record<string, string>) => string;
2
+ t<K extends LocaleKey>(key: K, variables?: Record<string, string>): string;
3
3
  setLocale: (locale: string) => void;
4
4
  initLocalization: () => Promise<void>;
5
5
  locale: import("vue").Ref<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yiiamee/multilinguist",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Nuxt 3 Multilinguist Localization module",
5
5
  "repository": "yiiameeMich/multilinguist",
6
6
  "license": "MIT",