/** * @octomil/browser — A/B testing and experiments client * * Deterministic variant assignment, experiment config caching, * and metric reporting for model experiments. */ import type { Experiment, ExperimentVariant } from "./types.js"; import type { TelemetryReporter } from "./telemetry.js"; export declare class ExperimentsClient { private readonly serverUrl; private readonly apiKey?; private readonly cacheTtlMs; private readonly telemetry?; private experimentsCache; constructor(options: { serverUrl: string; apiKey?: string; cacheTtlMs?: number; telemetry?: TelemetryReporter; }); /** Fetch all active experiments (cached). */ getActiveExperiments(): Promise; /** Get full experiment config by ID. */ getExperimentConfig(experimentId: string): Promise; /** * Deterministic variant assignment. * Hash(deviceId + experimentId) → bucket → variant by cumulative traffic %. */ getVariant(experiment: Experiment, deviceId: string): ExperimentVariant | null; /** Check if a device is enrolled in a specific experiment. */ isEnrolled(experiment: Experiment, deviceId: string): boolean; /** * Find which experiment (if any) affects a given model, and return * the variant this device should use. */ resolveModelExperiment(modelId: string, deviceId: string): Promise<{ experiment: Experiment; variant: ExperimentVariant; } | null>; /** Report a metric for an experiment. */ trackMetric(experimentId: string, metricName: string, value: number, deviceId?: string): Promise; /** Clear the experiment cache. */ clearCache(): void; } //# sourceMappingURL=experiments.d.ts.map