import { JSONValue } from "./base.js"; import { MetricProperties } from "../metrics/helpers.js"; import { z } from "zod"; /** Dimensions used in Metric */ export declare const MetricDimensions: readonly ["metricId", "geographyId", "sketchId", "groupId", "classId"]; export type MetricDimension = (typeof MetricDimensions)[number] & keyof Metric; export declare const metricSchema: z.ZodObject<{ metricId: z.ZodString; value: z.ZodNumber; extra: z.ZodOptional>>; classId: z.ZodNullable; groupId: z.ZodNullable; geographyId: z.ZodNullable; sketchId: z.ZodNullable; }, "strip", z.ZodTypeAny, { value: number; classId: string | null; metricId: string; geographyId: string | null; sketchId: string | null; groupId: string | null; extra?: Record | undefined; }, { value: number; classId: string | null; metricId: string; geographyId: string | null; sketchId: string | null; groupId: string | null; extra?: Record | undefined; }>; export declare const metricsSchema: z.ZodArray>>; classId: z.ZodNullable; groupId: z.ZodNullable; geographyId: z.ZodNullable; sketchId: z.ZodNullable; }, "strip", z.ZodTypeAny, { value: number; classId: string | null; metricId: string; geographyId: string | null; sketchId: string | null; groupId: string | null; extra?: Record | undefined; }, { value: number; classId: string | null; metricId: string; geographyId: string | null; sketchId: string | null; groupId: string | null; extra?: Record | undefined; }>, "many">; /** * Single record of value, stratified in one or more dimensions. * The name Metric is an overgeneralization, you can think of it as a MetricValue. */ export type Metric = z.infer; export type Metrics = z.infer; /** Alternative JSON format for metrics data that is smaller in size, better suited for blob storage and network transport */ export interface MetricPack { dimensions: string[]; data: (string | number | boolean | JSONValue)[][]; } /** * Single flattened metric with class values keyed by class name * Useful for rendering table rows with the values of multiple classes for a group */ export type GroupMetricAgg = { groupId: string; value: number; percValue: number; [className: string]: string | number; }; export type GroupMetricSketchAgg = GroupMetricAgg & { sketchId: string; }; export type MetricIdTypes = string | number; export type MetricProperty = (typeof MetricProperties)[number] & keyof Metric;