]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add events property to Plugin defined type (#11350)
authorstockiNail <stocki.nail@gmail.com>
Tue, 20 Jun 2023 16:16:37 +0000 (18:16 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Jun 2023 16:16:37 +0000 (18:16 +0200)
src/types/index.d.ts

index 274ee56ff86dcdf95f78448eb2fa9c6b5748b93f..a3ef7bbd81c4e01d784c7c56deb553555761dfee 100644 (file)
@@ -816,6 +816,12 @@ export declare const layouts: {
 export interface Plugin<TType extends ChartType = ChartType, O = AnyObject> extends ExtendedPlugin<TType, O> {
   id: string;
 
+  /**
+   * The events option defines the browser events that the plugin should listen.
+   * @default ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove']
+   */
+  events?: (keyof HTMLElementEventMap)[]
+
   /**
    * @desc Called when plugin is installed for this chart instance. This hook is also invoked for disabled plugins (options === false).
    * @param {Chart} chart - The chart instance.