feat(types): typed app config (#4171)
This commit is contained in:
parent
8c5b228d27
commit
8960b89911
@ -1,3 +1,5 @@
|
||||
/** @type {AppTypes.Config} */
|
||||
|
||||
window.config = {
|
||||
routerBasename: '/',
|
||||
extensions: [],
|
||||
|
||||
@ -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,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,3 +1,4 @@
|
||||
/** @type {AppTypes.Config} */
|
||||
window.config = {
|
||||
routerBasename: '/',
|
||||
extensions: [],
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** @type {AppTypes.Config} */
|
||||
window.config = {
|
||||
routerBasename: '/',
|
||||
customizationService: {
|
||||
|
||||
@ -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,3 +1,4 @@
|
||||
/** @type {AppTypes.Config} */
|
||||
window.config = {
|
||||
// Activate the new HP mode....
|
||||
isNewHP: true,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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 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 &
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -19,6 +19,6 @@
|
||||
"@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"]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user