import { ChartsPluginSetup } from '../../../charts/public' ; import { CoreSetup , CoreStart } from '../../../../core/public' ; import { Plugin as ExpressionsPublicPlugin } from '../../../expressions/public' ; import { heatmapFunction , heatmapLegendConfig , heatmapGridConfig } from '../common' ; import { setFormatService , setPaletteService , setUISettings , setThemeService } from './services' ; import { heatmapRenderer } from './expression_renderers' ; import type { FieldFormatsStart } from '../../../field_formats/public' ; internal export interface ExpressionHeatmapPluginSetup { expressions : ReturnType < ExpressionsPublicPlugin [ 'setup' ] > ; charts : ChartsPluginSetup ; } internal export interface ExpressionHeatmapPluginStart { fieldFormats : FieldFormatsStart ; } internal export class ExpressionHeatmapPlugin { public setup ( core , { expressions , charts } ) { charts . palettes . getPalettes ( ) . then ( ( palettes ) => { setPaletteService ( palettes ) ; } ) ; setUISettings ( core . uiSettings ) ; setThemeService ( charts . theme ) ; expressions . registerFunction ( heatmapFunction ) ; expressions . registerFunction ( heatmapLegendConfig ) ; expressions . registerFunction ( heatmapGridConfig ) ; expressions . registerRenderer ( heatmapRenderer ( { theme : core . theme } ) ) ; } public start ( core , { fieldFormats } ) { setFormatService ( fieldFormats ) ; } }