/*! * Convert JS SDK * Version 1.0.0 * Copyright(c) 2020 Convert Insights, Inc * License Apache-2.0 */ import { BucketingManagerInterface } from './interfaces/bucketing-manager'; import { BucketingAllocation, BucketingHash, Config } from '../../types'; import { LogManagerInterface } from '../../logger'; /** * Provides logic for bucketing for specific visitor (by visitorId) or randomly * @category Modules * @constructor * @implements {BucketingManagerInterface} */ export declare class BucketingManager implements BucketingManagerInterface { private readonly _max_traffic; private readonly _hash_seed; private _loggerManager; /** * @param {Config=} config * @param {Object=} dependencies * @param {LogManagerInterface=} dependencies.loggerManager */ constructor(config?: Config, { loggerManager }?: { loggerManager?: LogManagerInterface; }); /** * Select variation based on its percentages and value provided * @param {object} buckets Key-value object with variations IDs as keys and percentages as values * @param {number} value A bucket value * @param {number=} redistribute Defaults to '0' * @return {string | null} */ selectBucket(buckets: Record, value: number, redistribute?: number): string | null; /** * Get a value based on hash from Visitor id to use for bucket selecting * @param {string} visitorId * @param {BucketingHash=} options * @param {number=} [options.seed=] * @param {string=} [options.experienceId=] * @return {number} */ getValueVisitorBased(visitorId: string, options?: BucketingHash): number; /** * Get a bucket for the visitor * @param {object} buckets Key-value object with variations IDs as keys and percentages as values * @param {string} visitorId * @param {BucketingHash=} options * @param {number=} [options.redistribute=0] * @param {number=} [options.seed=] * @param {string=} [options.experienceId=] * @return {BucketingAllocation | null} */ getBucketForVisitor(buckets: Record, visitorId: string, options?: BucketingHash): BucketingAllocation | null; }