-
-
Notifications
You must be signed in to change notification settings - Fork 356
/
vue-i18n.d.ts
26 lines (22 loc) · 684 Bytes
/
vue-i18n.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import type { Locale, Path, Values } from 'vue-i18n/types'
import VueI18n from 'vue-i18n/types'
/**
* Overloads VueI18n interface to avoid needing to cast return value to string.
* @see https://github.com/kazupon/vue-i18n/issues/410
*/
declare module 'vue-i18n/types' {
export default class VueI18n {
t(key: Path, locale: Locale, values?: Values): string
t(key: Path, values?: Values): string
}
}
declare module 'vue/types/vue' {
interface Vue {
$t: typeof VueI18n.prototype.t
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface VueConstructor<V extends Vue = Vue> {
i18n: typeof VueI18n.prototype
}
}
export default VueI18n