@i18n-micro/vue 1.3.2 → 1.3.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/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +565 -0
- package/dist/index.d.ts +565 -15
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -10
- package/dist/components/i18n-group.d.ts +0 -6
- package/dist/components/i18n-link.d.ts +0 -49
- package/dist/components/i18n-switcher.d.ts +0 -146
- package/dist/components/i18n-t.d.ts +0 -94
- package/dist/composables/use-locale-head.d.ts +0 -62
- package/dist/composer.d.ts +0 -38
- package/dist/injection.d.ts +0 -8
- package/dist/plugin.d.ts +0 -22
- package/dist/router/adapter.d.ts +0 -9
- package/dist/router/types.d.ts +0 -43
- package/dist/use-i18n.d.ts +0 -40
- package/dist/vue-shim.d.ts +0 -14
package/dist/plugin.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Locale } from '@i18n-micro/types';
|
|
2
|
-
import { Plugin } from 'vue';
|
|
3
|
-
import { VueI18n, VueI18nOptions } from './composer';
|
|
4
|
-
import { I18nRoutingStrategy } from './router/types';
|
|
5
|
-
export interface CreateI18nOptions extends VueI18nOptions {
|
|
6
|
-
routingStrategy?: I18nRoutingStrategy;
|
|
7
|
-
/**
|
|
8
|
-
* Array of locale configurations
|
|
9
|
-
* If provided, will be automatically provided to the app via I18nLocalesKey
|
|
10
|
-
*/
|
|
11
|
-
locales?: Locale[];
|
|
12
|
-
/**
|
|
13
|
-
* Default locale code
|
|
14
|
-
* If provided, will be automatically provided to the app via I18nDefaultLocaleKey
|
|
15
|
-
*/
|
|
16
|
-
defaultLocale?: string;
|
|
17
|
-
}
|
|
18
|
-
export type I18nPlugin = Plugin & {
|
|
19
|
-
global: VueI18n;
|
|
20
|
-
setRoutingStrategy: (strategy: I18nRoutingStrategy) => void;
|
|
21
|
-
};
|
|
22
|
-
export declare function createI18n(options: CreateI18nOptions): I18nPlugin;
|
package/dist/router/adapter.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Locale } from '@i18n-micro/types';
|
|
2
|
-
import { Router } from 'vue-router';
|
|
3
|
-
import { I18nRoutingStrategy } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Factory for Vue Router adapter
|
|
6
|
-
* Implements routing utilities for Vue Router
|
|
7
|
-
* Uses vue-router APIs for navigation and path resolution
|
|
8
|
-
*/
|
|
9
|
-
export declare function createVueRouterAdapter(router: Router, locales: Locale[], defaultLocale: string): I18nRoutingStrategy;
|
package/dist/router/types.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Routing strategy interface for i18n
|
|
4
|
-
* Implement this interface to integrate with any router library
|
|
5
|
-
*/
|
|
6
|
-
export interface I18nRoutingStrategy {
|
|
7
|
-
/**
|
|
8
|
-
* Returns current path (without locale prefix if needed, or full path)
|
|
9
|
-
* Used for determining active classes in links
|
|
10
|
-
*/
|
|
11
|
-
getCurrentPath: () => string;
|
|
12
|
-
/**
|
|
13
|
-
* Component to use for rendering links (e.g., RouterLink)
|
|
14
|
-
*/
|
|
15
|
-
linkComponent?: string | Component;
|
|
16
|
-
/**
|
|
17
|
-
* Function to navigate to another route/locale
|
|
18
|
-
*/
|
|
19
|
-
push: (target: {
|
|
20
|
-
path: string;
|
|
21
|
-
}) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Function to replace current route
|
|
24
|
-
*/
|
|
25
|
-
replace: (target: {
|
|
26
|
-
path: string;
|
|
27
|
-
}) => void;
|
|
28
|
-
/**
|
|
29
|
-
* Generate path for specific locale
|
|
30
|
-
*/
|
|
31
|
-
resolvePath?: (to: string | {
|
|
32
|
-
path?: string;
|
|
33
|
-
}, locale: string) => string | {
|
|
34
|
-
path?: string;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* (Optional) Get current route object for SEO/Meta tags
|
|
38
|
-
*/
|
|
39
|
-
getRoute?: () => {
|
|
40
|
-
fullPath: string;
|
|
41
|
-
query: Record<string, unknown>;
|
|
42
|
-
};
|
|
43
|
-
}
|
package/dist/use-i18n.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Locale } from '@i18n-micro/types';
|
|
2
|
-
import { VueI18n } from './composer';
|
|
3
|
-
export interface UseI18nOptions {
|
|
4
|
-
locales?: Locale[];
|
|
5
|
-
defaultLocale?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Get the i18n instance from the Vue app context
|
|
9
|
-
* Returns the same instance that was created with createI18n()
|
|
10
|
-
*/
|
|
11
|
-
export declare function useI18n(options?: UseI18nOptions): {
|
|
12
|
-
instance: VueI18n;
|
|
13
|
-
locale: import('vue').WritableComputedRef<string, string>;
|
|
14
|
-
getLocales: () => Locale[];
|
|
15
|
-
defaultLocale: () => string;
|
|
16
|
-
getLocaleName: () => string | null;
|
|
17
|
-
localeRoute: (to: string | {
|
|
18
|
-
path?: string;
|
|
19
|
-
}, localeCode?: string) => string | {
|
|
20
|
-
path?: string;
|
|
21
|
-
};
|
|
22
|
-
localePath: (to: string | {
|
|
23
|
-
path?: string;
|
|
24
|
-
}, locale?: string) => string;
|
|
25
|
-
switchLocale: (newLocale: string) => void;
|
|
26
|
-
t: (key: import('@i18n-micro/types').TranslationKey, params?: import('@i18n-micro/types').Params, defaultValue?: string | null, routeName?: string) => import('@i18n-micro/types').CleanTranslation;
|
|
27
|
-
ts: (key: import('@i18n-micro/types').TranslationKey, params?: import('@i18n-micro/types').Params, defaultValue?: string, routeName?: string) => string;
|
|
28
|
-
tc: (key: import('@i18n-micro/types').TranslationKey, count: number | import('@i18n-micro/types').Params, defaultValue?: string) => string;
|
|
29
|
-
tn: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
30
|
-
td: (value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string;
|
|
31
|
-
tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string;
|
|
32
|
-
has: (key: import('@i18n-micro/types').TranslationKey, routeName?: string) => boolean;
|
|
33
|
-
setRoute: (routeName: string) => void;
|
|
34
|
-
getRoute: () => string;
|
|
35
|
-
getLocale: () => string;
|
|
36
|
-
addTranslations: (locale: string, translations: import('@i18n-micro/types').Translations, merge?: boolean) => void;
|
|
37
|
-
addRouteTranslations: (locale: string, routeName: string, translations: import('@i18n-micro/types').Translations, merge?: boolean) => void;
|
|
38
|
-
mergeTranslations: (locale: string, routeName: string, translations: import('@i18n-micro/types').Translations) => void;
|
|
39
|
-
clearCache: () => void;
|
|
40
|
-
};
|
package/dist/vue-shim.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Params, CleanTranslation, TranslationKey } from '@i18n-micro/types';
|
|
2
|
-
// Extend '@vue/runtime-core' module so types work correctly in all environments
|
|
3
|
-
declare module '@vue/runtime-core' {
|
|
4
|
-
interface ComponentCustomProperties {
|
|
5
|
-
$t: (key: TranslationKey, params?: Params, defaultValue?: string | null, routeName?: string) => CleanTranslation
|
|
6
|
-
$ts: (key: TranslationKey, params?: Params, defaultValue?: string, routeName?: string) => string
|
|
7
|
-
$tc: (key: TranslationKey, count: number | Params, defaultValue?: string) => string
|
|
8
|
-
$tn: (value: number, options?: Intl.NumberFormatOptions) => string
|
|
9
|
-
$td: (value: Date | number | string, options?: Intl.DateTimeFormatOptions) => string
|
|
10
|
-
$tdr: (value: Date | number | string, options?: Intl.RelativeTimeFormatOptions) => string
|
|
11
|
-
$has: (key: TranslationKey, routeName?: string) => boolean
|
|
12
|
-
$i18n: any
|
|
13
|
-
}
|
|
14
|
-
}
|