@ninetailed/experience.js 4.2.3 → 4.3.0-beta.1

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.
@@ -6,73 +6,73 @@ export declare const TrackExperienceProperties: z.ZodObject<{
6
6
  name: z.ZodString;
7
7
  description: z.ZodOptional<z.ZodString>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- description?: string | undefined;
10
9
  type: "nt_experiment" | "nt_personalization";
11
10
  id: string;
12
11
  name: string;
13
- }, {
14
12
  description?: string | undefined;
13
+ }, {
15
14
  type: "nt_experiment" | "nt_personalization";
16
15
  id: string;
17
16
  name: string;
17
+ description?: string | undefined;
18
18
  }>;
19
19
  audience: z.ZodDefault<z.ZodOptional<z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  name: z.ZodOptional<z.ZodString>;
22
22
  description: z.ZodOptional<z.ZodString>;
23
23
  }, "strip", z.ZodTypeAny, {
24
+ id: string;
24
25
  name?: string | undefined;
25
26
  description?: string | undefined;
26
- id: string;
27
27
  }, {
28
+ id: string;
28
29
  name?: string | undefined;
29
30
  description?: string | undefined;
30
- id: string;
31
31
  }>>>;
32
32
  selectedVariant: z.ZodObject<{
33
33
  id: z.ZodString;
34
- }, "strip", z.ZodUnknown, {
35
- [x: string]: unknown;
36
- id: string;
37
- }, {
38
- [x: string]: unknown;
39
- id: string;
40
- }>;
34
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
35
+ id: z.ZodString;
36
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
37
+ id: z.ZodString;
38
+ }, z.ZodUnknown, "strip">>;
41
39
  selectedVariantIndex: z.ZodNumber;
42
40
  }, "strip", z.ZodTypeAny, {
43
41
  experience: {
44
- description?: string | undefined;
45
42
  type: "nt_experiment" | "nt_personalization";
46
43
  id: string;
47
44
  name: string;
45
+ description?: string | undefined;
48
46
  };
49
47
  audience: {
48
+ id: string;
50
49
  name?: string | undefined;
51
50
  description?: string | undefined;
52
- id: string;
53
51
  };
54
52
  selectedVariant: {
55
- [x: string]: unknown;
56
53
  id: string;
54
+ } & {
55
+ [k: string]: unknown;
57
56
  };
58
57
  selectedVariantIndex: number;
59
58
  }, {
60
- audience?: {
61
- name?: string | undefined;
62
- description?: string | undefined;
63
- id: string;
64
- } | undefined;
65
59
  experience: {
66
- description?: string | undefined;
67
60
  type: "nt_experiment" | "nt_personalization";
68
61
  id: string;
69
62
  name: string;
63
+ description?: string | undefined;
70
64
  };
71
65
  selectedVariant: {
72
- [x: string]: unknown;
73
66
  id: string;
67
+ } & {
68
+ [k: string]: unknown;
74
69
  };
75
70
  selectedVariantIndex: number;
71
+ audience?: {
72
+ id: string;
73
+ name?: string | undefined;
74
+ description?: string | undefined;
75
+ } | undefined;
76
76
  }>;
77
77
  export type TrackExperienceProperties = z.input<typeof TrackExperienceProperties>;
78
78
  export type SanitizedTrackExperienceProperties = z.infer<typeof TrackExperienceProperties> & {
@@ -2,6 +2,7 @@ import { Logger, PageviewProperties, Profile, Properties, Traits } from '@nineta
2
2
  import { DetachListeners } from 'analytics';
3
3
  import { TrackExperienceProperties, TrackComponentProperties } from './TrackingProperties';
4
4
  import { NinetailedPlugin } from './NinetailedPlugin';
5
+ import { type Ninetailed } from '../Ninetailed';
5
6
  type Loading = {
6
7
  status: 'loading';
7
8
  profile: null;
@@ -40,6 +41,8 @@ export type Identify = (uid: string, traits?: Traits, options?: EventFunctionOpt
40
41
  export type Reset = () => void;
41
42
  export type Debug = (enable: boolean) => void;
42
43
  export type OnProfileChange = (cb: OnProfileChangeCallback) => DetachListeners;
44
+ type ObserveElement = Ninetailed['observeElement'];
45
+ type UnObserveElement = Ninetailed['unobserveElement'];
43
46
  export interface NinetailedInstance {
44
47
  page: Page;
45
48
  track: Track;
@@ -53,8 +56,13 @@ export interface NinetailedInstance {
53
56
  plugins: NinetailedPlugin[];
54
57
  logger: Logger;
55
58
  onIsInitialized: OnIsInitialized;
59
+ observeElement: ObserveElement;
60
+ unobserveElement: UnObserveElement;
56
61
  }
57
62
  export { NinetailedPlugin, TrackExperienceProperties, TrackComponentProperties, };
58
63
  export type { EventHandler } from './EventHandler';
59
64
  export type { AnalyticsInstance } from './AnalyticsInstance';
60
65
  export type { SanitizedTrackExperienceProperties } from './TrackingProperties';
66
+ export type { ElementSeenPayload } from './ElementSeenPayload';
67
+ export type { ProfileChangedPayload } from './ProfileChangedPayload';
68
+ export type { Credentials } from './Credentials';
@@ -0,0 +1,4 @@
1
+ import { type Credentials } from '../Credentials';
2
+ export interface AcceptsCredentials {
3
+ setCredentials(credentials: Credentials): void;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { PAGE_HIDDEN } from '../../constants';
2
+ import { EventHandler } from '../EventHandler';
3
+ export interface InterestedInHiddenPage {
4
+ [PAGE_HIDDEN]: EventHandler<void>;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { PROFILE_CHANGE } from '@ninetailed/experience.js-shared';
2
+ import { EventHandler } from '../EventHandler';
3
+ import { ProfileChangedPayload } from '../ProfileChangedPayload';
4
+ export interface InterestedInProfileChange {
5
+ [PROFILE_CHANGE]: EventHandler<ProfileChangedPayload>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { HAS_SEEN_ELEMENT } from '../../constants';
2
+ import { ElementSeenPayload } from '../ElementSeenPayload';
3
+ import { EventHandler } from '../EventHandler';
4
+ export interface InterestedInSeenElements {
5
+ [HAS_SEEN_ELEMENT]: EventHandler<ElementSeenPayload>;
6
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js",
3
- "version": "4.2.3",
3
+ "version": "4.3.0-beta.1",
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": "4.2.3",
9
+ "@ninetailed/experience.js-shared": "4.3.0-beta.1",
10
10
  "analytics": "0.8.1",
11
11
  "zod": "3.21.4"
12
12
  },