import { schema , TypeOf } from '@osd/config-schema' ; import { PluginConfigDescriptor } from 'opensearch-dashboards/server' ; import { DEFAULT_MAXIMUM_WAIT_TIME_FOR_ALL_COLLECTORS_IN_S } from '../common/constants' ; export const configSchema = schema . object ( { uiMetric : schema . object ( { enabled : schema . boolean ( { defaultValue : true } ) , debug : schema . boolean ( { defaultValue : schema . contextRef ( 'dev' ) } ) , } ) , maximumWaitTimeForAllCollectorsInS : schema . number ( { defaultValue : DEFAULT_MAXIMUM_WAIT_TIME_FOR_ALL_COLLECTORS_IN_S , } ) , } ) ; export type ConfigType = TypeOf < typeof configSchema > ; export const config = { schema : configSchema , deprecations : ( { renameFromRoot } ) => [ renameFromRoot ( 'ui_metric.enabled' , 'usageCollection.uiMetric.enabled' ) , renameFromRoot ( 'ui_metric.debug' , 'usageCollection.uiMetric.debug' ) , ] , exposeToBrowser : { uiMetric : true , } , } ;