UNPKG

npaw-plugin-nwf

Version:
39 lines (38 loc) 971 B
import ExperimentVariant from './ExperimentVariant'; /** * Experiment */ export default class Experiment { private accountCode; private userId; private profileId; private deviceId; private experimentVariants; /** * Parses the API response and converts it to ExperimentVariant objects * @param response The response string from the API * @returns Array of ExperimentVariant objects or null if parsing fails */ private static parse; /** * Fetch URL */ private static fetch; /** * Constructor * @param accountCode * @param userId * @param profileId * @param deviceId */ constructor(accountCode: string, userId: string | null, profileId: string | null, deviceId: string | null); /** * Fetch experiment variants */ fetch(): void; /** * Get variant * @param code */ getVariant(experimentCode: string): ExperimentVariant | null; }