Skip to content

Commit

Permalink
Change TabEvent to object literal, add TabEventMap
Browse files Browse the repository at this point in the history
  • Loading branch information
vbabich committed Aug 15, 2024
1 parent a257296 commit 7060843
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
17 changes: 4 additions & 13 deletions packages/dashboard-core-plugins/src/events/TabEvent.ts
Original file line number Diff line number Diff line change
@@ -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;
12 changes: 12 additions & 0 deletions packages/dashboard-core-plugins/src/events/TabEventMap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ValueOf } from '@deephaven/utils';
import TabEvent from './TabEvent';

export type TabEventType = ValueOf<typeof TabEvent>;

export interface TabEventMap
extends Record<TabEventType, (...args: never[]) => void> {
[TabEvent.focus]: () => void;
[TabEvent.blur]: () => void;
}

export default TabEventMap;

0 comments on commit 7060843

Please sign in to comment.