feat(types): typed app config (#4171)
This commit is contained in:
parent
8c5b228d27
commit
8960b89911
@ -1,3 +1,5 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
|
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
extensions: [],
|
extensions: [],
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
/** @type {import('@ohif/core').OHIFConfig} */
|
/** @type {AppTypes.Config} */
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
// whiteLabeling: {},
|
// whiteLabeling: {},
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
// whiteLabeling: {},
|
// whiteLabeling: {},
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
modes: [],
|
modes: [],
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
extensions: [],
|
extensions: [],
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
extensions: [],
|
extensions: [],
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
showStudyList: true,
|
showStudyList: true,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
showStudyList: true,
|
showStudyList: true,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
showStudyList: true,
|
showStudyList: true,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
extensions: [],
|
extensions: [],
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
customizationService: {
|
customizationService: {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
enableGoogleCloudAdapter: true,
|
enableGoogleCloudAdapter: true,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
customizationService: {
|
customizationService: {
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
extensions: [],
|
extensions: [],
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
customizationService: ['@ohif/extension-default.customizationModule.helloPage'],
|
customizationService: ['@ohif/extension-default.customizationModule.helloPage'],
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
window.config = {
|
window.config = {
|
||||||
// Activate the new HP mode....
|
// Activate the new HP mode....
|
||||||
isNewHP: true,
|
isNewHP: true,
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/** @type {AppTypes.Config} */
|
||||||
|
|
||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
extensions: [],
|
extensions: [],
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import MODULE_TYPES from './MODULE_TYPES';
|
import MODULE_TYPES from './MODULE_TYPES';
|
||||||
import log from '../log';
|
import log from '../log';
|
||||||
import { AppConfig } from '../types/AppConfig';
|
|
||||||
import { PubSubService, ServiceProvidersManager } from '../services';
|
import { PubSubService, ServiceProvidersManager } from '../services';
|
||||||
import { HotkeysManager, CommandsManager } from '../classes';
|
import { HotkeysManager, CommandsManager } from '../classes';
|
||||||
import { DataSourceDefinition } from '../types';
|
import { DataSourceDefinition } from '../types';
|
||||||
@ -13,7 +12,7 @@ export interface ExtensionConstructor {
|
|||||||
serviceProvidersManager: ServiceProvidersManager;
|
serviceProvidersManager: ServiceProvidersManager;
|
||||||
commandsManager: CommandsManager;
|
commandsManager: CommandsManager;
|
||||||
hotkeysManager: HotkeysManager;
|
hotkeysManager: HotkeysManager;
|
||||||
appConfig: AppConfig;
|
appConfig: AppTypes.Config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -19,6 +19,8 @@ import ServicesManagerType from '../services/ServicesManager';
|
|||||||
import CommandsManagerType from '../classes/CommandsManager';
|
import CommandsManagerType from '../classes/CommandsManager';
|
||||||
import ExtensionManagerType from '../extensions/ExtensionManager';
|
import ExtensionManagerType from '../extensions/ExtensionManager';
|
||||||
|
|
||||||
|
import Hotkey from '../classes/Hotkey';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace AppTypes {
|
namespace AppTypes {
|
||||||
export type ServicesManager = ServicesManagerType;
|
export type ServicesManager = ServicesManagerType;
|
||||||
@ -63,6 +65,60 @@ declare global {
|
|||||||
uiViewportDialogService?: UIViewportDialogServiceType;
|
uiViewportDialogService?: UIViewportDialogServiceType;
|
||||||
panelService?: PanelServiceType;
|
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 &
|
export type withAppTypes<T = object> = T &
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import type { PresentationIds } from '../services/ViewportGridService';
|
|||||||
|
|
||||||
export type * from '../services/CustomizationService/types';
|
export type * from '../services/CustomizationService/types';
|
||||||
// Separate out some generic types
|
// Separate out some generic types
|
||||||
export type * from './AppConfig';
|
|
||||||
export type * from './Consumer';
|
export type * from './Consumer';
|
||||||
export type * from './Command';
|
export type * from './Command';
|
||||||
export type * from './DisplaySet';
|
export type * from './DisplaySet';
|
||||||
|
|||||||
@ -19,6 +19,6 @@
|
|||||||
"@ohif/app": ["platform/app/src"]
|
"@ohif/app": ["platform/app/src"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["platform/**/src/**/*", "extensions/**/src/**/*", "modes/**/src/**/*"],
|
"include": ["platform/**/src/**/*", "platform/**/public/**/*", "extensions/**/src/**/*", "modes/**/src/**/*"],
|
||||||
"exclude": ["node_modules", "dist"]
|
"exclude": ["node_modules", "dist"]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user