import { buildRangeFilter , RangeFilterParams } from '../../../../../common' ; import { AggTypesDependencies } from '../../agg_types' ; import { IBucketAggConfig } from '../bucket_agg_type' ; internal export const createFilterHistogram = ( getFieldFormatsStart ) => { return ( aggConfig , key ) => { const { deserialize } = getFieldFormatsStart ( ) ; const value = parseInt ( key , 10 ) ; const params = { gte : value , lt : value + aggConfig . params . interval } ; return buildRangeFilter ( aggConfig . params . field , params , aggConfig . getIndexPattern ( ) , deserialize ( aggConfig . toSerializedFieldFormat ( ) ) . convert ( key ) ) ; } ; } ;