import { IFileOpenerService } from './service.file.opener' ; import { IMergeFilesService } from './service.file.merge' ; import { IConcatFilesService } from './service.file.concat' ; export { IFileOpenerService } ; export interface IServicesHolder { FileOpenerService : IFileOpenerService | undefined ; MergeFilesService : IMergeFilesService | undefined ; ConcatFilesService : IConcatFilesService | undefined ; } export interface IServices { FileOpenerService : IFileOpenerService ; MergeFilesService : IMergeFilesService ; ConcatFilesService : IConcatFilesService ; } let shared = { FileOpenerService : undefined , MergeFilesService : undefined , ConcatFilesService : undefined , } ; export function setSharedServices ( services ) { shared = services as IServicesHolder ; } export function getSharedServices ( ) { if ( shared . ConcatFilesService === undefined || shared . MergeFilesService === undefined || shared . FileOpenerService === undefined ) { throw new Error ( `Shared services {IServices} aren't available. ` ) ; } return shared as IServices ; }