All files / platform/app/src/types runtimeExtensions.d.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36                                                                       
// App-side type augmentation for the runtime extension loader
// (platform/app/src/runtimeExtensionLoader.ts). AppTypes.Config lives in
// platform/core/src/types/AppTypes.ts inside `declare global`; the settled
// decision is zero core changes, so the new config key is added here via
// TypeScript interface merging instead (this file is picked up through the
// root tsconfig.json include of 'platform/**/src/**/*').
//
// Known limitation: `extensions?: string[]` / `modes?: string[]` on
// AppTypes.Config CANNOT be widened from here (interface merging requires
// same-name members to be declared identically), so runtime extension
// descriptor entries remain untyped in AppTypes.Config. That widening to
// `(string | RuntimePluginDescriptor)[]` belongs to the separately-flagged
// optional core type fix and is deliberately NOT done in this workstream.
 
import type { RuntimePluginAuditRecord } from '../runtimeExtensionLoader';
 
declare global {
  namespace AppTypes {
    interface Config {
      /**
       * Extra origins allowed to serve runtime extensions/modes/styles.
       * Same-origin is always implicitly allowed; everything else is denied.
       */
      runtimePluginOrigins?: string[];
    }
  }
  interface Window {
    __ohif?: {
      runtimePlugins?: RuntimePluginAuditRecord[];
      runtimePluginOrigins?: string[];
    };
  }
}
 
export {};