feat(types): typed app config (#4171)

This commit is contained in:
Ibrahim authored and GitHub committed 2024-05-24 12:21:09 -04:00
1 parent 8c5b228d27
commit 8960b89911
22 files changed
+78 -26

No files matched your search

+2
View File
@@ -1,3 +1,5 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
extensions: [],
+2 -1
View File
@@ -1,4 +1,5 @@
/** @type {import('@ohif/core').OHIFConfig} */
/** @type {AppTypes.Config} */
const config = {
routerBasename: '/',
// whiteLabeling: {},
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
// whiteLabeling: {},
+1
View File
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
modes: [],
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
extensions: [],
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
extensions: [],
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
showStudyList: true,
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
showStudyList: true,
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
showStudyList: true,
+1
View File
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
extensions: [],
+1
View File
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
customizationService: {
+1
View File
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
enableGoogleCloudAdapter: true,
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
customizationService: {
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
extensions: [],
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
customizationService: ['@ohif/extension-default.customizationModule.helloPage'],
+1
View File
@@ -1,3 +1,4 @@
/** @type {AppTypes.Config} */
window.config = {
// Activate the new HP mode....
isNewHP: true,
+2
View File
@@ -1,3 +1,5 @@
/** @type {AppTypes.Config} */
window.config = {
routerBasename: '/',
extensions: [],
@@ -1,6 +1,5 @@
import MODULE_TYPES from './MODULE_TYPES';
import log from '../log';
import { AppConfig } from '../types/AppConfig';
import { PubSubService, ServiceProvidersManager } from '../services';
import { HotkeysManager, CommandsManager } from '../classes';
import { DataSourceDefinition } from '../types';
@@ -13,7 +12,7 @@ export interface ExtensionConstructor {
serviceProvidersManager: ServiceProvidersManager;
commandsManager: CommandsManager;
hotkeysManager: HotkeysManager;
appConfig: AppConfig;
appConfig: AppTypes.Config;
}
/**
-21
View File
@@ -1,21 +0,0 @@
import Hotkey from '../classes/Hotkey';
export interface AppConfig {
extensions?: string[];
defaultDataSourceName?: string;
hotkeys?: Record<string, Hotkey> | Hotkey[];
useSharedArrayBuffer?: string;
preferSizeOverAccuracy?: boolean;
useNorm16Texture?: boolean;
useCPURendering?: boolean;
strictZSpacingForVolumeViewport?: boolean;
useCursors?: boolean;
maxCacheSize?: number;
showWarningMessageForCrossOrigin?: boolean;
showCPUFallbackMessage?: boolean;
maxNumRequests?: {
interaction?: number;
prefetch?: number;
thumbnail?: number;
};
}
+56
View File
@@ -19,6 +19,8 @@ import ServicesManagerType from '../services/ServicesManager';
import CommandsManagerType from '../classes/CommandsManager';
import ExtensionManagerType from '../extensions/ExtensionManager';
import Hotkey from '../classes/Hotkey';
declare global {
namespace AppTypes {
export type ServicesManager = ServicesManagerType;
@@ -63,6 +65,60 @@ declare global {
uiViewportDialogService?: UIViewportDialogServiceType;
panelService?: PanelServiceType;
}
export interface Config {
routerBasename?: string;
customizationService?: any;
extensions?: string[];
modes?: string[];
defaultDataSourceName?: string;
hotkeys?: Record<string, Hotkey> | Hotkey[];
useSharedArrayBuffer?: 'AUTO' | 'FALSE' | 'TRUE';
preferSizeOverAccuracy?: boolean;
useNorm16Texture?: boolean;
useCPURendering?: boolean;
strictZSpacingForVolumeViewport?: boolean;
useCursors?: boolean;
maxCacheSize?: number;
max3DTextureSize?: number;
showWarningMessageForCrossOrigin?: boolean;
showCPUFallbackMessage?: boolean;
maxNumRequests?: {
interaction?: number;
prefetch?: number;
thumbnail?: number;
};
disableEditing?: boolean;
maxNumberOfWebWorkers?: number;
acceptHeader?: string[];
investigationalUseDialog?: {
option: 'always' | 'never' | 'configure';
days?: number;
};
groupEnabledModesFirst?: boolean;
disableConfirmationPrompts?: boolean;
showPatientInfo?: 'visible' | 'visibleCollapsed' | 'disabled' | 'visibleReadOnly';
requestTransferSyntaxUID?: string;
omitQuotationForMultipartRequest?: boolean;
modesConfiguration?: {
[key: string]: object;
};
showLoadingIndicator?: boolean;
supportsWildcard?: boolean;
allowMultiSelectExport?: boolean;
activateViewportBeforeInteraction?: boolean;
autoPlayCine?: boolean;
showStudyList?: boolean;
whiteLabeling?: any;
httpErrorHandler?: any;
addWindowLevelActionMenu?: boolean;
dangerouslyUseDynamicConfig?: {
enabled: boolean;
regex: RegExp;
};
onConfiguration?: (dicomWebConfig: any, options: any) => any;
dataSources?: any;
oidc?: any;
}
}
export type withAppTypes<T = object> = T &
-1
View File
@@ -11,7 +11,6 @@ import type { PresentationIds } from '../services/ViewportGridService';
export type * from '../services/CustomizationService/types';
// Separate out some generic types
export type * from './AppConfig';
export type * from './Consumer';
export type * from './Command';
export type * from './DisplaySet';