All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.locale.adapters.vue-i18n.d.mts Maven / Gradle / Ivy

import { I18n, useI18n } from 'vue-i18n';
import { Ref } from 'vue';

interface LocaleMessages {
    [key: string]: LocaleMessages | string;
}
interface LocaleOptions {
    messages?: LocaleMessages;
    locale?: string;
    fallback?: string;
    adapter?: LocaleInstance;
}
interface LocaleInstance {
    name: string;
    messages: Ref;
    current: Ref;
    fallback: Ref;
    t: (key: string, ...params: unknown[]) => string;
    n: (value: number) => string;
    provide: (props: LocaleOptions) => LocaleInstance;
}

type VueI18nAdapterParams = {
    i18n: I18n;
    useI18n: typeof useI18n;
};
declare function createVueI18nAdapter({ i18n, useI18n }: VueI18nAdapterParams): LocaleInstance;

export { createVueI18nAdapter };




© 2015 - 2024 Weber Informatics LLC | Privacy Policy