import { Datum } from '../../shared/options'; export type AnnotationStat = 'mean' | 'median' | 'min' | 'max' | 'sum' | 'percentile'; export interface ComputedAnnotationValue { stat: AnnotationStat; /** Data field the statistic is taken over. */ field: string; /** For `stat: 'percentile'` — 0..100 (95 is the p95). */ percentile?: number; /** * Field holding how many records each row stands for. Pre-aggregated data — * one row per bucket with a count beside it — otherwise gets the statistic of * the buckets rather than of the records: without weights the median of * `[{ms: 10, n: 900}, {ms: 900, n: 1}]` is 455, with them it is 10. * Rows with a non-positive or non-numeric weight are left out. */ weightField?: string; } export declare function isComputedValue(value: unknown): value is ComputedAnnotationValue; /** * The number a computed value stands for, or undefined when the field holds * nothing numeric — an annotation with nothing to say is left undrawn. */ export declare function computeStat(data: Datum[], value: ComputedAnnotationValue): number | undefined; /** * Passes a plain value through and answers a computed one. Undefined means the * statistic could not be taken, and the caller skips whatever it was drawing. */ export declare function resolveValue(value: unknown, data: Datum[]): unknown;