import { z } from "zod"; import type { Sleep } from "../api/types.js"; import type { WhoopClient } from "../api/client.js"; export declare const DISCLAIMER = "Statistical observation from your data, not medical advice."; /** WHOOP recovery zones: < 34 red, 34–66 yellow, > 66 green. */ export declare const RECOVERY_ZONES: { readonly red_below: 34; readonly green_above: 66; }; export declare const DAY_MS = 86400000; export declare const HOUR_MS = 3600000; export declare const periodSchema: z.ZodObject<{ start: z.ZodString; end: z.ZodString; }, z.core.$strip>; export declare const sourceQualitySchema: z.ZodObject<{ status: z.ZodEnum<{ available: "available"; pending: "pending"; missing: "missing"; stale: "stale"; unscored: "unscored"; calibrating: "calibrating"; invalid: "invalid"; fetch_failed: "fetch_failed"; }>; fetched_at: z.ZodNullable; source_updated_at: z.ZodNullable; cache_status: z.ZodEnum<{ unknown: "unknown"; hit: "hit"; miss: "miss"; }>; records_fetched: z.ZodNumber; records_used: z.ZodNumber; exclusions: z.ZodRecord; truncated: z.ZodBoolean; }, z.core.$strip>; export declare const dataQualitySchema: z.ZodObject<{ evaluated_at: z.ZodString; requested_period: z.ZodObject<{ start: z.ZodString; end: z.ZodString; }, z.core.$strip>; observed_period: z.ZodNullable>; sources: z.ZodRecord; fetched_at: z.ZodNullable; source_updated_at: z.ZodNullable; cache_status: z.ZodEnum<{ unknown: "unknown"; hit: "hit"; miss: "miss"; }>; records_fetched: z.ZodNumber; records_used: z.ZodNumber; exclusions: z.ZodRecord; truncated: z.ZodBoolean; }, z.core.$strip>>; method_version: z.ZodString; limitations: z.ZodArray; }, z.core.$strip>; export type SourceQuality = z.infer; export type DataQuality = z.infer; export declare function sourceQuality(count?: number, truncated?: boolean): SourceQuality; export declare function exclude(quality: SourceQuality, reason: string): void; export declare function localTime(timestamp: string, offset: string): Date; export declare function localDay(timestamp: string, offset: string): string; export declare function asleepHours(sleep: Sleep): number; export declare function observedPeriod(timestamps: string[]): { start: string; end: string; } | null; export declare function parseRecords(records: unknown[], schema: z.ZodType, quality: SourceQuality): T[]; export declare function loadAnalyticsSource(client: WhoopClient, endpoint: string, period: { start: string; end: string; }, schema: z.ZodType): Promise<{ records: T[]; quality: SourceQuality; }>; export declare function mainSleeps(records: Sleep[], period: { start: string; end: string; }, quality: SourceQuality): Sleep[]; export declare function finishQuality(quality: SourceQuality, records: { updated_at: string; }[]): void; //# sourceMappingURL=analytics-utils.d.ts.map