import { schema , TypeOf } from '@kbn/config-schema' ; import { ChartData } from '../shared_imports' ; import { runtimeMappingsSchema } from './common' ; export const fieldHistogramsRequestSchema = schema . object ( { /** Query to match documents in the index. */ query : schema . any ( ) , /** The fields to return histogram data. */ fields : schema . arrayOf ( schema . any ( ) ) , /** Optional runtime fields */ runtimeMappings : runtimeMappingsSchema , /** Number of documents to be collected in the sample processed on each shard, or -1 for no sampling. */ samplerShardSize : schema . number ( ) , } ) ; export type FieldHistogramsRequestSchema = TypeOf < typeof fieldHistogramsRequestSchema > ; export type FieldHistogramsResponseSchema = ChartData [ ] ;