@grafana/runtime
Version:
Grafana Runtime Library
1 lines • 1.85 kB
Source Map (JSON)
{"version":3,"file":"appEvents.mjs","sources":["../../../src/services/appEvents.ts"],"sourcesContent":["import { BusEventBase, BusEventWithPayload, EventBus, GrafanaTheme2, PanelModel, TimeRange } from '@grafana/data';\n\n/**\n * Called when a dashboard is refreshed\n *\n * @public\n */\nexport class RefreshEvent extends BusEventBase {\n static type = 'refresh';\n}\n\n/**\n * Called when the theme settings change\n *\n * @public\n */\nexport class ThemeChangedEvent extends BusEventWithPayload<GrafanaTheme2> {\n static type = 'theme-changed';\n}\n\n/**\n * Called when time range is updated\n *\n * @public\n */\nexport class TimeRangeUpdatedEvent extends BusEventWithPayload<TimeRange> {\n static type = 'time-range-updated';\n}\n\n/**\n * Called to copy a panel JSON into local storage\n *\n * @public\n */\nexport class CopyPanelEvent extends BusEventWithPayload<PanelModel> {\n static type = 'copy-panel';\n}\n\n// Internal singleton instance\nlet singletonInstance: EventBus;\n\n/**\n * Used during startup by Grafana to set the setAppEvents so it is available\n * via the {@link setAppEvents} to the rest of the application.\n *\n * @internal\n */\nexport function setAppEvents(instance: EventBus) {\n singletonInstance = instance;\n}\n\n/**\n * Used to retrieve an event bus that manages application level events\n *\n * @public\n */\nexport function getAppEvents(): EventBus {\n return singletonInstance;\n}\n"],"names":[],"mappings":";;AAOO,MAAM,qBAAqB,YAAa,CAAA;AAE/C;AAFa,YAAA,CACJ,IAAO,GAAA,SAAA;AAQT,MAAM,0BAA0B,mBAAmC,CAAA;AAE1E;AAFa,iBAAA,CACJ,IAAO,GAAA,eAAA;AAQT,MAAM,8BAA8B,mBAA+B,CAAA;AAE1E;AAFa,qBAAA,CACJ,IAAO,GAAA,oBAAA;AAQT,MAAM,uBAAuB,mBAAgC,CAAA;AAEpE;AAFa,cAAA,CACJ,IAAO,GAAA,YAAA;AAIhB,IAAI,iBAAA;AAQG,SAAS,aAAa,QAAoB,EAAA;AAC/C,EAAoB,iBAAA,GAAA,QAAA;AACtB;AAOO,SAAS,YAAyB,GAAA;AACvC,EAAO,OAAA,iBAAA;AACT;;;;"}