import type { MetricsSchema } from "./index.js"; /** Store-independent daily observations, shared by adapters and renderers. */ export interface DailyMetric { project: string; key: string; label: string; kind: string; help: string; unit: string; dimensions: Record; day: string; count: number; sum: number; } /** Per key, from opt-in per-user rows: keys nobody touched in the window are absent. */ export interface AudienceMetric { project: string; key: string; /** Distinct actors. */ uniques: number; /** Actors with more than one sample on a single day. */ repeatUsers: number; /** Actors seen on more than one day. */ returningUsers: number; } /** Unordered: how many of `from`'s actors also touched `to`, in the same window. */ export interface AudienceOverlap { project: string; from: string; to: string; fromUsers: number; bothUsers: number; } export interface Audience { metrics: AudienceMetric[]; overlaps: AudienceOverlap[]; } /** * Distinct actors of one per-user key: per day, and over the whole window as a set. The * window figure is never the sum of the days; an actor alive on two days counts once. */ export interface ActiveActors { project: string; key: string; daily: { day: string; users: number; }[]; window: number; } export interface MetricsWindow { from: string; to: string; /** The window ends on the current, incomplete UTC day. */ partial: boolean; } /** One project, one window, everything a panel renders; the schema comes from the store. */ export interface MetricsReport { project: string; window: MetricsWindow; schema: MetricsSchema; daily: DailyMetric[]; audience: Audience; } export interface MetricTotal { project: string; key: string; label: string; kind: string; unit: string; dimensions: Record; count: number; sum: number; average: number | null; } export interface MetricChange { absolute: number; /** Null when a percentage has no nonzero baseline. */ percent: number | null; } export interface MetricComparison { project: string; key: string; label: string; kind: string; unit: string; dimensions: Record; current: MetricTotal | null; previous: MetricTotal | null; countChange: MetricChange; averageChange: MetricChange | null; } /** Adjacent equal-length UTC windows; completed days by default. */ export declare function metricWindows(days: number, options?: { now?: Date; includeToday?: boolean; }): { current: { from: string; to: string; }; previous: { from: string; to: string; }; partial: boolean; }; /** Compare recorded observations; absent series have zero counts, never zero latency. */ export declare function compareMetrics(current: readonly DailyMetric[], previous: readonly DailyMetric[]): MetricComparison[]; /** One report shape for terminal and web. No product names or metric lists. */ export declare function summarizeMetrics(rows: readonly DailyMetric[]): MetricTotal[]; //# sourceMappingURL=report.d.ts.map