@@ -829,37 +829,37 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
829
829
* @param {object } options - The plugin options.
830
830
* @since 3.0.0
831
831
*/
832
- install ?( chart : Chart , args : EmptyObject , options : O ) : void ;
832
+ install ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
833
833
/**
834
834
* @desc Called when a plugin is starting. This happens when chart is created or plugin is enabled.
835
835
* @param {Chart } chart - The chart instance.
836
836
* @param {object } args - The call arguments.
837
837
* @param {object } options - The plugin options.
838
838
* @since 3.0.0
839
839
*/
840
- start ?( chart : Chart , args : EmptyObject , options : O ) : void ;
840
+ start ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
841
841
/**
842
842
* @desc Called when a plugin stopping. This happens when chart is destroyed or plugin is disabled.
843
843
* @param {Chart } chart - The chart instance.
844
844
* @param {object } args - The call arguments.
845
845
* @param {object } options - The plugin options.
846
846
* @since 3.0.0
847
847
*/
848
- stop ?( chart : Chart , args : EmptyObject , options : O ) : void ;
848
+ stop ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
849
849
/**
850
850
* @desc Called before initializing `chart`.
851
851
* @param {Chart } chart - The chart instance.
852
852
* @param {object } args - The call arguments.
853
853
* @param {object } options - The plugin options.
854
854
*/
855
- beforeInit ?( chart : Chart , args : EmptyObject , options : O ) : void ;
855
+ beforeInit ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
856
856
/**
857
857
* @desc Called after `chart` has been initialized and before the first update.
858
858
* @param {Chart } chart - The chart instance.
859
859
* @param {object } args - The call arguments.
860
860
* @param {object } options - The plugin options.
861
861
*/
862
- afterInit ?( chart : Chart , args : EmptyObject , options : O ) : void ;
862
+ afterInit ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
863
863
/**
864
864
* @desc Called before updating `chart`. If any plugin returns `false`, the update
865
865
* is cancelled (and thus subsequent render(s)) until another `update` is triggered.
@@ -869,7 +869,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
869
869
* @param {object } options - The plugin options.
870
870
* @returns {boolean } `false` to cancel the chart update.
871
871
*/
872
- beforeUpdate ?( chart : Chart , args : { mode : UpdateMode , cancelable : true } , options : O ) : boolean | void ;
872
+ beforeUpdate ?( chart : Chart < TType > , args : { mode : UpdateMode , cancelable : true } , options : O ) : boolean | void ;
873
873
/**
874
874
* @desc Called after `chart` has been updated and before rendering. Note that this
875
875
* hook will not be called if the chart update has been previously cancelled.
@@ -878,23 +878,23 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
878
878
* @param {UpdateMode } args.mode - The update mode
879
879
* @param {object } options - The plugin options.
880
880
*/
881
- afterUpdate ?( chart : Chart , args : { mode : UpdateMode } , options : O ) : void ;
881
+ afterUpdate ?( chart : Chart < TType > , args : { mode : UpdateMode } , options : O ) : void ;
882
882
/**
883
883
* @desc Called during the update process, before any chart elements have been created.
884
884
* This can be used for data decimation by changing the data array inside a dataset.
885
885
* @param {Chart } chart - The chart instance.
886
886
* @param {object } args - The call arguments.
887
887
* @param {object } options - The plugin options.
888
888
*/
889
- beforeElementsUpdate ?( chart : Chart , args : EmptyObject , options : O ) : void ;
889
+ beforeElementsUpdate ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
890
890
/**
891
891
* @desc Called during chart reset
892
892
* @param {Chart } chart - The chart instance.
893
893
* @param {object } args - The call arguments.
894
894
* @param {object } options - The plugin options.
895
895
* @since version 3.0.0
896
896
*/
897
- reset ?( chart : Chart , args : EmptyObject , options : O ) : void ;
897
+ reset ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
898
898
/**
899
899
* @desc Called before updating the `chart` datasets. If any plugin returns `false`,
900
900
* the datasets update is cancelled until another `update` is triggered.
@@ -905,7 +905,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
905
905
* @returns {boolean } false to cancel the datasets update.
906
906
* @since version 2.1.5
907
907
*/
908
- beforeDatasetsUpdate ?( chart : Chart , args : { mode : UpdateMode } , options : O ) : boolean | void ;
908
+ beforeDatasetsUpdate ?( chart : Chart < TType > , args : { mode : UpdateMode } , options : O ) : boolean | void ;
909
909
/**
910
910
* @desc Called after the `chart` datasets have been updated. Note that this hook
911
911
* will not be called if the datasets update has been previously cancelled.
@@ -915,7 +915,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
915
915
* @param {object } options - The plugin options.
916
916
* @since version 2.1.5
917
917
*/
918
- afterDatasetsUpdate ?( chart : Chart , args : { mode : UpdateMode , cancelable : true } , options : O ) : void ;
918
+ afterDatasetsUpdate ?( chart : Chart < TType > , args : { mode : UpdateMode , cancelable : true } , options : O ) : void ;
919
919
/**
920
920
* @desc Called before updating the `chart` dataset at the given `args.index`. If any plugin
921
921
* returns `false`, the datasets update is cancelled until another `update` is triggered.
@@ -927,7 +927,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
927
927
* @param {object } options - The plugin options.
928
928
* @returns {boolean } `false` to cancel the chart datasets drawing.
929
929
*/
930
- beforeDatasetUpdate ?( chart : Chart , args : { index : number ; meta : ChartMeta , mode : UpdateMode , cancelable : true } , options : O ) : boolean | void ;
930
+ beforeDatasetUpdate ?( chart : Chart < TType > , args : { index : number ; meta : ChartMeta , mode : UpdateMode , cancelable : true } , options : O ) : boolean | void ;
931
931
/**
932
932
* @desc Called after the `chart` datasets at the given `args.index` has been updated. Note
933
933
* that this hook will not be called if the datasets update has been previously cancelled.
@@ -938,7 +938,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
938
938
* @param {UpdateMode } args.mode - The update mode.
939
939
* @param {object } options - The plugin options.
940
940
*/
941
- afterDatasetUpdate ?( chart : Chart , args : { index : number ; meta : ChartMeta , mode : UpdateMode , cancelable : false } , options : O ) : void ;
941
+ afterDatasetUpdate ?( chart : Chart < TType > , args : { index : number ; meta : ChartMeta , mode : UpdateMode , cancelable : false } , options : O ) : void ;
942
942
/**
943
943
* @desc Called before laying out `chart`. If any plugin returns `false`,
944
944
* the layout update is cancelled until another `update` is triggered.
@@ -947,47 +947,47 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
947
947
* @param {object } options - The plugin options.
948
948
* @returns {boolean } `false` to cancel the chart layout.
949
949
*/
950
- beforeLayout ?( chart : Chart , args : { cancelable : true } , options : O ) : boolean | void ;
950
+ beforeLayout ?( chart : Chart < TType > , args : { cancelable : true } , options : O ) : boolean | void ;
951
951
/**
952
952
* @desc Called before scale data limits are calculated. This hook is called separately for each scale in the chart.
953
953
* @param {Chart } chart - The chart instance.
954
954
* @param {object } args - The call arguments.
955
955
* @param {Scale } args.scale - The scale.
956
956
* @param {object } options - The plugin options.
957
957
*/
958
- beforeDataLimits ?( chart : Chart , args : { scale : Scale } , options : O ) : void ;
958
+ beforeDataLimits ?( chart : Chart < TType > , args : { scale : Scale } , options : O ) : void ;
959
959
/**
960
960
* @desc Called after scale data limits are calculated. This hook is called separately for each scale in the chart.
961
961
* @param {Chart } chart - The chart instance.
962
962
* @param {object } args - The call arguments.
963
963
* @param {Scale } args.scale - The scale.
964
964
* @param {object } options - The plugin options.
965
965
*/
966
- afterDataLimits ?( chart : Chart , args : { scale : Scale } , options : O ) : void ;
966
+ afterDataLimits ?( chart : Chart < TType > , args : { scale : Scale } , options : O ) : void ;
967
967
/**
968
968
* @desc Called before scale builds its ticks. This hook is called separately for each scale in the chart.
969
969
* @param {Chart } chart - The chart instance.
970
970
* @param {object } args - The call arguments.
971
971
* @param {Scale } args.scale - The scale.
972
972
* @param {object } options - The plugin options.
973
973
*/
974
- beforeBuildTicks ?( chart : Chart , args : { scale : Scale } , options : O ) : void ;
974
+ beforeBuildTicks ?( chart : Chart < TType > , args : { scale : Scale } , options : O ) : void ;
975
975
/**
976
976
* @desc Called after scale has build its ticks. This hook is called separately for each scale in the chart.
977
977
* @param {Chart } chart - The chart instance.
978
978
* @param {object } args - The call arguments.
979
979
* @param {Scale } args.scale - The scale.
980
980
* @param {object } options - The plugin options.
981
981
*/
982
- afterBuildTicks ?( chart : Chart , args : { scale : Scale } , options : O ) : void ;
982
+ afterBuildTicks ?( chart : Chart < TType > , args : { scale : Scale } , options : O ) : void ;
983
983
/**
984
984
* @desc Called after the `chart` has been laid out. Note that this hook will not
985
985
* be called if the layout update has been previously cancelled.
986
986
* @param {Chart } chart - The chart instance.
987
987
* @param {object } args - The call arguments.
988
988
* @param {object } options - The plugin options.
989
989
*/
990
- afterLayout ?( chart : Chart , args : EmptyObject , options : O ) : void ;
990
+ afterLayout ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
991
991
/**
992
992
* @desc Called before rendering `chart`. If any plugin returns `false`,
993
993
* the rendering is cancelled until another `render` is triggered.
@@ -996,15 +996,15 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
996
996
* @param {object } options - The plugin options.
997
997
* @returns {boolean } `false` to cancel the chart rendering.
998
998
*/
999
- beforeRender ?( chart : Chart , args : { cancelable : true } , options : O ) : boolean | void ;
999
+ beforeRender ?( chart : Chart < TType > , args : { cancelable : true } , options : O ) : boolean | void ;
1000
1000
/**
1001
1001
* @desc Called after the `chart` has been fully rendered (and animation completed). Note
1002
1002
* that this hook will not be called if the rendering has been previously cancelled.
1003
1003
* @param {Chart } chart - The chart instance.
1004
1004
* @param {object } args - The call arguments.
1005
1005
* @param {object } options - The plugin options.
1006
1006
*/
1007
- afterRender ?( chart : Chart , args : EmptyObject , options : O ) : void ;
1007
+ afterRender ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
1008
1008
/**
1009
1009
* @desc Called before drawing `chart` at every animation frame. If any plugin returns `false`,
1010
1010
* the frame drawing is cancelled untilanother `render` is triggered.
@@ -1013,15 +1013,15 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
1013
1013
* @param {object } options - The plugin options.
1014
1014
* @returns {boolean } `false` to cancel the chart drawing.
1015
1015
*/
1016
- beforeDraw ?( chart : Chart , args : { cancelable : true } , options : O ) : boolean | void ;
1016
+ beforeDraw ?( chart : Chart < TType > , args : { cancelable : true } , options : O ) : boolean | void ;
1017
1017
/**
1018
1018
* @desc Called after the `chart` has been drawn. Note that this hook will not be called
1019
1019
* if the drawing has been previously cancelled.
1020
1020
* @param {Chart } chart - The chart instance.
1021
1021
* @param {object } args - The call arguments.
1022
1022
* @param {object } options - The plugin options.
1023
1023
*/
1024
- afterDraw ?( chart : Chart , args : EmptyObject , options : O ) : void ;
1024
+ afterDraw ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
1025
1025
/**
1026
1026
* @desc Called before drawing the `chart` datasets. If any plugin returns `false`,
1027
1027
* the datasets drawing is cancelled until another `render` is triggered.
@@ -1030,15 +1030,15 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
1030
1030
* @param {object } options - The plugin options.
1031
1031
* @returns {boolean } `false` to cancel the chart datasets drawing.
1032
1032
*/
1033
- beforeDatasetsDraw ?( chart : Chart , args : { cancelable : true } , options : O ) : boolean | void ;
1033
+ beforeDatasetsDraw ?( chart : Chart < TType > , args : { cancelable : true } , options : O ) : boolean | void ;
1034
1034
/**
1035
1035
* @desc Called after the `chart` datasets have been drawn. Note that this hook
1036
1036
* will not be called if the datasets drawing has been previously cancelled.
1037
1037
* @param {Chart } chart - The chart instance.
1038
1038
* @param {object } args - The call arguments.
1039
1039
* @param {object } options - The plugin options.
1040
1040
*/
1041
- afterDatasetsDraw ?( chart : Chart , args : EmptyObject , options : O , cancelable : false ) : void ;
1041
+ afterDatasetsDraw ?( chart : Chart < TType > , args : EmptyObject , options : O , cancelable : false ) : void ;
1042
1042
/**
1043
1043
* @desc Called before drawing the `chart` dataset at the given `args.index` (datasets
1044
1044
* are drawn in the reverse order). If any plugin returns `false`, the datasets drawing
@@ -1050,7 +1050,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
1050
1050
* @param {object } options - The plugin options.
1051
1051
* @returns {boolean } `false` to cancel the chart datasets drawing.
1052
1052
*/
1053
- beforeDatasetDraw ?( chart : Chart , args : { index : number ; meta : ChartMeta } , options : O ) : boolean | void ;
1053
+ beforeDatasetDraw ?( chart : Chart < TType > , args : { index : number ; meta : ChartMeta } , options : O ) : boolean | void ;
1054
1054
/**
1055
1055
* @desc Called after the `chart` datasets at the given `args.index` have been drawn
1056
1056
* (datasets are drawn in the reverse order). Note that this hook will not be called
@@ -1061,7 +1061,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
1061
1061
* @param {object } args.meta - The dataset metadata.
1062
1062
* @param {object } options - The plugin options.
1063
1063
*/
1064
- afterDatasetDraw ?( chart : Chart , args : { index : number ; meta : ChartMeta } , options : O ) : void ;
1064
+ afterDatasetDraw ?( chart : Chart < TType > , args : { index : number ; meta : ChartMeta } , options : O ) : void ;
1065
1065
/**
1066
1066
* @desc Called before processing the specified `event`. If any plugin returns `false`,
1067
1067
* the event will be discarded.
@@ -1072,7 +1072,7 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
1072
1072
* @param {boolean } args.inChartArea - The event position is inside chartArea
1073
1073
* @param {object } options - The plugin options.
1074
1074
*/
1075
- beforeEvent ?( chart : Chart , args : { event : ChartEvent , replay : boolean , cancelable : true , inChartArea : boolean } , options : O ) : boolean | void ;
1075
+ beforeEvent ?( chart : Chart < TType > , args : { event : ChartEvent , replay : boolean , cancelable : true , inChartArea : boolean } , options : O ) : boolean | void ;
1076
1076
/**
1077
1077
* @desc Called after the `event` has been consumed. Note that this hook
1078
1078
* will not be called if the `event` has been previously discarded.
@@ -1084,37 +1084,37 @@ export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> exte
1084
1084
* @param {boolean } [args.changed] - Set to true if the plugin needs a render. Should only be changed to true, because this args object is passed through all plugins.
1085
1085
* @param {object } options - The plugin options.
1086
1086
*/
1087
- afterEvent ?( chart : Chart , args : { event : ChartEvent , replay : boolean , changed ?: boolean , cancelable : false , inChartArea : boolean } , options : O ) : void ;
1087
+ afterEvent ?( chart : Chart < TType > , args : { event : ChartEvent , replay : boolean , changed ?: boolean , cancelable : false , inChartArea : boolean } , options : O ) : void ;
1088
1088
/**
1089
1089
* @desc Called after the chart as been resized.
1090
1090
* @param {Chart } chart - The chart instance.
1091
1091
* @param {object } args - The call arguments.
1092
1092
* @param {number } args.size - The new canvas display size (eq. canvas.style width & height).
1093
1093
* @param {object } options - The plugin options.
1094
1094
*/
1095
- resize ?( chart : Chart , args : { size : { width : number , height : number } } , options : O ) : void ;
1095
+ resize ?( chart : Chart < TType > , args : { size : { width : number , height : number } } , options : O ) : void ;
1096
1096
/**
1097
1097
* Called before the chart is being destroyed.
1098
1098
* @param {Chart } chart - The chart instance.
1099
1099
* @param {object } args - The call arguments.
1100
1100
* @param {object } options - The plugin options.
1101
1101
*/
1102
- beforeDestroy ?( chart : Chart , args : EmptyObject , options : O ) : void ;
1102
+ beforeDestroy ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
1103
1103
/**
1104
1104
* Called after the chart has been destroyed.
1105
1105
* @param {Chart } chart - The chart instance.
1106
1106
* @param {object } args - The call arguments.
1107
1107
* @param {object } options - The plugin options.
1108
1108
*/
1109
- afterDestroy ?( chart : Chart , args : EmptyObject , options : O ) : void ;
1109
+ afterDestroy ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
1110
1110
/**
1111
1111
* Called after chart is destroyed on all plugins that were installed for that chart. This hook is also invoked for disabled plugins (options === false).
1112
1112
* @param {Chart } chart - The chart instance.
1113
1113
* @param {object } args - The call arguments.
1114
1114
* @param {object } options - The plugin options.
1115
1115
* @since 3.0.0
1116
1116
*/
1117
- uninstall ?( chart : Chart , args : EmptyObject , options : O ) : void ;
1117
+ uninstall ?( chart : Chart < TType > , args : EmptyObject , options : O ) : void ;
1118
1118
1119
1119
/**
1120
1120
* Default options used in the plugin
0 commit comments