/** * Tool: get_trend * * Analyzes a single health metric over time using linear regression, * anomaly detection, and statistical summary. * * Supported metrics: recovery, hrv, rhr, sleep_duration, sleep_performance, strain. * Each maps to the correct WHOOP endpoint and field extraction. */ import type { WhoopClient } from "../api/client.js"; import type { TrendDirectionResult } from "./stats-utils.js"; /** Supported metric names */ export type TrendMetric = "recovery" | "hrv" | "rhr" | "sleep_duration" | "sleep_performance" | "strain"; /** Input parameters for get_trend */ export interface GetTrendParams { metric: TrendMetric; days?: number; } /** Confidence level based on R² */ export type TrendConfidence = "high" | "medium" | "low"; /** A detected anomaly with date */ export interface TrendAnomaly { date: string; value: number; deviation_from_mean: number; } /** Output shape for get_trend */ export interface TrendAnalysis { metric: string; period: { start: string; end: string; days: number; }; values: number[]; statistics: { mean: number; median: number; std_dev: number; min: number; max: number; }; trend: { direction: TrendDirectionResult; slope: number; confidence: TrendConfidence; }; anomalies: TrendAnomaly[]; } /** * Analyze a health metric trend over time. * * Fetches data for the specified number of days, computes statistics, * linear regression trend, and anomaly detection. * * @throws Error if fewer than 2 scored data points are available */ export declare function getTrend(client: WhoopClient, params: GetTrendParams): Promise; //# sourceMappingURL=get-trend.d.ts.map