Skip to content

Commit

Permalink
[ML] Renaming ML setup and start contracts (elastic#60980) (elastic#6…
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic authored Mar 24, 2020
1 parent f680edc commit e34cce5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/ml/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import { PluginInitializer } from 'kibana/public';
import './index.scss';
import { MlPlugin, Setup, Start } from './plugin';
import { MlPlugin, MlPluginSetup, MlPluginStart } from './plugin';

export const plugin: PluginInitializer<Setup, Start> = () => new MlPlugin();
export const plugin: PluginInitializer<MlPluginSetup, MlPluginStart> = () => new MlPlugin();

export { Setup, Start };
export { MlPluginSetup, MlPluginStart };
6 changes: 3 additions & 3 deletions x-pack/plugins/ml/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface MlSetupDependencies {
usageCollection: UsageCollectionSetup;
}

export class MlPlugin implements Plugin<Setup, Start> {
export class MlPlugin implements Plugin<MlPluginSetup, MlPluginStart> {
setup(core: CoreSetup<MlStartDependencies>, pluginsSetup: MlSetupDependencies) {
core.application.register({
id: PLUGIN_ID,
Expand Down Expand Up @@ -77,5 +77,5 @@ export class MlPlugin implements Plugin<Setup, Start> {
public stop() {}
}

export type Setup = ReturnType<MlPlugin['setup']>;
export type Start = ReturnType<MlPlugin['start']>;
export type MlPluginSetup = ReturnType<MlPlugin['setup']>;
export type MlPluginStart = ReturnType<MlPlugin['start']>;
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

import { PluginInitializerContext } from 'kibana/server';
import { MlServerPlugin } from './plugin';
export { MlStartContract, MlSetupContract } from './plugin';
export { MlPluginSetup, MlPluginStart } from './plugin';

export const plugin = (ctx: PluginInitializerContext) => new MlServerPlugin(ctx);
10 changes: 5 additions & 5 deletions x-pack/plugins/ml/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ declare module 'kibana/server' {
}
}

export type MlSetupContract = SharedServices;
export type MlStartContract = void;
export type MlPluginSetup = SharedServices;
export type MlPluginStart = void;

export class MlServerPlugin implements Plugin<MlSetupContract, MlStartContract, PluginsSetup> {
export class MlServerPlugin implements Plugin<MlPluginSetup, MlPluginStart, PluginsSetup> {
private log: Logger;
private version: string;
private mlLicense: MlServerLicense;
Expand All @@ -63,7 +63,7 @@ export class MlServerPlugin implements Plugin<MlSetupContract, MlStartContract,
this.mlLicense = new MlServerLicense();
}

public setup(coreSetup: CoreSetup, plugins: PluginsSetup): MlSetupContract {
public setup(coreSetup: CoreSetup, plugins: PluginsSetup): MlPluginSetup {
plugins.features.registerFeature({
id: PLUGIN_ID,
name: i18n.translate('xpack.ml.featureRegistry.mlFeatureName', {
Expand Down Expand Up @@ -138,7 +138,7 @@ export class MlServerPlugin implements Plugin<MlSetupContract, MlStartContract,
return createSharedServices(this.mlLicense, plugins.spaces, plugins.cloud);
}

public start(): MlStartContract {}
public start(): MlPluginStart {}

public stop() {
this.mlLicense.unsubscribe();
Expand Down

0 comments on commit e34cce5

Please sign in to comment.