mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
parent
f680edc443
commit
e34cce58dd
4 changed files with 12 additions and 12 deletions
|
@ -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 };
|
||||
|
|
|
@ -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,
|
||||
|
@ -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']>;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
@ -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', {
|
||||
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue