@beworke/pixel 0.1.0-rc.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/README.md +163 -0
  3. package/RELEASE_CANDIDATE.md +256 -0
  4. package/dist/PixelLogger-B21lEjep.d.mts +8 -0
  5. package/dist/PixelLogger-B21lEjep.d.ts +8 -0
  6. package/dist/StorageFactory-BhpbB6Jj.d.mts +8 -0
  7. package/dist/StorageFactory-CAkJJqVD.d.ts +8 -0
  8. package/dist/config/index.cjs.js +3 -0
  9. package/dist/config/index.cjs.js.map +1 -0
  10. package/dist/config/index.d.mts +19 -0
  11. package/dist/config/index.d.ts +19 -0
  12. package/dist/config/index.esm.js +3 -0
  13. package/dist/config/index.esm.js.map +1 -0
  14. package/dist/events/index.cjs.js +3 -0
  15. package/dist/events/index.cjs.js.map +1 -0
  16. package/dist/events/index.d.mts +1 -0
  17. package/dist/events/index.d.ts +1 -0
  18. package/dist/events/index.esm.js +3 -0
  19. package/dist/events/index.esm.js.map +1 -0
  20. package/dist/examples/html-script/README.md +71 -0
  21. package/dist/examples/html-script/RELEASE_CANDIDATE.md +121 -0
  22. package/dist/examples/html-script/add-payment-info/README.md +46 -0
  23. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +494 -0
  24. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +478 -0
  25. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +486 -0
  26. package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +479 -0
  27. package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +492 -0
  28. package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +495 -0
  29. package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +469 -0
  30. package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +489 -0
  31. package/dist/examples/html-script/add-to-cart/README.md +36 -0
  32. package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +517 -0
  33. package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +512 -0
  34. package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +519 -0
  35. package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +514 -0
  36. package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +517 -0
  37. package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +527 -0
  38. package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +524 -0
  39. package/dist/examples/html-script/example-basic.html +350 -0
  40. package/dist/examples/html-script/example-behavior.html +435 -0
  41. package/dist/examples/html-script/example-conversion.html +479 -0
  42. package/dist/examples/html-script/example-integration.html +709 -0
  43. package/dist/examples/html-script/example-transport.html +748 -0
  44. package/dist/examples/html-script/initiate-checkout/README.md +38 -0
  45. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +485 -0
  46. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +491 -0
  47. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +493 -0
  48. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +494 -0
  49. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +497 -0
  50. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +502 -0
  51. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +496 -0
  52. package/dist/examples/html-script/lead/README.md +25 -0
  53. package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +594 -0
  54. package/dist/examples/html-script/lead/example-lead-trigger-auto.html +431 -0
  55. package/dist/examples/html-script/lead/example-lead-trigger-click.html +587 -0
  56. package/dist/examples/html-script/release-candidate.html +726 -0
  57. package/dist/examples/html-script/remove-from-cart/README.md +36 -0
  58. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +532 -0
  59. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +524 -0
  60. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +540 -0
  61. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +533 -0
  62. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +557 -0
  63. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +539 -0
  64. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +524 -0
  65. package/dist/examples/html-script/search/README.md +41 -0
  66. package/dist/examples/html-script/search/example-search-attribute.html +454 -0
  67. package/dist/examples/html-script/search/example-search-button-sync.html +455 -0
  68. package/dist/examples/html-script/search/example-search-dedupe.html +466 -0
  69. package/dist/examples/html-script/search/example-search-input.html +456 -0
  70. package/dist/examples/html-script/search/example-search-manual.html +473 -0
  71. package/dist/examples/html-script/search/example-search-submit.html +450 -0
  72. package/dist/examples/html-script/search/example-search-text.html +441 -0
  73. package/dist/examples/html-script/view-content/README.md +48 -0
  74. package/dist/examples/html-script/view-content/example-view-content-attribute.html +488 -0
  75. package/dist/examples/html-script/view-content/example-view-content-css.html +467 -0
  76. package/dist/examples/html-script/view-content/example-view-content-dedupe.html +485 -0
  77. package/dist/examples/html-script/view-content/example-view-content-empty.html +469 -0
  78. package/dist/examples/html-script/view-content/example-view-content-manual.html +496 -0
  79. package/dist/examples/html-script/view-content/example-view-content-product-card.html +478 -0
  80. package/dist/examples/html-script/view-content/example-view-content-text.html +473 -0
  81. package/dist/examples/release-candidate/README.md +14 -0
  82. package/dist/examples/v2/README.md +33 -0
  83. package/dist/index-DUfFzniE.d.mts +274 -0
  84. package/dist/index-DUfFzniE.d.ts +274 -0
  85. package/dist/index.cjs.js +3 -0
  86. package/dist/index.cjs.js.map +1 -0
  87. package/dist/index.d.mts +364 -0
  88. package/dist/index.d.ts +364 -0
  89. package/dist/index.esm.js +3 -0
  90. package/dist/index.esm.js.map +1 -0
  91. package/dist/logger/index.cjs.js +3 -0
  92. package/dist/logger/index.cjs.js.map +1 -0
  93. package/dist/logger/index.d.mts +12 -0
  94. package/dist/logger/index.d.ts +12 -0
  95. package/dist/logger/index.esm.js +3 -0
  96. package/dist/logger/index.esm.js.map +1 -0
  97. package/dist/pixel-CbeF25mD.d.mts +555 -0
  98. package/dist/pixel-CbeF25mD.d.ts +555 -0
  99. package/dist/pixel-default-config-1VgLFOiL.d.mts +5 -0
  100. package/dist/pixel-default-config-Bxb-Vdd8.d.ts +5 -0
  101. package/dist/runtime/index.cjs.js +3 -0
  102. package/dist/runtime/index.cjs.js.map +1 -0
  103. package/dist/runtime/index.d.mts +48 -0
  104. package/dist/runtime/index.d.ts +48 -0
  105. package/dist/runtime/index.esm.js +3 -0
  106. package/dist/runtime/index.esm.js.map +1 -0
  107. package/dist/services/index.cjs.js +3 -0
  108. package/dist/services/index.cjs.js.map +1 -0
  109. package/dist/services/index.d.mts +169 -0
  110. package/dist/services/index.d.ts +169 -0
  111. package/dist/services/index.esm.js +3 -0
  112. package/dist/services/index.esm.js.map +1 -0
  113. package/dist/types-CTpRvFKZ.d.ts +71 -0
  114. package/dist/types-DGlBdsAy.d.mts +71 -0
  115. package/dist/v2/global.global.js +3 -0
  116. package/dist/v2/global.global.js.map +1 -0
  117. package/dist/v2/index.cjs.js +3 -0
  118. package/dist/v2/index.cjs.js.map +1 -0
  119. package/dist/v2/index.d.mts +7 -0
  120. package/dist/v2/index.d.ts +7 -0
  121. package/dist/v2/index.esm.js +3 -0
  122. package/dist/v2/index.esm.js.map +1 -0
  123. package/package.json +101 -0
