From 7060843014bab692e30ad52ebde0fd6b2ac5a494 Mon Sep 17 00:00:00 2001 From: Vlad Babich Date: Thu, 15 Aug 2024 12:51:55 -0600 Subject: [PATCH] Change TabEvent to object literal, add TabEventMap --- .../src/events/TabEvent.ts | 17 ++++------------- .../src/events/TabEventMap.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 packages/dashboard-core-plugins/src/events/TabEventMap.ts diff --git a/packages/dashboard-core-plugins/src/events/TabEvent.ts b/packages/dashboard-core-plugins/src/events/TabEvent.ts index 6e5e13b71..d67c3f552 100644 --- a/packages/dashboard-core-plugins/src/events/TabEvent.ts +++ b/packages/dashboard-core-plugins/src/events/TabEvent.ts @@ -1,15 +1,6 @@ -class TabEvent { - static focus = 'TabEvent.focus'; - - static blur = 'TabEvent.blur'; - - static openPQObject = 'TabEvent.openPQObject'; - - static openControl = 'TabEvent.openControl'; - - static reload = 'TabEvent.reload'; - - static clearAllFilters = 'TabEvent.clearAllFilters'; -} +const TabEvent = { + focus: 'TabEvent.focus', + blur: 'TabEvent.blur', +} as const; export default TabEvent; diff --git a/packages/dashboard-core-plugins/src/events/TabEventMap.ts b/packages/dashboard-core-plugins/src/events/TabEventMap.ts new file mode 100644 index 000000000..ce371f55b --- /dev/null +++ b/packages/dashboard-core-plugins/src/events/TabEventMap.ts @@ -0,0 +1,12 @@ +import { ValueOf } from '@deephaven/utils'; +import TabEvent from './TabEvent'; + +export type TabEventType = ValueOf; + +export interface TabEventMap + extends Record void> { + [TabEvent.focus]: () => void; + [TabEvent.blur]: () => void; +} + +export default TabEventMap;