import { DataHandler , ObservabilityFetchDataPlugins } from './typings/fetch_overview_data' ; const dataHandlers = { } ; export function registerDataHandler < T extends ObservabilityFetchDataPlugins > ( { appName , fetchData , hasData , } ) { dataHandlers [ appName ] = { fetchData , hasData } ; } export function unregisterDataHandler < T extends ObservabilityFetchDataPlugins > ( { appName , } ) { delete dataHandlers [ appName ] ; } export function getDataHandler < T extends ObservabilityFetchDataPlugins > ( appName ) { const dataHandler = dataHandlers [ appName ] ; if ( dataHandler ) { return dataHandler as DataHandler < T > ; } }