import { PluginInitializerContext , CoreSetup , CoreStart , Plugin } from 'kibana/public' ; import { LegacyDependenciesPlugin } from './shim' ; import { Plugin as DataPublicPlugin } from '../../../src/plugins/data/public' ; import { VisualizationsSetup } from 'plugins/visualizations' ; import { createMetricVisFn } from './metric_vis_fn' ; import { createMetricVisTypeDefinition } from './metric_vis_type' ; internal export interface MetricVisPluginSetupDependencies { data : ReturnType < DataPublicPlugin [ 'setup' ] > ; visualizations : VisualizationsSetup ; __LEGACY : LegacyDependenciesPlugin ; } internal export class MetricVisPlugin implements Plugin < void , void > { initializerContext : PluginInitializerContext ; constructor ( initializerContext ) { this . initializerContext = initializerContext ; } public setup ( core , { data , visualizations , __LEGACY } ) { __LEGACY . setup ( ) ; data . expressions . registerFunction ( createMetricVisFn ) ; visualizations . types . VisTypesRegistryProvider . register ( createMetricVisTypeDefinition ) ; } public start ( core ) { } }