@@ -0,0 +1,274 @@
1
+ type AttributionIdentifiers = {
2
+ readonly fbclid?: string;
3
+ readonly fbp?: string;
4
+ readonly fbc?: string;
5
+ readonly gclid?: string;
6
+ readonly gbraid?: string;
7
+ readonly wbraid?: string;
8
+ readonly ga?: string;
9
+ readonly gid?: string;
10
+ readonly gclAu?: string;
11
+ readonly ttclid?: string;
12
+ readonly ttp?: string;
13
+ readonly msclkid?: string;
14
+ readonly liFatId?: string;
15
+ readonly epik?: string;
16
+ readonly customClickIds?: Readonly<Record<string, string>>;
17
+ readonly firstCollectedAt?: number;
18
+ readonly lastCollectedAt?: number;
19
+ readonly landingUrl?: string;
20
+ readonly referrer?: string;
21
+ };
22
+ type AttributionConfig = {
23
+ readonly enabled: boolean;
24
+ readonly ttlDays?: number;
25
+ readonly persist?: boolean;
26
+ readonly captureUrlParams?: boolean;
27
+ readonly captureCookies?: boolean;
28
+ readonly customClickIdParams?: string[];
29
+ };
30
+ declare const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig;
31
+ declare const ATTRIBUTION_STORAGE_KEY = "attribution";
32
+ interface AttributionService {
33
+ init(): void;
34
+ destroy(): void;
35
+ collect(): AttributionIdentifiers;
36
+ getSnapshot(): AttributionIdentifiers;
37
+ update(partial: Partial<AttributionIdentifiers>): AttributionIdentifiers;
38
+ clear(): void;
39
+ }
40
+
41
+ interface BasePixelEvent {
42
+ readonly type: string;
43
+ readonly timestamp: number;
44
+ readonly path?: string;
45
+ readonly url?: string;
46
+ readonly hostname?: string;
47
+ readonly language?: string;
48
+ readonly timezone?: string;
49
+ /** Attribution click IDs / cookies — anexados pelo BaseEventBuilder. */
50
+ readonly identifiers?: AttributionIdentifiers;
51
+ }
52
+
53
+ interface PageViewEvent extends BasePixelEvent {
54
+ readonly type: 'PAGE_VIEW';
55
+ }
56
+
57
+ type PixelEventCategory = 'ENGAGEMENT' | 'CONVERSION' | 'IDENTITY' | 'SESSION' | 'SYSTEM' | 'INTEGRATION';
58
+ type EngagementEventCategory = 'ENGAGEMENT';
59
+ type ConversionEventCategory = 'CONVERSION';
60
+
61
+ interface ScrollEvent extends BasePixelEvent {
62
+ readonly type: 'SCROLL';
63
+ readonly category: EngagementEventCategory;
64
+ readonly maxScrollPercent: number;
65
+ readonly scrollEvents: number;
66
+ readonly scrollVelocityAvg?: number;
67
+ readonly lastScrollAt?: number;
68
+ }
69
+
70
+ interface ElementDescriptor {
71
+ readonly tagName?: string;
72
+ readonly id?: string;
73
+ readonly classes?: string[];
74
+ readonly text?: string;
75
+ readonly role?: string;
76
+ readonly name?: string;
77
+ readonly dataset?: Record<string, string>;
78
+ }
79
+
80
+ interface PageClickEvent extends BasePixelEvent {
81
+ readonly type: 'PAGE_CLICK';
82
+ readonly category: EngagementEventCategory;
83
+ readonly clickCount: number;
84
+ readonly lastClickAt: number;
85
+ readonly rageClickCount?: number;
86
+ readonly target?: ElementDescriptor;
87
+ readonly currentTarget?: ElementDescriptor;
88
+ readonly clientX?: number;
89
+ readonly clientY?: number;
90
+ readonly pageX?: number;
91
+ readonly pageY?: number;
92
+ readonly offsetX?: number;
93
+ readonly offsetY?: number;
94
+ }
95
+
96
+ interface RageClickEvent extends BasePixelEvent {
97
+ readonly type: 'RAGE_CLICK';
98
+ readonly category: EngagementEventCategory;
99
+ readonly threshold: number;
100
+ readonly windowMs: number;
101
+ readonly clickCount: number;
102
+ readonly target?: ElementDescriptor;
103
+ }
104
+
105
+ interface VisibilityChangeEvent extends BasePixelEvent {
106
+ readonly type: 'VISIBILITY_CHANGE';
107
+ readonly category: EngagementEventCategory;
108
+ readonly isVisible: boolean;
109
+ readonly visibleSince?: number;
110
+ readonly hiddenAt?: number | null;
111
+ }
112
+
113
+ interface UserIdleEvent extends BasePixelEvent {
114
+ readonly type: 'USER_IDLE';
115
+ readonly category: EngagementEventCategory;
116
+ readonly idleSince: number;
117
+ readonly thresholdMs: number;
118
+ }
119
+
120
+ interface UserActiveEvent extends BasePixelEvent {
121
+ readonly type: 'USER_ACTIVE';
122
+ readonly category: EngagementEventCategory;
123
+ readonly activeAt: number;
124
+ readonly previousIdleDurationMs?: number;
125
+ }
126
+
127
+ interface ExitIntentEvent extends BasePixelEvent {
128
+ readonly type: 'EXIT_INTENT';
129
+ readonly category: EngagementEventCategory;
130
+ readonly triggeredAt: number;
131
+ readonly clientY?: number;
132
+ }
133
+
134
+ interface SessionRenewedEvent extends BasePixelEvent {
135
+ readonly type: 'SESSION_RENEWED';
136
+ readonly sessionId: string;
137
+ readonly previousSessionId?: string;
138
+ }
139
+
140
+ interface SessionExpiredEvent extends BasePixelEvent {
141
+ readonly type: 'SESSION_EXPIRED';
142
+ readonly sessionId: string;
143
+ }
144
+
145
+ interface PixelItem {
146
+ readonly id?: string;
147
+ readonly name?: string;
148
+ readonly category?: string;
149
+ readonly price?: number;
150
+ readonly quantity?: number;
151
+ }
152
+ interface PurchaseData {
153
+ readonly value?: number;
154
+ readonly currency?: string;
155
+ readonly orderId?: string;
156
+ readonly items?: PixelItem[];
157
+ }
158
+ interface LeadData {
159
+ readonly email?: string;
160
+ readonly phone?: string;
161
+ readonly name?: string;
162
+ readonly fields?: Record<string, unknown>;
163
+ }
164
+ interface AddToCartData {
165
+ readonly productId?: string;
166
+ readonly productName?: string;
167
+ readonly price?: number;
168
+ readonly currency?: string;
169
+ readonly quantity?: number;
170
+ }
171
+ interface RemoveFromCartData {
172
+ readonly productId?: string;
173
+ readonly quantity?: number;
174
+ }
175
+ interface InitiateCheckoutData {
176
+ readonly value?: number;
177
+ readonly currency?: string;
178
+ readonly items?: PixelItem[];
179
+ }
180
+ type PaymentMethod = 'CREDIT_CARD' | 'PIX' | 'BOLETO' | 'PAYPAL' | 'OTHER';
181
+ interface AddPaymentInfoData {
182
+ readonly paymentMethod?: PaymentMethod;
183
+ }
184
+ interface ViewContentData {
185
+ readonly contentId?: string;
186
+ readonly contentType?: string;
187
+ readonly category?: string;
188
+ readonly value?: number;
189
+ readonly currency?: string;
190
+ }
191
+ interface SearchData {
192
+ readonly query: string;
193
+ }
194
+ type ConversionEventData = PurchaseData | LeadData | AddToCartData | RemoveFromCartData | InitiateCheckoutData | AddPaymentInfoData | ViewContentData | SearchData;
195
+
196
+ interface PurchaseEvent extends BasePixelEvent {
197
+ readonly type: 'PURCHASE';
198
+ readonly category: ConversionEventCategory;
199
+ readonly data: PurchaseData;
200
+ }
201
+
202
+ interface LeadEvent extends BasePixelEvent {
203
+ readonly type: 'LEAD';
204
+ readonly category: ConversionEventCategory;
205
+ readonly data: LeadData;
206
+ }
207
+
208
+ interface AddToCartEvent extends BasePixelEvent {
209
+ readonly type: 'ADD_TO_CART';
210
+ readonly category: ConversionEventCategory;
211
+ readonly data: AddToCartData;
212
+ }
213
+
214
+ interface RemoveFromCartEvent extends BasePixelEvent {
215
+ readonly type: 'REMOVE_FROM_CART';
216
+ readonly category: ConversionEventCategory;
217
+ readonly data: RemoveFromCartData;
218
+ }
219
+
220
+ interface InitiateCheckoutEvent extends BasePixelEvent {
221
+ readonly type: 'INITIATE_CHECKOUT';
222
+ readonly category: ConversionEventCategory;
223
+ readonly data: InitiateCheckoutData;
224
+ }
225
+
226
+ interface AddPaymentInfoEvent extends BasePixelEvent {
227
+ readonly type: 'ADD_PAYMENT_INFO';
228
+ readonly category: ConversionEventCategory;
229
+ readonly data: AddPaymentInfoData;
230
+ }
231
+
232
+ interface ViewContentEvent extends BasePixelEvent {
233
+ readonly type: 'VIEW_CONTENT';
234
+ readonly category: ConversionEventCategory;
235
+ readonly data: ViewContentData;
236
+ }
237
+
238
+ interface SearchEvent extends BasePixelEvent {
239
+ readonly type: 'SEARCH';
240
+ readonly category: ConversionEventCategory;
241
+ readonly data: SearchData;
242
+ }
243
+
244
+ type PixelEvent = PageViewEvent | SessionRenewedEvent | SessionExpiredEvent | ScrollEvent | PageClickEvent | RageClickEvent | VisibilityChangeEvent | UserIdleEvent | UserActiveEvent | ExitIntentEvent | PurchaseEvent | LeadEvent | AddToCartEvent | RemoveFromCartEvent | InitiateCheckoutEvent | AddPaymentInfoEvent | ViewContentEvent | SearchEvent;
245
+
246
+ interface BrowserMetadata {
247
+ readonly url?: string;
248
+ readonly path?: string;
249
+ readonly hostname?: string;
250
+ readonly origin?: string;
251
+ readonly title?: string;
252
+ readonly referrer?: string;
253
+ readonly language?: string;
254
+ readonly timezone?: string;
255
+ readonly userAgent?: string;
256
+ readonly platform?: string;
257
+ readonly screenWidth?: number;
258
+ readonly screenHeight?: number;
259
+ readonly colorDepth?: number;
260
+ }
261
+ interface BrowserMetadataService {
262
+ getMetadata(): BrowserMetadata;
263
+ }
264
+
265
+ declare class BaseEventBuilder {
266
+ private readonly metadataService;
267
+ private readonly attribution;
268
+ constructor(metadataService: BrowserMetadataService, attribution?: AttributionService | null);
269
+ build<T extends {
270
+ type: string;
271
+ }>(event: T): T & BasePixelEvent;
272
+ }
273
+
274
+ export { type AttributionService as A, type BrowserMetadataService as B, type ConversionEventData as C, DEFAULT_ATTRIBUTION_CONFIG as D, type ExitIntentEvent as E, type PixelEventCategory as F, type EngagementEventCategory as G, type ConversionEventCategory as H, type InitiateCheckoutData as I, type ElementDescriptor as J, type LeadData as L, type PixelEvent as P, type RemoveFromCartData as R, type SessionRenewedEvent as S, type UserIdleEvent as U, type ViewContentData as V, BaseEventBuilder as a, type AttributionConfig as b, type AttributionIdentifiers as c, type BrowserMetadata as d, type BasePixelEvent as e, type PageViewEvent as f, type SessionExpiredEvent as g, ATTRIBUTION_STORAGE_KEY as h, type PurchaseData as i, type AddToCartData as j, type AddPaymentInfoData as k, type SearchData as l, type ScrollEvent as m, type PageClickEvent as n, type RageClickEvent as o, type VisibilityChangeEvent as p, type UserActiveEvent as q, type PurchaseEvent as r, type LeadEvent as s, type AddToCartEvent as t, type RemoveFromCartEvent as u, type InitiateCheckoutEvent as v, type AddPaymentInfoEvent as w, type ViewContentEvent as x, type SearchEvent as y, type PixelItem as z };
@@ -0,0 +1,274 @@
1
+ type AttributionIdentifiers = {
2
+ readonly fbclid?: string;
3
+ readonly fbp?: string;
4
+ readonly fbc?: string;
5
+ readonly gclid?: string;
6
+ readonly gbraid?: string;
7
+ readonly wbraid?: string;
8
+ readonly ga?: string;
9
+ readonly gid?: string;
10
+ readonly gclAu?: string;
11
+ readonly ttclid?: string;
12
+ readonly ttp?: string;
13
+ readonly msclkid?: string;
14
+ readonly liFatId?: string;
15
+ readonly epik?: string;
16
+ readonly customClickIds?: Readonly<Record<string, string>>;
17
+ readonly firstCollectedAt?: number;
18
+ readonly lastCollectedAt?: number;
19
+ readonly landingUrl?: string;
20
+ readonly referrer?: string;
21
+ };
22
+ type AttributionConfig = {
23
+ readonly enabled: boolean;
24
+ readonly ttlDays?: number;
25
+ readonly persist?: boolean;
26
+ readonly captureUrlParams?: boolean;
27
+ readonly captureCookies?: boolean;
28
+ readonly customClickIdParams?: string[];
29
+ };
30
+ declare const DEFAULT_ATTRIBUTION_CONFIG: AttributionConfig;
31
+ declare const ATTRIBUTION_STORAGE_KEY = "attribution";
32
+ interface AttributionService {
33
+ init(): void;
34
+ destroy(): void;
35
+ collect(): AttributionIdentifiers;
36
+ getSnapshot(): AttributionIdentifiers;
37
+ update(partial: Partial<AttributionIdentifiers>): AttributionIdentifiers;
38
+ clear(): void;
39
+ }
40
+
41
+ interface BasePixelEvent {
42
+ readonly type: string;
43
+ readonly timestamp: number;
44
+ readonly path?: string;
45
+ readonly url?: string;
46
+ readonly hostname?: string;
47
+ readonly language?: string;
48
+ readonly timezone?: string;
49
+ /** Attribution click IDs / cookies — anexados pelo BaseEventBuilder. */
50
+ readonly identifiers?: AttributionIdentifiers;
51
+ }
52
+
53
+ interface PageViewEvent extends BasePixelEvent {
54
+ readonly type: 'PAGE_VIEW';
55
+ }
56
+
57
+ type PixelEventCategory = 'ENGAGEMENT' | 'CONVERSION' | 'IDENTITY' | 'SESSION' | 'SYSTEM' | 'INTEGRATION';
58
+ type EngagementEventCategory = 'ENGAGEMENT';
59
+ type ConversionEventCategory = 'CONVERSION';
60
+
61
+ interface ScrollEvent extends BasePixelEvent {
62
+ readonly type: 'SCROLL';
63
+ readonly category: EngagementEventCategory;
64
+ readonly maxScrollPercent: number;
65
+ readonly scrollEvents: number;
66
+ readonly scrollVelocityAvg?: number;
67
+ readonly lastScrollAt?: number;
68
+ }
69
+
70
+ interface ElementDescriptor {
71
+ readonly tagName?: string;
72
+ readonly id?: string;
73
+ readonly classes?: string[];
74
+ readonly text?: string;
75
+ readonly role?: string;
76
+ readonly name?: string;
77
+ readonly dataset?: Record<string, string>;
78
+ }
79
+
80
+ interface PageClickEvent extends BasePixelEvent {
81
+ readonly type: 'PAGE_CLICK';
82
+ readonly category: EngagementEventCategory;
83
+ readonly clickCount: number;
84
+ readonly lastClickAt: number;
85
+ readonly rageClickCount?: number;
86
+ readonly target?: ElementDescriptor;
87
+ readonly currentTarget?: ElementDescriptor;
88
+ readonly clientX?: number;
89
+ readonly clientY?: number;
90
+ readonly pageX?: number;
91
+ readonly pageY?: number;
92
+ readonly offsetX?: number;
93
+ readonly offsetY?: number;
94
+ }
95
+
96
+ interface RageClickEvent extends BasePixelEvent {
97
+ readonly type: 'RAGE_CLICK';
98
+ readonly category: EngagementEventCategory;
99
+ readonly threshold: number;
100
+ readonly windowMs: number;
101
+ readonly clickCount: number;
102
+ readonly target?: ElementDescriptor;
103
+ }
104
+
105
+ interface VisibilityChangeEvent extends BasePixelEvent {
106
+ readonly type: 'VISIBILITY_CHANGE';
107
+ readonly category: EngagementEventCategory;
108
+ readonly isVisible: boolean;
109
+ readonly visibleSince?: number;
110
+ readonly hiddenAt?: number | null;
111
+ }
112
+
113
+ interface UserIdleEvent extends BasePixelEvent {
114
+ readonly type: 'USER_IDLE';
115
+ readonly category: EngagementEventCategory;
116
+ readonly idleSince: number;
117
+ readonly thresholdMs: number;
118
+ }
119
+
120
+ interface UserActiveEvent extends BasePixelEvent {
121
+ readonly type: 'USER_ACTIVE';
122
+ readonly category: EngagementEventCategory;
123
+ readonly activeAt: number;
124
+ readonly previousIdleDurationMs?: number;
125
+ }
126
+
127
+ interface ExitIntentEvent extends BasePixelEvent {
128
+ readonly type: 'EXIT_INTENT';
129
+ readonly category: EngagementEventCategory;
130
+ readonly triggeredAt: number;
131
+ readonly clientY?: number;
132
+ }
133
+
134
+ interface SessionRenewedEvent extends BasePixelEvent {
135
+ readonly type: 'SESSION_RENEWED';
136
+ readonly sessionId: string;
137
+ readonly previousSessionId?: string;
138
+ }
139
+
140
+ interface SessionExpiredEvent extends BasePixelEvent {
141
+ readonly type: 'SESSION_EXPIRED';
142
+ readonly sessionId: string;
143
+ }
144
+
145
+ interface PixelItem {
146
+ readonly id?: string;
147
+ readonly name?: string;
148
+ readonly category?: string;
149
+ readonly price?: number;
150
+ readonly quantity?: number;
151
+ }
152
+ interface PurchaseData {
153
+ readonly value?: number;
154
+ readonly currency?: string;
155
+ readonly orderId?: string;
156
+ readonly items?: PixelItem[];
157
+ }
158
+ interface LeadData {
159
+ readonly email?: string;
160
+ readonly phone?: string;
161
+ readonly name?: string;
162
+ readonly fields?: Record<string, unknown>;
163
+ }
164
+ interface AddToCartData {
165
+ readonly productId?: string;
166
+ readonly productName?: string;
167
+ readonly price?: number;
168
+ readonly currency?: string;
169
+ readonly quantity?: number;
170
+ }
171
+ interface RemoveFromCartData {
172
+ readonly productId?: string;
173
+ readonly quantity?: number;
174
+ }
175
+ interface InitiateCheckoutData {
176
+ readonly value?: number;
177
+ readonly currency?: string;
178
+ readonly items?: PixelItem[];
179
+ }
180
+ type PaymentMethod = 'CREDIT_CARD' | 'PIX' | 'BOLETO' | 'PAYPAL' | 'OTHER';
181
+ interface AddPaymentInfoData {
182
+ readonly paymentMethod?: PaymentMethod;
183
+ }
184
+ interface ViewContentData {
185
+ readonly contentId?: string;
186
+ readonly contentType?: string;
187
+ readonly category?: string;
188
+ readonly value?: number;
189
+ readonly currency?: string;
190
+ }
191
+ interface SearchData {
192
+ readonly query: string;
193
+ }
194
+ type ConversionEventData = PurchaseData | LeadData | AddToCartData | RemoveFromCartData | InitiateCheckoutData | AddPaymentInfoData | ViewContentData | SearchData;
195
+
196
+ interface PurchaseEvent extends BasePixelEvent {
197
+ readonly type: 'PURCHASE';
198
+ readonly category: ConversionEventCategory;
199
+ readonly data: PurchaseData;
200
+ }
201
+
202
+ interface LeadEvent extends BasePixelEvent {
203
+ readonly type: 'LEAD';
204
+ readonly category: ConversionEventCategory;
205
+ readonly data: LeadData;
206
+ }
207
+
208
+ interface AddToCartEvent extends BasePixelEvent {
209
+ readonly type: 'ADD_TO_CART';
210
+ readonly category: ConversionEventCategory;
211
+ readonly data: AddToCartData;
212
+ }
213
+
214
+ interface RemoveFromCartEvent extends BasePixelEvent {
215
+ readonly type: 'REMOVE_FROM_CART';
216
+ readonly category: ConversionEventCategory;
217
+ readonly data: RemoveFromCartData;
218
+ }
219
+
220
+ interface InitiateCheckoutEvent extends BasePixelEvent {
221
+ readonly type: 'INITIATE_CHECKOUT';
222
+ readonly category: ConversionEventCategory;
223
+ readonly data: InitiateCheckoutData;
224
+ }
225
+
226
+ interface AddPaymentInfoEvent extends BasePixelEvent {
227
+ readonly type: 'ADD_PAYMENT_INFO';
228
+ readonly category: ConversionEventCategory;
229
+ readonly data: AddPaymentInfoData;
230
+ }
231
+
232
+ interface ViewContentEvent extends BasePixelEvent {
233
+ readonly type: 'VIEW_CONTENT';
234
+ readonly category: ConversionEventCategory;
235
+ readonly data: ViewContentData;
236
+ }
237
+
238
+ interface SearchEvent extends BasePixelEvent {
239
+ readonly type: 'SEARCH';
240
+ readonly category: ConversionEventCategory;
241
+ readonly data: SearchData;
242
+ }
243
+
244
+ type PixelEvent = PageViewEvent | SessionRenewedEvent | SessionExpiredEvent | ScrollEvent | PageClickEvent | RageClickEvent | VisibilityChangeEvent | UserIdleEvent | UserActiveEvent | ExitIntentEvent | PurchaseEvent | LeadEvent | AddToCartEvent | RemoveFromCartEvent | InitiateCheckoutEvent | AddPaymentInfoEvent | ViewContentEvent | SearchEvent;
245
+
246
+ interface BrowserMetadata {
247
+ readonly url?: string;
248
+ readonly path?: string;
249
+ readonly hostname?: string;
250
+ readonly origin?: string;
251
+ readonly title?: string;
252
+ readonly referrer?: string;
253
+ readonly language?: string;
254
+ readonly timezone?: string;
255
+ readonly userAgent?: string;
256
+ readonly platform?: string;
257
+ readonly screenWidth?: number;
258
+ readonly screenHeight?: number;
259
+ readonly colorDepth?: number;
260
+ }
261
+ interface BrowserMetadataService {
262
+ getMetadata(): BrowserMetadata;
263
+ }
264
+
265
+ declare class BaseEventBuilder {
266
+ private readonly metadataService;
267
+ private readonly attribution;
268
+ constructor(metadataService: BrowserMetadataService, attribution?: AttributionService | null);
269
+ build<T extends {
270
+ type: string;
271
+ }>(event: T): T & BasePixelEvent;
272
+ }
273
+
274
+ export { type AttributionService as A, type BrowserMetadataService as B, type ConversionEventData as C, DEFAULT_ATTRIBUTION_CONFIG as D, type ExitIntentEvent as E, type PixelEventCategory as F, type EngagementEventCategory as G, type ConversionEventCategory as H, type InitiateCheckoutData as I, type ElementDescriptor as J, type LeadData as L, type PixelEvent as P, type RemoveFromCartData as R, type SessionRenewedEvent as S, type UserIdleEvent as U, type ViewContentData as V, BaseEventBuilder as a, type AttributionConfig as b, type AttributionIdentifiers as c, type BrowserMetadata as d, type BasePixelEvent as e, type PageViewEvent as f, type SessionExpiredEvent as g, ATTRIBUTION_STORAGE_KEY as h, type PurchaseData as i, type AddToCartData as j, type AddPaymentInfoData as k, type SearchData as l, type ScrollEvent as m, type PageClickEvent as n, type RageClickEvent as o, type VisibilityChangeEvent as p, type UserActiveEvent as q, type PurchaseEvent as r, type LeadEvent as s, type AddToCartEvent as t, type RemoveFromCartEvent as u, type InitiateCheckoutEvent as v, type AddPaymentInfoEvent as w, type ViewContentEvent as x, type SearchEvent as y, type PixelItem as z };