import { Plugin , CoreSetup } from 'opensearch-dashboards/public' ; import { ThemeService , ColorsService } from './services' ; export type Theme = Omit < ThemeService , 'init' > ; export type Color = Omit < ColorsService , 'init' > ; public export interface ChartsPluginSetup { colors : Color ; theme : Theme ; } public export type ChartsPluginStart = ChartsPluginSetup ; public export class ChartsPlugin implements Plugin < ChartsPluginSetup , ChartsPluginStart > { private readonly themeService = new ThemeService ( ) ; private readonly colorsService = new ColorsService ( ) ; public setup ( { uiSettings } ) { this . themeService . init ( uiSettings ) ; this . colorsService . init ( uiSettings ) ; return { colors : this . colorsService , theme : this . themeService , } ; } public start ( ) { return { colors : this . colorsService , theme : this . themeService , } ; } }