import type { MapConfig } from '../config' ; import { LicensingPluginStart } from '../../../../x-pack/plugins/licensing/public' ; import { ILicense } from '../../../../x-pack/plugins/licensing/common/types' ; import { LICENSE_CHECK_ID } from '../common' ; let kibanaVersion ; export const setKibanaVersion = ( version ) => ( kibanaVersion = version ) ; export const getKibanaVersion = ( ) : string => kibanaVersion ; let mapsEmsConfig ; export const setMapConfig = ( mapsEms ) => { mapsEmsConfig = mapsEms ; } ; export const getMapConfig = ( ) => mapsEmsConfig ; let isEnterprisePlus = false ; function updateLicenseState ( license ) { const enterprise = license . check ( LICENSE_CHECK_ID , 'enterprise' ) ; isEnterprisePlus = enterprise . state === 'valid' ; } export function getIsEnterprisePlus ( ) { return isEnterprisePlus ; } export async function setLicensingPluginStart ( licensingPlugin ) { const license = await licensingPlugin . refresh ( ) ; updateLicenseState ( license ) ; licensingPlugin . license$ . subscribe ( updateLicenseState ) ; }