import type { StartServicesAccessor } from 'src/core/public' ; import type { ManagementApp , ManagementSetup } from 'src/plugins/management/public' ; import type { PluginsStart } from '../plugin' ; import type { SpacesManager } from '../spaces_manager' ; import { spacesManagementApp } from './spaces_management_app' ; interface SetupDeps { management : ManagementSetup ; getStartServices : StartServicesAccessor < PluginsStart > ; spacesManager : SpacesManager ; } export class ManagementService { private registeredSpacesManagementApp ? : ManagementApp ; public setup ( { getStartServices , management , spacesManager } ) { this . registeredSpacesManagementApp = management . sections . section . kibana . registerApp ( spacesManagementApp . create ( { getStartServices , spacesManager } ) ) ; } public stop ( ) { this . disableSpacesApp ( ) ; } private disableSpacesApp ( ) { if ( this . registeredSpacesManagementApp ) { this . registeredSpacesManagementApp . disable ( ) ; } } }