import type { StartServicesAccessor } from 'src/core/public' ; import { createRedirectLegacyUrl } from '../legacy_urls' ; import type { PluginsStart } from '../plugin' ; import { useSpaces } from '../spaces_context' ; import type { SpacesManager } from '../spaces_manager' ; import { getComponents } from './components' ; import type { LazyComponentFn , SpacesApiUi , SpacesApiUiComponent } from './types' ; interface GetUiApiOptions { spacesManager : SpacesManager ; getStartServices : StartServicesAccessor < PluginsStart > ; } export type { LazyComponentFn , SpacesApiUi , SpacesApiUiComponent } ; export const getUiApi = ( { spacesManager , getStartServices } ) : SpacesApiUi => { const components = getComponents ( { spacesManager , getStartServices } ) ; return { components , redirectLegacyUrl : createRedirectLegacyUrl ( getStartServices ) , useSpaces , } ; } ;