/** * Utilities for bucketing visitors * Ported from https://github.com/optimizely/client-js/blob/94b7cd331744d0d6852442cd9fadeb7d4fb212f1/src/core/decision/bucketing.js * @module */ import type { Experience, WeightDistribution } from '../../models'; export declare const TOTAL_POINTS = 10000; /** * Generate a "bucketingNumber" which is a hash based on the ticket, entityId, and seed * Designed to be consistent with consistent inputs. * @param {string} bucketingId * @param {string} entityId * @param {hashing.Seed} seed * @return {number} between 0 and 9999 representing the bucketing number for the ticket * @private */ export declare function bucketingNumber(bucketingId: string, entityId: string, seed: number): number; /** * Decide if this ticket should be withheld from a given "entity" (layer, experiment, variation, etc) * based on the entity holdback property. * @param {string} bucketingId * @param {{id: string, holdback: (number|undefined)}} entity * @return {boolean} if the ticket should be held back */ export declare function isHoldback(bucketingId: string, entity: Experience): boolean; /** * Choose a weight for a ticket from an array of possible weights based on the entity * @param {string} bucketingId * @param {string} parentId * @param {WeightDistribution[]} candidates * @return {string} id of the chosen candidate */ export declare function chooseWeightedCandidate(bucketingId: string, parentId: string, candidates: WeightDistribution[]): string;