import type { Datum } from "./datumTypes";
export interface AnomalyConfig {
    /** Standard deviation multiplier for anomaly bounds. Default: 2 */
    threshold?: number;
    /** Show shaded anomaly band. Default: true */
    showBand?: boolean;
    /** Band fill color. Default: "#6366f1" */
    bandColor?: string;
    /** Band fill opacity. Default: 0.1 */
    bandOpacity?: number;
    /** Outlier dot color. Default: "#ef4444" */
    anomalyColor?: string;
    /** Outlier dot radius. Default: 6 */
    anomalyRadius?: number;
    /** Label for the band */
    label?: string;
}
export interface ForecastConfig {
    /** X-value where training data ends. Required for auto mode. */
    trainEnd?: number;
    /** Number of forecast steps beyond last data point. Default: 10 */
    steps?: number;
    /** Regression method. Default: "linear" */
    method?: "linear" | "loess";
    /** LOESS bandwidth (only for method="loess"). Default: 0.3 */
    bandwidth?: number;
    /** Confidence level for prediction interval (0-1). Default: 0.95 */
    confidence?: number;
    /** Field or function marking training data points */
    isTraining?: string | ((d: Datum) => boolean);
    /** Field or function marking forecast data points */
    isForecast?: string | ((d: Datum) => boolean);
    /** Field or function marking anomalous data points */
    isAnomaly?: string | ((d: Datum) => boolean);
    /** Field or function for upper envelope bound per data point */
    upperBounds?: string | ((d: Datum) => number);
    /** Field or function for lower envelope bound per data point */
    lowerBounds?: string | ((d: Datum) => number);
    /** Color for forecast line and envelope. Default: "#6366f1" */
    color?: string;
    /** Envelope fill opacity. Default: 0.15 */
    bandOpacity?: number;
    /** Dash pattern for training line segment. Default: "8,4" */
    trainDasharray?: string;
    /** Dash pattern for forecast line segment. Default: "4,4" */
    forecastDasharray?: string;
    /** Stroke opacity for the training line segment (0–1). Default: 1 */
    trainOpacity?: number;
    /** Stroke opacity for the forecast line segment (0–1). Default: 1 */
    forecastOpacity?: number;
    /**
     * Training line stroke color.
     * - `"darken"`: auto-darken the line's own color by 50% (hex colors only —
     *   non-hex values like `rgb()` or CSS variables pass through unchanged).
     * - Any CSS color string: use that color explicitly.
     * - Omit to inherit the line's color unchanged.
     */
    trainStroke?: string;
    /** Training line linecap (e.g. "round"). Default: inherits from base style */
    trainLinecap?: string;
    /**
     * Render a solid underline beneath the dashed training line.
     * - `true`: solid line in the base (or lightened) color beneath the dashed training line
     * - `"lighten"`: solid line in a 40% lightened version of the line's color
     * - Omit or `false`: no underline (default)
     */
    trainUnderline?: boolean | "lighten";
    /**
     * Outlier dot color.
     * - `string`: fixed color (default: "#ef4444")
     * - `(datum) => string`: per-datum color function
     */
    anomalyColor?: string | ((datum: Datum) => string);
    /**
     * Outlier dot radius.
     * - `number`: fixed radius (default: 6)
     * - `(datum) => number`: per-datum radius function (e.g. for count-based sizing)
     */
    anomalyRadius?: number | ((datum: Datum) => number);
    /**
     * Full style override for anomaly dots.
     * When provided as a function, receives the datum and should return a CSS style object.
     * Overrides `anomalyColor` when provided.
     */
    anomalyStyle?: Datum | ((datum: Datum) => Datum);
    /**
     * Internal: field name used to group data into separate lines (e.g. "metricLabel").
     * When set, boundary point duplication only bridges within the same group,
     * preventing cross-metric stray lines. Set automatically by LineChart when
     * both lineBy and forecast are active.
     * @internal
     */
    _groupBy?: string;
    /** Label for the forecast/envelope region */
    label?: string;
}
/** Internal segment marker added to each datum */
export declare const SEGMENT_FIELD: "__forecastSegment";
export type SegmentType = "training" | "training-base" | "observed" | "forecast";
export declare function buildAnomalyAnnotations(config: AnomalyConfig): Datum[];
export interface ForecastResult {
    processedData: Datum[];
    annotations: Datum[];
}
export declare function buildForecast(data: Datum[], xAccessor: string, yAccessor: string, forecastConfig: ForecastConfig, anomalyConfig?: AnomalyConfig): ForecastResult;
export { darkenColor, lightenColor } from "./colorManipulation";
export declare function createSegmentLineStyle(baseStyle: (d: Datum) => Datum, forecastConfig: ForecastConfig): (d: Datum) => Datum;
