/*! * Convert JS SDK * Version 1.0.0 * Copyright(c) 2020 Convert Insights, Inc * License Apache-2.0 */ import { DataManagerInterface } from '../../data'; import { ExperienceManagerInterface } from './interfaces/experience-manager'; import { LogManagerInterface } from '../../logger'; import { Config, ConfigExperience, ExperienceVariationConfig, BucketedVariation, BucketingAttributes } from '../../types'; import { BucketingError, RuleError } from '../../enums'; /** * Provides experiences specific logic * @category Modules * @constructor * @implements {ExperienceManagerInterface} */ export declare class ExperienceManager implements ExperienceManagerInterface { private _dataManager; private _loggerManager; /** * @param config * @param {Record} dependencies * @param {DataManagerInterface} dependencies.dataManager * @param {LogManagerInterface=} dependencies.loggerManager */ constructor(config: Config, { dataManager, loggerManager }: { dataManager: DataManagerInterface; loggerManager?: LogManagerInterface; }); /** * Get a list of all entities * @return {Array} Experiences list */ getList(): Array; /** * Get the entity by key * @param {string} key * @return {ConfigExperience} An experience */ getExperience(key: string): ConfigExperience; /** * Get the entity by id * @param {string} id * @return {ConfigExperience} Get single experience */ getExperienceById(id: string): ConfigExperience; /** * Get specific entities by array of keys * @param {Array} keys * @return {Array} */ getExperiences(keys: Array): Array; /** * Select variation for specific visitor * @param {string} visitorId * @param {string} experienceKey * @param {BucketingAttributes} attributes * @param {Record} attributes.locationProperties * @param {Record} attributes.visitorProperties * @param {boolean=} attributes.updateVisitorProperties * @param {string=} attributes.forceVariationId * @param {boolean=} attributes.enableTracking * @param {string=} attributes.environment * @return {BucketedVariation | RuleError | BucketingError} */ selectVariation(visitorId: string, experienceKey: string, attributes: BucketingAttributes): BucketedVariation | RuleError | BucketingError; /** * Select variation for specific visitor * @param {string} visitorId * @param {string} experienceId * @param {BucketingAttributes} attributes * @param {Record} attributes.locationProperties * @param {Record} attributes.visitorProperties * @param {boolean=} attributes.updateVisitorProperties * @param {string=} attributes.forceVariationId * @param {boolean=} attributes.enableTracking * @param {string=} attributes.environment * @return {BucketedVariation | RuleError | BucketingError} */ selectVariationById(visitorId: string, experienceId: string, attributes: BucketingAttributes): BucketedVariation | RuleError | BucketingError; /** * Select all variations across all experiences for specific visitor * @param {string} visitorId * @param {BucketingAttributes} attributes * @param {Record} attributes.locationProperties * @param {Record} attributes.visitorProperties * @param {boolean=} attributes.updateVisitorProperties * @param {string=} attributes.forceVariationId * @param {boolean=} attributes.enableTracking * @param {string=} attributes.environment * @return {Array} */ selectVariations(visitorId: string, attributes: BucketingAttributes): Array; /** * Get experience's variation by key * @param {string} experienceKey * @param {string}variationKey */ getVariation(experienceKey: string, variationKey: string): ExperienceVariationConfig; /** * Get experience's variation by id * @param experienceId * @param variationId */ getVariationById(experienceId: string, variationId: string): ExperienceVariationConfig; }