import { PluginInitializerContext , CoreSetup , CoreStart , Plugin , Logger , } from '../../../core/server' ; import { createDashboardSavedObjectType } from './saved_objects' ; import { capabilitiesProvider } from './capabilities_provider' ; import { DashboardPluginSetup , DashboardPluginStart } from './types' ; import { EmbeddableSetup } from '../../embeddable/server' ; import { UsageCollectionSetup } from '../../usage_collection/server' ; import { registerDashboardUsageCollector } from './usage/register_collector' ; import { dashboardPersistableStateServiceFactory } from './embeddable/dashboard_container_embeddable_factory' ; import { getUISettings } from './ui_settings' ; interface SetupDeps { embeddable : EmbeddableSetup ; usageCollection : UsageCollectionSetup ; } export class DashboardPlugin implements Plugin < DashboardPluginSetup , DashboardPluginStart , SetupDeps > { private readonly logger : Logger ; constructor ( initializerContext ) { this . logger = initializerContext . logger . get ( ) ; } public setup ( core , plugins ) { this . logger . debug ( 'dashboard: Setup' ) ; core . savedObjects . registerType ( createDashboardSavedObjectType ( { migrationDeps : { embeddable : plugins . embeddable , } , } ) ) ; core . capabilities . registerProvider ( capabilitiesProvider ) ; registerDashboardUsageCollector ( plugins . usageCollection , plugins . embeddable ) ; plugins . embeddable . registerEmbeddableFactory ( dashboardPersistableStateServiceFactory ( plugins . embeddable ) ) ; core . uiSettings . register ( getUISettings ( ) ) ; return { } ; } public start ( core ) { this . logger . debug ( 'dashboard: Started' ) ; return { } ; } public stop ( ) { } }