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,7 +1,7 @@
import MeasurementService from './MeasurementService.js';
import MeasurementService from './MeasurementService';
import log from '../../log';
jest.mock('../../log.js', () => ({
jest.mock('../../log', () => ({
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
@@ -1,6 +1,6 @@
import log from '../../log';
import guid from '../../utils/guid';
import pubSubServiceInterface from '../_shared/pubSubServiceInterface';
import { PubSubService } from '../_shared/pubSubServiceInterface';
/**
* Measurement source schema
@@ -94,27 +94,27 @@ const VALUE_TYPES = {
* Note and Todo: We should be able to support measurements that are composed of multiple
* annotations, but that is not the case at the moment.
*/
class MeasurementService {
class MeasurementService extends PubSubService {
public static REGISTRATION = {
name: 'measurementService',
altName: 'MeasurementService',
create: ({ configuration = {} }) => {
return new MeasurementService();
},
};
constructor() {
super(EVENTS);
this.sources = {};
this.mappings = {};
this.measurements = {};
this.listeners = {};
this._jumpToMeasurementCache = {};
Object.defineProperty(this, 'EVENTS', {
value: EVENTS,
writable: false,
enumerable: true,
configurable: false,
});
Object.defineProperty(this, 'VALUE_TYPES', {
value: VALUE_TYPES,
writable: false,
enumerable: true,
configurable: false,
});
Object.assign(this, pubSubServiceInterface);
}
/**
@@ -1,8 +0,0 @@
import MeasurementService from './MeasurementService';
export default {
name: 'MeasurementService',
create: ({ configuration = {} }) => {
return new MeasurementService();
},
};
@@ -0,0 +1,3 @@
import MeasurementService from './MeasurementService';
export default MeasurementService;