import { CombinedJob } from '../../../../common/types/anomaly_detection_jobs' ; import { isTimeSeriesViewDetector } from '../../../../common/util/job_utils' ; interface ViewableDetector { index : number ; detector_description : string | undefined ; function : string ; } export function getViewableDetectors ( selectedJob ) { const jobDetectors = selectedJob . analysis_config . detectors ; const viewableDetectors = [ ] ; jobDetectors . forEach ( ( dtr , index ) => { if ( isTimeSeriesViewDetector ( selectedJob , index ) ) { viewableDetectors . push ( { index , detector_description : dtr . detector_description , function : dtr . function , } ) ; } } ) ; return viewableDetectors ; }