@ninetailed/experience.js 2.0.0-beta.23 → 2.0.0-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { PageData, AnalyticsPlugin, DetachListeners } from 'analytics';
2
2
  import { Locale, Traits, Profile, Variant } from '@ninetailed/experience.js-shared';
3
3
  import { ProfileState } from './types';
4
+ import { ExperienceConfiguration } from './experience';
4
5
  declare global {
5
6
  interface Window {
6
7
  ninetailed?: {
@@ -33,6 +34,14 @@ export declare type TrackHasSeenComponent = (payload: {
33
34
  };
34
35
  isPersonalized: boolean;
35
36
  }) => Promise<void>;
37
+ export declare type TrackExperiencePayload = {
38
+ experience: ExperienceConfiguration;
39
+ variant: {
40
+ id: string;
41
+ hidden: boolean;
42
+ };
43
+ };
44
+ export declare type TrackExperience = (payload: TrackExperiencePayload) => Promise<void>;
36
45
  export declare type Identify = (uid: string, traits?: Traits, options?: EventFunctionOptions) => Promise<void>;
37
46
  export declare type Reset = () => void;
38
47
  export declare type Debug = (enable: boolean) => void;
@@ -41,6 +50,7 @@ export interface NinetailedInstance {
41
50
  page: Page;
42
51
  track: Track;
43
52
  trackHasSeenComponent: TrackHasSeenComponent;
53
+ trackExperience: TrackExperience;
44
54
  identify: Identify;
45
55
  reset: Reset;
46
56
  debug: Debug;
@@ -60,6 +70,7 @@ export declare class Ninetailed implements NinetailedInstance {
60
70
  page: (data?: PageData, options?: EventFunctionOptions) => Promise<any>;
61
71
  track: (event: string, payload?: unknown, options?: EventFunctionOptions) => Promise<any>;
62
72
  trackHasSeenComponent: TrackHasSeenComponent;
73
+ trackExperience: TrackExperience;
63
74
  identify: (uid: string, traits?: Traits, options?: EventFunctionOptions) => Promise<any>;
64
75
  reset: () => any;
65
76
  debug: (enabled: boolean) => any;
@@ -0,0 +1 @@
1
+ export declare const decodeExperienceVariantsMap: (encodedExperienceVariantsMap: string) => Record<string, number>;
@@ -8,3 +8,4 @@ export { selectExperience } from './selectExperience';
8
8
  export { selectVariant as selectExperienceVariant } from './selectVariant';
9
9
  export { isExperienceMatch } from './isExperienceMatch';
10
10
  export { selectDistribution } from './selectDistribution';
11
+ export { decodeExperienceVariantsMap } from './decodeExperienceVariantsMap';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js",
3
- "version": "2.0.0-beta.23",
3
+ "version": "2.0.0-beta.24",
4
4
  "main": "./index.umd.js",
5
5
  "module": "./index.esm.js",
6
6
  "typings": "./index.d.ts",
7
7
  "dependencies": {
8
8
  "analytics": "^0.8.0",
9
- "@ninetailed/experience.js-shared": "2.0.0-beta.23",
9
+ "@ninetailed/experience.js-shared": "2.0.0-beta.24",
10
10
  "uuid": "^8.3.2",
11
11
  "ts-toolbelt": "^9.6.0",
12
12
  "locale-enum": "^1.1.1",