11import { aggregators , locales } from './utilities'
22import { redColorScaleGenerator } from './redColorScaleGenerator'
3+ import type { PropType } from 'vue'
4+
35export default {
46 data : {
5- type : [ Array , Object , Function ] ,
7+ type : [ Array , Object , Function ] as PropType < any > ,
68 required : true
79 } ,
810 aggregators : {
9- type : Object ,
11+ type : Object as PropType < Record < string , Function > > ,
1012 default : ( ) => aggregators
1113 } ,
1214 aggregatorName : {
1315 type : String ,
1416 default : 'Count'
1517 } ,
16- heatmapMode : String ,
18+ heatmapMode : String as PropType < 'full' | 'col' | 'row' | '' > ,
1719 tableColorScaleGenerator : {
1820 type : Function ,
1921 default : redColorScaleGenerator
2022 } ,
2123 tableOptions : {
22- type : Object ,
24+ type : Object as PropType < Record < string , any > > ,
2325 default : ( ) => ( { } )
2426 } ,
2527 renderers : {
26- type : Object ,
28+ type : Object as PropType < Record < string , any > > ,
2729 default : ( ) => ( { } )
2830 } ,
2931 rendererName : {
@@ -35,7 +37,7 @@ export default {
3537 default : 'en'
3638 } ,
3739 languagePack : {
38- type : Object ,
40+ type : Object as PropType < Record < string , any > > ,
3941 default : ( ) => locales
4042 } ,
4143 showRowTotal : {
@@ -47,48 +49,48 @@ export default {
4749 default : true
4850 } ,
4951 cols : {
50- type : Array ,
52+ type : Array as PropType < string [ ] > ,
5153 default : ( ) => [ ]
5254 } ,
5355 rows : {
54- type : Array ,
56+ type : Array as PropType < string [ ] > ,
5557 default : ( ) => [ ]
5658 } ,
5759 vals : {
58- type : Array ,
60+ type : Array as PropType < string [ ] > ,
5961 default : ( ) => [ ]
6062 } ,
6163 attributes : {
62- type : Array ,
64+ type : Array as PropType < string [ ] > ,
6365 default : ( ) => [ ]
6466 } ,
6567 valueFilter : {
66- type : Object ,
68+ type : Object as PropType < Record < string , any > > ,
6769 default : ( ) => ( { } )
6870 } ,
6971 sorters : {
70- type : [ Function , Object ] ,
72+ type : [ Function , Object ] as PropType < any > ,
7173 default : ( ) => ( { } )
7274 } ,
7375 derivedAttributes : {
74- type : [ Function , Object ] ,
76+ type : [ Function , Object ] as PropType < any > ,
7577 default : ( ) => ( { } )
7678 } ,
7779 rowOrder : {
78- type : String ,
80+ type : String as PropType < 'key_a_to_z' | 'value_a_to_z' | 'value_z_to_a' > ,
7981 default : 'key_a_to_z' ,
80- validator : ( value ) =>
82+ validator : ( value : string ) =>
8183 [ 'key_a_to_z' , 'value_a_to_z' , 'value_z_to_a' ] . indexOf ( value ) !== - 1
8284 } ,
8385 colOrder : {
84- type : String ,
86+ type : String as PropType < 'key_a_to_z' | 'value_a_to_z' | 'value_z_to_a' > ,
8587 default : 'key_a_to_z' ,
86- validator : ( value ) =>
88+ validator : ( value : string ) =>
8789 [ 'key_a_to_z' , 'value_a_to_z' , 'value_z_to_a' ] . indexOf ( value ) !== - 1
8890 } ,
8991 tableMaxWidth : {
9092 type : Number ,
9193 default : 0 ,
92- validator : ( value ) => value >= 0
94+ validator : ( value : number ) => value >= 0
9395 }
9496}
0 commit comments