fix: Service consistency typing (#3309)

* Use more consistent type/structure for services

* Fix restoring SR so the tests described work

* One more typed service

* Added types for the Cornerstone library

* Couple more type fixes
This commit is contained in:
Bill Wallace authored and GitHub committed 2023-04-18 11:17:50 -04:00
1 parent 47c25f4364
commit 6cf271d006
24 files changed
+309 -299

No files matched your search

@@ -1,4 +1,4 @@
import { ServicesManager } from '@ohif/core';
import { ServicesManager, Types } from '@ohif/core';
import { cache as cs3DCache, Enums, volumeLoader } from '@cornerstonejs/core';
import getCornerstoneViewportType from '../../utils/getCornerstoneViewportType';
@@ -10,20 +10,21 @@ import {
const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
class CornerstoneCacheService {
static REGISTRATION = (serviceManager: ServicesManager) => {
return {
name: 'cornerstoneCacheService',
altName: 'CornerstoneCacheService',
create: ({ configuration = {} }) => {
return new CornerstoneCacheService(serviceManager);
},
};
static REGISTRATION = {
name: 'cornerstoneCacheService',
altName: 'CornerstoneCacheService',
create: ({
servicesManager,
}: Types.Extensions.ExtensionParams): CornerstoneCacheService => {
return new CornerstoneCacheService(servicesManager);
},
};
stackImageIds: Map<string, string[]> = new Map();
volumeImageIds: Map<string, string[]> = new Map();
readonly servicesManager: ServicesManager;
constructor(servicesManager) {
constructor(servicesManager: ServicesManager) {
this.servicesManager = servicesManager;
}