{"version":3,"file":"common.cjs","sources":["../../../src/events/common.ts"],"sourcesContent":["import { AnnotationEvent } from '../types/annotations';\nimport { DataFrame } from '../types/dataFrame';\n\nimport { BusEventBase, BusEventWithPayload } from './types';\n\n/**\n * When hovering over an element this will identify\n *\n * For performance reasons, this object will usually be mutated between updates.  This\n * will avoid creating new objects for events that fire frequently (ie each mouse pixel)\n *\n * @alpha\n */\nexport interface DataHoverPayload {\n  data?: DataFrame; // source data\n  rowIndex?: number; // the hover row\n  columnIndex?: number; // the hover column\n  dataId?: string; // identifying string to correlate data between publishers and subscribers\n\n  // When dragging, this will capture the point when the mouse was down\n  point: Record<string, number | null>; // { time: 5678, lengthft: 456 }  // each axis|scale gets a value\n  down?: Record<string, number | null>;\n}\n\n/** @alpha */\nexport class DataHoverEvent extends BusEventWithPayload<DataHoverPayload> {\n  static type = 'data-hover';\n}\n\n/** @alpha */\nexport class DataHoverClearEvent extends BusEventBase {\n  static type = 'data-hover-clear';\n}\n\n/** @alpha */\nexport class DataSelectEvent extends BusEventWithPayload<DataHoverPayload> {\n  static type = 'data-select';\n}\n\n/** @alpha */\nexport class AnnotationChangeEvent extends BusEventWithPayload<Partial<AnnotationEvent>> {\n  static type = 'annotation-event';\n}\n\n// Loaded the first time a dashboard is loaded (not on every render)\nexport type DashboardLoadedEventPayload<T> = {\n  dashboardId: string; // eeep, this should be UID\n  orgId?: number;\n  userId?: number;\n  grafanaVersion?: string;\n  queries: Record<string, T[]>;\n};\n\n/** @alpha */\nexport class DashboardLoadedEvent<T> extends BusEventWithPayload<DashboardLoadedEventPayload<T>> {\n  static type = 'dashboard-loaded';\n}\nexport class DataSourceUpdatedSuccessfully extends BusEventBase {\n  static type = 'datasource-updated-successfully';\n}\nexport class DataSourceTestSucceeded extends BusEventBase {\n  static type = 'datasource-test-succeeded';\n}\n\nexport class DataSourceTestFailed extends BusEventBase {\n  static type = 'datasource-test-failed';\n}\n\nexport class SetPanelAttentionEvent extends BusEventWithPayload<{ panelId: string | number }> {\n  static type = 'set-panel-attention';\n}\n"],"names":["BusEventWithPayload","BusEventBase"],"mappings":";;;;;;;AAyBO,MAAM,uBAAuBA,yBAAA,CAAsC;AAE1E;AAFa,cAAA,CACJ,IAAA,GAAO,YAAA;AAIT,MAAM,4BAA4BC,kBAAA,CAAa;AAEtD;AAFa,mBAAA,CACJ,IAAA,GAAO,kBAAA;AAIT,MAAM,wBAAwBD,yBAAA,CAAsC;AAE3E;AAFa,eAAA,CACJ,IAAA,GAAO,aAAA;AAIT,MAAM,8BAA8BA,yBAAA,CAA8C;AAEzF;AAFa,qBAAA,CACJ,IAAA,GAAO,kBAAA;AAaT,MAAM,6BAAgCA,yBAAA,CAAoD;AAEjG;AAFa,oBAAA,CACJ,IAAA,GAAO,kBAAA;AAET,MAAM,sCAAsCC,kBAAA,CAAa;AAEhE;AAFa,6BAAA,CACJ,IAAA,GAAO,iCAAA;AAET,MAAM,gCAAgCA,kBAAA,CAAa;AAE1D;AAFa,uBAAA,CACJ,IAAA,GAAO,2BAAA;AAGT,MAAM,6BAA6BA,kBAAA,CAAa;AAEvD;AAFa,oBAAA,CACJ,IAAA,GAAO,wBAAA;AAGT,MAAM,+BAA+BD,yBAAA,CAAkD;AAE9F;AAFa,sBAAA,CACJ,IAAA,GAAO,qBAAA;;;;;;;;;;;;"}