@ninetailed/experience.js 2.0.0-beta.2 → 2.0.0-beta.20

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.
@@ -46,11 +46,12 @@ export interface NinetailedInstance {
46
46
  debug: Debug;
47
47
  profileState: ProfileState;
48
48
  onProfileChange: OnProfileChange;
49
+ plugins: AnalyticsPlugin[];
49
50
  }
50
51
  export declare class Ninetailed implements NinetailedInstance {
51
52
  private readonly instance;
52
- private readonly plugins;
53
53
  private _profileState;
54
+ readonly plugins: AnalyticsPlugin[];
54
55
  constructor({ clientId, environment, }: {
55
56
  clientId: string;
56
57
  environment?: string;
@@ -1,3 +1,3 @@
1
- export declare const log: any;
2
1
  export declare const enable: () => void;
3
- export declare const disable: () => any;
2
+ export declare const disable: () => void;
3
+ export declare const log: (...msg: any[]) => void;
@@ -1,6 +1,5 @@
1
1
  import { Profile } from '@ninetailed/experience.js-shared';
2
- import { Variant } from './types';
3
- import { Baseline, ExperienceConfiguration } from './types';
2
+ import { Baseline, ExperienceConfiguration, Variant } from './types';
4
3
  declare type SelectVariantArgs = {
5
4
  baseline: Baseline;
6
5
  experience: ExperienceConfiguration;
@@ -0,0 +1,5 @@
1
+ export declare type Distribution = {
2
+ index: number;
3
+ start: number;
4
+ end: number;
5
+ };
@@ -1,16 +1,13 @@
1
1
  import { BaselineWithVariants } from './BaselineWithVariants';
2
+ import { Distribution } from './Distribution';
2
3
  export declare type ExperienceType = 'nt_personalization' | 'nt_experiment';
3
4
  export declare type ExperienceConfiguration = {
4
5
  id: string;
5
6
  type: ExperienceType;
6
- audience: {
7
+ audience?: {
7
8
  id: string;
8
9
  };
9
10
  trafficAllocation: number;
10
- distribution: {
11
- index: number;
12
- start: number;
13
- end: number;
14
- }[];
11
+ distribution: Distribution[];
15
12
  components: BaselineWithVariants[];
16
13
  };
@@ -1,4 +1,5 @@
1
1
  export type { Baseline } from './Baseline';
2
2
  export type { Variant } from './Variant';
3
3
  export type { BaselineWithVariants } from './BaselineWithVariants';
4
- export type { ExperienceConfiguration, ExperienceType } from './ExperienceConfiguration';
4
+ export type { Distribution } from './Distribution';
5
+ export type { ExperienceConfiguration, ExperienceType, } from './ExperienceConfiguration';
@@ -0,0 +1,4 @@
1
+ import { Profile } from '@ninetailed/experience.js-shared';
2
+ import { ExperienceConfiguration } from './types';
3
+ export declare const getTrafficRandom: (profile: Profile, experience: ExperienceConfiguration) => number;
4
+ export declare const getDistributionRandom: (profile: Profile, experience: ExperienceConfiguration) => number;
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.20",
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.2",
9
+ "@ninetailed/experience.js-shared": "2.0.0-beta.20",
10
10
  "uuid": "^8.3.2",
11
11
  "ts-toolbelt": "^9.6.0",
12
12
  "locale-enum": "^1.1.1",
13
13
  "i18n-iso-countries": "^7.3.0",
14
- "lodash": "^4.17.21"
14
+ "lodash": "^4.17.21",
15
+ "loglevel": "^1.8.0",
16
+ "murmurhash-js": "^1.0.0"
15
17
  },
16
18
  "peerDependencies": {}
17
19
  }