1
1
// #region Vue 2
2
+ import { PropType , DefineComponent } from 'vue-demi'
3
+ import { FluentVariable } from '@fluent/bundle'
4
+
2
5
declare module 'vue/types/vue' {
3
6
interface Vue {
4
7
$t : ( key : string , values ?: Record < string , unknown > ) => string
@@ -13,6 +16,46 @@ declare module '@vue/runtime-core' {
13
16
$t : ( key : string , values ?: Record < string , unknown > ) => string
14
17
$ta : ( key : string , values ?: Record < string , unknown > ) => Record < string , string >
15
18
}
19
+
20
+ interface GlobalComponents {
21
+ i18n : DefineComponent < {
22
+ /**
23
+ * The key of the translation.
24
+ */
25
+ path : {
26
+ type : StringConstructor ,
27
+ required : true ,
28
+ } ,
29
+ /**
30
+ * Arguments to pass to the translation.
31
+ */
32
+ args : {
33
+ type : PropType < Record < string , FluentVariable > > ,
34
+ default : ( ) => Record < string , FluentVariable > ,
35
+ } ,
36
+ /**
37
+ * The tag to use as a root element.
38
+ */
39
+ tag : {
40
+ type : StringConstructor ,
41
+ default : 'span' ,
42
+ } ,
43
+ /**
44
+ * Whether to render translation as html.
45
+ */
46
+ html : {
47
+ type : BooleanConstructor ,
48
+ default : false ,
49
+ } ,
50
+ /**
51
+ * Whether to render translation without a root element.
52
+ */
53
+ noTag : {
54
+ type : BooleanConstructor ,
55
+ default : false ,
56
+ }
57
+ } >
58
+ }
16
59
}
17
60
// #endregion
18
61
0 commit comments