fix: Create typed services and allow lower case access to agree with naming conventions (#3141)

* fix: Add typed services

* fix: Typed services - PR changes

* remaining of the cineService and toolbarService renaming

---------

Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
Bill WallaceandAlireza authored and GitHub committed 2023-02-07 14:31:55 -05:00
1 parent 0e1a58da79
commit 7f799b8e3d
55 files changed
+302 -233

No files matched your search

@@ -1,17 +1,25 @@
import merge from 'lodash.merge';
import pubSubServiceInterface from '../_shared/pubSubServiceInterface';
import { PubSubService } from '../_shared/pubSubServiceInterface';
const EVENTS = {
TOOL_BAR_MODIFIED: 'event::toolBarService:toolBarModified',
TOOL_BAR_STATE_MODIFIED: 'event::toolBarService:toolBarStateModified',
};
export default class ToolBarService {
export default class ToolbarService extends PubSubService {
public static REGISTRATION = {
name: 'toolbarService',
// Note the old name is ToolBarService, with an upper B
altName: 'ToolBarService',
create: ({ commandsManager }) => {
return new ToolbarService(commandsManager);
},
};
constructor(commandsManager) {
super(EVENTS);
this._commandsManager = commandsManager;
//
this.EVENTS = EVENTS;
this.listeners = {};
this.buttons = {};
this.unsubscriptions = []; // if tools need to unsubscribe from events
this.buttonSections = {
@@ -32,8 +40,6 @@ export default class ToolBarService {
/* track most recent click per group...? */
},
};
Object.assign(this, pubSubServiceInterface);
}
init(extensionManager) {
@@ -1,8 +1,3 @@
import ToolBarService from './ToolBarService';
import ToolbarService from './ToolbarService';
export default {
name: 'ToolBarService',
create: ({ configuration = {}, commandsManager }) => {
return new ToolBarService(commandsManager);
},
};
export default ToolbarService;