import { CoreSetup , Plugin } from 'src/core/public' ; import type { TelemetryPluginSetup } from '../../../../../src/plugins/telemetry/public' ; interface TelemetryTestPluginSetupDependencies { telemetry : TelemetryPluginSetup ; } export class TelemetryTestPlugin implements Plugin { setup ( core , { telemetry } ) { window . _checkCanSendTelemetry = async ( ) => { await telemetry . telemetryService . setOptIn ( true ) ; return telemetry . telemetryService . canSendTelemetry ( ) ; } ; window . _resetTelemetry = async ( ) => { await telemetry . telemetryService . setOptIn ( false ) ; } ; } start ( ) { } }