vue-i18n.d.mts 791 B

1234567891011121314151617181920212223242526272829
  1. import { I18n, useI18n } from 'vue-i18n';
  2. import { Ref } from 'vue';
  3. interface LocaleMessages {
  4. [key: string]: LocaleMessages | string;
  5. }
  6. interface LocaleOptions {
  7. messages?: LocaleMessages;
  8. locale?: string;
  9. fallback?: string;
  10. adapter?: LocaleInstance;
  11. }
  12. interface LocaleInstance {
  13. name: string;
  14. messages: Ref<LocaleMessages>;
  15. current: Ref<string>;
  16. fallback: Ref<string>;
  17. t: (key: string, ...params: unknown[]) => string;
  18. n: (value: number) => string;
  19. provide: (props: LocaleOptions) => LocaleInstance;
  20. }
  21. type VueI18nAdapterParams = {
  22. i18n: I18n<any, {}, {}, string, false>;
  23. useI18n: typeof useI18n;
  24. };
  25. declare function createVueI18nAdapter({ i18n, useI18n }: VueI18nAdapterParams): LocaleInstance;
  26. export { createVueI18nAdapter };