@ninetailed/experience.js 3.0.0-beta.28 → 3.0.0-beta.32
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.
- package/index.cjs +229 -166
- package/index.js +230 -167
- package/lib/Ninetailed.d.ts +8 -8
- package/package.json +2 -2
package/lib/Ninetailed.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Locale, Traits, Profile, Variant, OnLogHandler, OnErrorHandler, Logger } from '@ninetailed/experience.js-shared';
|
|
1
|
+
import { AnalyticsPlugin, DetachListeners } from 'analytics';
|
|
2
|
+
import { Locale, Traits, Profile, Variant, OnLogHandler, OnErrorHandler, Logger, PageviewProperties, Properties } from '@ninetailed/experience.js-shared';
|
|
3
3
|
import { ProfileState } from './types';
|
|
4
4
|
import { ExperienceConfiguration } from './experience';
|
|
5
5
|
declare global {
|
|
@@ -29,8 +29,8 @@ declare type EventFunctionOptions = {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
declare type OnProfileChangeCallback = (profile: ProfileState) => void;
|
|
32
|
-
export declare type Page = (data?:
|
|
33
|
-
export declare type Track = (event: string,
|
|
32
|
+
export declare type Page = (data?: Partial<PageviewProperties>, options?: EventFunctionOptions) => Promise<void>;
|
|
33
|
+
export declare type Track = (event: string, properties?: Properties, options?: EventFunctionOptions) => Promise<void>;
|
|
34
34
|
export declare type TrackHasSeenComponent = (payload: {
|
|
35
35
|
variant: Variant<unknown>;
|
|
36
36
|
audience: {
|
|
@@ -38,14 +38,14 @@ export declare type TrackHasSeenComponent = (payload: {
|
|
|
38
38
|
};
|
|
39
39
|
isPersonalized: boolean;
|
|
40
40
|
}) => Promise<void>;
|
|
41
|
-
export declare type
|
|
41
|
+
export declare type TrackExperienceProperties = {
|
|
42
42
|
experience: ExperienceConfiguration;
|
|
43
43
|
variant: number;
|
|
44
44
|
component: {
|
|
45
45
|
id: string;
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
export declare type TrackExperience = (
|
|
48
|
+
export declare type TrackExperience = (properties: TrackExperienceProperties) => Promise<void>;
|
|
49
49
|
export declare type Identify = (uid: string, traits?: Traits, options?: EventFunctionOptions) => Promise<void>;
|
|
50
50
|
export declare type Reset = () => void;
|
|
51
51
|
export declare type Debug = (enable: boolean) => void;
|
|
@@ -75,8 +75,8 @@ export declare class Ninetailed implements NinetailedInstance {
|
|
|
75
75
|
environment?: string;
|
|
76
76
|
preview?: boolean;
|
|
77
77
|
}, { plugins, url, profile, locale, requestTimeout, onLog, onError, }?: Options);
|
|
78
|
-
page: (data?:
|
|
79
|
-
track: (event: string,
|
|
78
|
+
page: (data?: Partial<PageviewProperties>, options?: EventFunctionOptions) => Promise<any>;
|
|
79
|
+
track: (event: string, properties?: Properties, options?: EventFunctionOptions) => Promise<any>;
|
|
80
80
|
trackHasSeenComponent: TrackHasSeenComponent;
|
|
81
81
|
trackExperience: TrackExperience;
|
|
82
82
|
identify: (uid: string, traits?: Traits, options?: EventFunctionOptions) => Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.32",
|
|
4
4
|
"module": "./index.js",
|
|
5
5
|
"main": "./index.cjs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@ninetailed/experience.js-shared": "3.0.0-beta.
|
|
9
|
+
"@ninetailed/experience.js-shared": "3.0.0-beta.32",
|
|
10
10
|
"analytics": "0.8.1",
|
|
11
11
|
"lodash": "4.17.21",
|
|
12
12
|
"murmurhash-js": "1.0.0"
|