@@ -18,7 +18,7 @@ import { take } from 'rxjs/operators';
1818
1919import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public' ;
2020import type { ManagementSetup } from '@kbn/management-plugin/public' ;
21- import type { SharePluginSetup , SharePluginStart } from '@kbn/share-plugin/public' ;
21+ import type { LocatorPublic , SharePluginSetup , SharePluginStart } from '@kbn/share-plugin/public' ;
2222import type { DataPublicPluginStart } from '@kbn/data-plugin/public' ;
2323import type { HomePublicPluginSetup } from '@kbn/home-plugin/public' ;
2424import type { EmbeddableSetup , EmbeddableStart } from '@kbn/embeddable-plugin/public' ;
@@ -54,7 +54,7 @@ import {
5454 MlSharedServices ,
5555} from './application/services/get_shared_ml_services' ;
5656import { registerManagementSection } from './application/management' ;
57- import { MlLocatorDefinition , type MlLocator } from './locator' ;
57+ import { MlLocatorDefinition , MlLocatorParams , type MlLocator } from './locator' ;
5858import { setDependencyCache } from './application/util/dependency_cache' ;
5959import { registerHomeFeature } from './register_home_feature' ;
6060import { isFullLicense , isMlEnabled } from '../common/license' ;
@@ -67,6 +67,7 @@ import {
6767 type ConfigSchema ,
6868} from '../common/constants/app' ;
6969import type { MlCapabilities } from './shared' ;
70+ import { ElasticModels } from './application/services/elastic_models_service' ;
7071
7172export interface MlStartDependencies {
7273 dataViewEditor : DataViewEditorStart ;
@@ -131,7 +132,10 @@ export class MlPlugin implements Plugin<MlPluginSetup, MlPluginStart> {
131132 initEnabledFeatures ( this . enabledFeatures , initializerContext . config . get ( ) ) ;
132133 }
133134
134- setup ( core : MlCoreSetup , pluginsSetup : MlSetupDependencies ) {
135+ setup (
136+ core : MlCoreSetup ,
137+ pluginsSetup : MlSetupDependencies
138+ ) : { locator ?: LocatorPublic < MlLocatorParams > ; elasticModels ?: ElasticModels } {
135139 this . sharedMlServices = getMlSharedServices ( core . http ) ;
136140
137141 core . application . register ( {
@@ -262,10 +266,14 @@ export class MlPlugin implements Plugin<MlPluginSetup, MlPluginStart> {
262266
263267 return {
264268 locator : this . locator ,
269+ elasticModels : this . sharedMlServices . elasticModels ,
265270 } ;
266271 }
267272
268- start ( core : CoreStart , deps : MlStartDependencies ) {
273+ start (
274+ core : CoreStart ,
275+ deps : MlStartDependencies
276+ ) : { locator ?: LocatorPublic < MlLocatorParams > ; elasticModels ?: ElasticModels } {
269277 setDependencyCache ( {
270278 docLinks : core . docLinks ! ,
271279 basePath : core . http . basePath ,
0 commit comments