import type { Logger } from './logger'; import type { Experiment, Variant } from './store'; /** * Decide between all experiments in a repeatable way. This function works on the presumption that * only one experiment can be active for any device at any given time. * * @param experiments The experiments being decided between * @param deviceId Identifier allowing for repeatable decisions */ export declare const decideExperiment: (experiments: Experiment[], deviceId: string, logger: Logger) => Experiment | undefined; /** * Decide between variants in a repeatable way. * * @param variants The variants being decided between * @param deviceId Identifier allowing for repeatable decisions */ export declare const decideVariant: (variants: Variant[], deviceId: string, logger: Logger) => Variant | undefined; /** * Returns the index of the probability matching the input value. If the sum of probabilities does * not add up to 1 than this function will return -1 indicating that none of the given probabilities * was selected. * * @param probabilities Array of probabilities who's sum is between 0 (exclusive) and 1 (inclusive). * @param value The value who's index is being determined. Float between 0 (inclusive) and 1 (exclusive). * * @example * // always returns 0 * indexFromProbability([1.0], 0.8) * * @example * // returns 1 * indexFromProbability([0.1, 0.7, 0.2], 0.2) * * @example * // returns 2 * indexFromProbability([0.1, 0.7, 0.2], 0.81) * * @example * // returns -1 * indexFromProbability([0.1, 0.4], 0.63) */ export declare const indexOfProbability: (probabilities: number[], value: number, logger: Logger) => number; //# sourceMappingURL=stat.d.ts.map