UNPKG

@trophyso/node

Version:
21 lines (20 loc) 843 B
import type * as TrophyApi from "../index"; /** * A user's metric data for a wrapped period. */ export interface WrappedMetric { /** The name of the metric. */ name: string; /** The units of the metric. */ units?: string; /** The user's current total for the metric. */ currentTotal: number; /** The change in the metric value during the period. */ changeThisPeriod: number; /** The percentage change in the metric value during the period. */ percentChange: number; /** The user's percentile rank for this metric during the period. Only included for weekly, monthly, and yearly aggregation periods. */ percentileThisPeriod?: number; /** Metric data broken down by attribute key and value. */ byAttribute: Record<string, Record<string, TrophyApi.WrappedMetricByAttributeValueValue>>; }