import { CoreSetup , CoreStart , Plugin , ThemeServiceStart } from '../../../../core/public' ; import { ExpressionsStart , ExpressionsSetup } from '../../../expressions/public' ; import { ChartsPluginSetup } from '../../../charts/public' ; import { tagcloudRenderer } from './expression_renderers' ; import { tagcloudFunction } from '../common/expression_functions' ; import { FieldFormatsStart } from '../../../field_formats/public' ; import { setFormatService } from './format_service' ; interface SetupDeps { expressions : ExpressionsSetup ; charts : ChartsPluginSetup ; } internal export interface ExpressioTagcloudRendererDependencies { palettes : ChartsPluginSetup [ 'palettes' ] ; theme : ThemeServiceStart ; } interface StartDeps { expression : ExpressionsStart ; fieldFormats : FieldFormatsStart ; } export type ExpressionTagcloudPluginSetup = void ; export type ExpressionTagcloudPluginStart = void ; export class ExpressionTagcloudPlugin implements Plugin < ExpressionTagcloudPluginSetup , ExpressionTagcloudPluginStart , SetupDeps , StartDeps > { public setup ( core , { expressions , charts } ) { const rendererDependencies = { palettes : charts . palettes , theme : core . theme , } ; expressions . registerFunction ( tagcloudFunction ) ; expressions . registerRenderer ( tagcloudRenderer ( rendererDependencies ) ) ; } public start ( core , { fieldFormats } ) { setFormatService ( fieldFormats ) ; } public stop ( ) { } }