import { from } from 'rxjs' ; import { CoreStart , KibanaRequest } from 'src/core/server' ; import { GlobalSearchProviderContext } from '../types' ; export type GlobalSearchContextFactory = ( request : KibanaRequest ) => GlobalSearchProviderContext ; /**
 *  GlobalSearchProviderContext factory
  export const getContextFactory = ( coreStart ) => ( request ) : GlobalSearchProviderContext => { const soClient = coreStart . savedObjects . getScopedClient ( request ) ; return { core : { savedObjects : { client : soClient , typeRegistry : coreStart . savedObjects . getTypeRegistry ( ) , } , uiSettings : { client : coreStart . uiSettings . asScopedToClient ( soClient ) , } , capabilities : from ( coreStart . capabilities . resolveCapabilities ( request ) ) , } , } ; } ;