import { PluginInitializerContext , CoreSetup , CoreStart , Plugin } from 'src/core/public' ; import { NavigationPublicPluginSetup , NavigationPublicPluginStart , NavigationPluginStartDependencies , } from './types' ; import { TopNavMenuExtensionsRegistry , createTopNav } from './top_nav_menu' ; export class NavigationPublicPlugin implements Plugin < NavigationPublicPluginSetup , NavigationPublicPluginStart > { private readonly topNavMenuExtensionsRegistry : TopNavMenuExtensionsRegistry = new TopNavMenuExtensionsRegistry ( ) ; constructor ( initializerContext ) { } public setup ( core ) { return { registerMenuItem : this . topNavMenuExtensionsRegistry . register . bind ( this . topNavMenuExtensionsRegistry ) , } ; } public start ( { i18n } , { data } ) { const extensions = this . topNavMenuExtensionsRegistry . getAll ( ) ; return { ui : { TopNavMenu : createTopNav ( data , extensions , i18n ) , } , } ; } public stop ( ) { } }