@snowplow/react-native-tracker 4.0.2-dev.0 → 4.1.1-dev.0

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 (133) hide show
  1. package/README.md +38 -30
  2. package/dist/commonjs/constants.js +20 -0
  3. package/dist/commonjs/constants.js.map +1 -0
  4. package/dist/commonjs/event_store.js +150 -0
  5. package/dist/commonjs/event_store.js.map +1 -0
  6. package/dist/commonjs/events.js +42 -0
  7. package/dist/commonjs/events.js.map +1 -0
  8. package/dist/commonjs/index.js +29 -0
  9. package/dist/commonjs/index.js.map +1 -0
  10. package/dist/commonjs/plugins/app_context/index.js +47 -0
  11. package/dist/commonjs/plugins/app_context/index.js.map +1 -0
  12. package/dist/commonjs/plugins/app_install/index.js +60 -0
  13. package/dist/commonjs/plugins/app_install/index.js.map +1 -0
  14. package/dist/commonjs/plugins/app_lifecycle/index.js +126 -0
  15. package/dist/commonjs/plugins/app_lifecycle/index.js.map +1 -0
  16. package/dist/commonjs/plugins/deep_links/index.js +64 -0
  17. package/dist/commonjs/plugins/deep_links/index.js.map +1 -0
  18. package/dist/commonjs/plugins/platform_context/index.js +749 -0
  19. package/dist/commonjs/plugins/platform_context/index.js.map +1 -0
  20. package/dist/commonjs/plugins/session/index.js +197 -0
  21. package/dist/commonjs/plugins/session/index.js.map +1 -0
  22. package/dist/commonjs/plugins.js +147 -0
  23. package/dist/commonjs/plugins.js.map +1 -0
  24. package/dist/commonjs/subject.js +82 -0
  25. package/dist/commonjs/subject.js.map +1 -0
  26. package/dist/commonjs/tracker.js +188 -0
  27. package/dist/commonjs/tracker.js.map +1 -0
  28. package/dist/commonjs/types.js +313 -0
  29. package/dist/commonjs/types.js.map +1 -0
  30. package/dist/commonjs/utils.js +35 -0
  31. package/dist/commonjs/utils.js.map +1 -0
  32. package/dist/module/constants.js +16 -0
  33. package/dist/module/constants.js.map +1 -0
  34. package/dist/module/event_store.js +145 -0
  35. package/dist/module/event_store.js.map +1 -0
  36. package/dist/module/events.js +38 -0
  37. package/dist/module/events.js.map +1 -0
  38. package/dist/module/index.js +7 -0
  39. package/dist/module/index.js.map +1 -0
  40. package/dist/module/plugins/app_context/index.js +44 -0
  41. package/dist/module/plugins/app_context/index.js.map +1 -0
  42. package/dist/module/plugins/app_install/index.js +56 -0
  43. package/dist/module/plugins/app_install/index.js.map +1 -0
  44. package/dist/module/plugins/app_lifecycle/index.js +122 -0
  45. package/dist/module/plugins/app_lifecycle/index.js.map +1 -0
  46. package/dist/module/plugins/deep_links/index.js +60 -0
  47. package/dist/module/plugins/deep_links/index.js.map +1 -0
  48. package/dist/module/plugins/platform_context/index.js +745 -0
  49. package/dist/module/plugins/platform_context/index.js.map +1 -0
  50. package/dist/module/plugins/session/index.js +192 -0
  51. package/dist/module/plugins/session/index.js.map +1 -0
  52. package/dist/module/plugins.js +143 -0
  53. package/dist/module/plugins.js.map +1 -0
  54. package/dist/module/subject.js +78 -0
  55. package/dist/module/subject.js.map +1 -0
  56. package/dist/module/tracker.js +183 -0
  57. package/dist/module/tracker.js.map +1 -0
  58. package/dist/module/types.js +113 -0
  59. package/dist/module/types.js.map +1 -0
  60. package/dist/module/utils.js +31 -0
  61. package/dist/module/utils.js.map +1 -0
  62. package/dist/typescript/commonjs/package.json +1 -0
  63. package/dist/typescript/commonjs/src/constants.d.ts +14 -0
  64. package/dist/typescript/commonjs/src/constants.d.ts.map +1 -0
  65. package/dist/typescript/commonjs/src/event_store.d.ts +4 -0
  66. package/dist/typescript/commonjs/src/event_store.d.ts.map +1 -0
  67. package/dist/typescript/commonjs/src/events.d.ts +10 -0
  68. package/dist/typescript/commonjs/src/events.d.ts.map +1 -0
  69. package/dist/typescript/commonjs/src/index.d.ts +4 -0
  70. package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
  71. package/dist/typescript/commonjs/src/plugins/app_context/index.d.ts +11 -0
  72. package/dist/typescript/commonjs/src/plugins/app_context/index.d.ts.map +1 -0
  73. package/dist/typescript/commonjs/src/plugins/app_install/index.d.ts +10 -0
  74. package/dist/typescript/commonjs/src/plugins/app_install/index.d.ts.map +1 -0
  75. package/dist/typescript/commonjs/src/plugins/app_lifecycle/index.d.ts +13 -0
  76. package/dist/typescript/commonjs/src/plugins/app_lifecycle/index.d.ts.map +1 -0
  77. package/dist/typescript/commonjs/src/plugins/deep_links/index.d.ts +8 -0
  78. package/dist/typescript/commonjs/src/plugins/deep_links/index.d.ts.map +1 -0
  79. package/dist/typescript/commonjs/src/plugins/platform_context/index.d.ts +12 -0
  80. package/dist/typescript/commonjs/src/plugins/platform_context/index.d.ts.map +1 -0
  81. package/dist/typescript/commonjs/src/plugins/session/index.d.ts +19 -0
  82. package/dist/typescript/commonjs/src/plugins/session/index.d.ts.map +1 -0
  83. package/dist/typescript/commonjs/src/plugins.d.ts +6 -0
  84. package/dist/typescript/commonjs/src/plugins.d.ts.map +1 -0
  85. package/dist/typescript/commonjs/src/subject.d.ts +19 -0
  86. package/dist/typescript/commonjs/src/subject.d.ts.map +1 -0
  87. package/dist/typescript/commonjs/src/tracker.d.ts +28 -0
  88. package/dist/typescript/commonjs/src/tracker.d.ts.map +1 -0
  89. package/dist/typescript/commonjs/src/types.d.ts +784 -0
  90. package/dist/typescript/commonjs/src/types.d.ts.map +1 -0
  91. package/dist/typescript/commonjs/src/utils.d.ts +3 -0
  92. package/dist/typescript/commonjs/src/utils.d.ts.map +1 -0
  93. package/dist/typescript/module/package.json +1 -0
  94. package/dist/typescript/module/src/constants.d.ts +14 -0
  95. package/dist/typescript/module/src/constants.d.ts.map +1 -0
  96. package/dist/typescript/module/src/event_store.d.ts +4 -0
  97. package/dist/typescript/module/src/event_store.d.ts.map +1 -0
  98. package/dist/typescript/module/src/events.d.ts +10 -0
  99. package/dist/typescript/module/src/events.d.ts.map +1 -0
  100. package/dist/typescript/module/src/index.d.ts +4 -0
  101. package/dist/typescript/module/src/index.d.ts.map +1 -0
  102. package/dist/typescript/module/src/plugins/app_context/index.d.ts +11 -0
  103. package/dist/typescript/module/src/plugins/app_context/index.d.ts.map +1 -0
  104. package/dist/typescript/module/src/plugins/app_install/index.d.ts +10 -0
  105. package/dist/typescript/module/src/plugins/app_install/index.d.ts.map +1 -0
  106. package/dist/typescript/module/src/plugins/app_lifecycle/index.d.ts +13 -0
  107. package/dist/typescript/module/src/plugins/app_lifecycle/index.d.ts.map +1 -0
  108. package/dist/typescript/module/src/plugins/deep_links/index.d.ts +8 -0
  109. package/dist/typescript/module/src/plugins/deep_links/index.d.ts.map +1 -0
  110. package/dist/typescript/module/src/plugins/platform_context/index.d.ts +12 -0
  111. package/dist/typescript/module/src/plugins/platform_context/index.d.ts.map +1 -0
  112. package/dist/typescript/module/src/plugins/session/index.d.ts +19 -0
  113. package/dist/typescript/module/src/plugins/session/index.d.ts.map +1 -0
  114. package/dist/typescript/module/src/plugins.d.ts +6 -0
  115. package/dist/typescript/module/src/plugins.d.ts.map +1 -0
  116. package/dist/typescript/module/src/subject.d.ts +19 -0
  117. package/dist/typescript/module/src/subject.d.ts.map +1 -0
  118. package/dist/typescript/module/src/tracker.d.ts +28 -0
  119. package/dist/typescript/module/src/tracker.d.ts.map +1 -0
  120. package/dist/typescript/module/src/types.d.ts +784 -0
  121. package/dist/typescript/module/src/types.d.ts.map +1 -0
  122. package/dist/typescript/module/src/utils.d.ts +3 -0
  123. package/dist/typescript/module/src/utils.d.ts.map +1 -0
  124. package/package.json +57 -14
  125. package/dist/index.cjs.d.ts +0 -499
  126. package/dist/index.cjs.js +0 -2656
  127. package/dist/index.cjs.js.map +0 -1
  128. package/dist/index.cjs.min.d.ts +0 -499
  129. package/dist/index.cjs.min.js +0 -63
  130. package/dist/index.cjs.min.js.map +0 -1
  131. package/dist/index.module.d.ts +0 -499
  132. package/dist/index.module.js +0 -250
  133. package/dist/index.module.js.map +0 -1
@@ -0,0 +1,784 @@
1
+ import { BrowserPlugin, BrowserPluginConfiguration } from '@snowplow/browser-tracker-core';
2
+ import { ConditionalContextProvider, ContextPrimitive, PageViewEvent, SelfDescribingJson, StructuredEvent } from '@snowplow/tracker-core';
3
+ /**
4
+ * Configuration for the event store
5
+ */
6
+ export interface EventStoreConfiguration {
7
+ /**
8
+ * The maximum amount of events that will be buffered in the event store
9
+ *
10
+ * Will drop events once the limit is hit
11
+ * @defaultValue 1000
12
+ */
13
+ maxEventStoreSize?: number;
14
+ /**
15
+ * Whether to use the AsyncStorage library as the persistent event store for the event store
16
+ * @defaultValue true
17
+ */
18
+ useAsyncStorageForEventStore?: boolean;
19
+ }
20
+ /**
21
+ * Configuration for session tracking
22
+ */
23
+ export interface SessionConfiguration {
24
+ /**
25
+ * The amount of time in seconds before the session id is updated while the app is in the foreground
26
+ * @defaultValue 1800
27
+ */
28
+ foregroundSessionTimeout?: number;
29
+ /**
30
+ * The amount of time in seconds before the session id is updated while the app is in the background
31
+ * @defaultValue 1800
32
+ */
33
+ backgroundSessionTimeout?: number;
34
+ }
35
+ /**
36
+ * Configuration for app lifecycle tracking
37
+ */
38
+ export interface AppLifecycleConfiguration {
39
+ /**
40
+ * Whether to automatically track app lifecycle events (app foreground and background events).
41
+ * Also adds a lifecycle context entity to all events.
42
+ *
43
+ * Foreground event schema: `iglu:com.snowplowanalytics.snowplow/application_foreground/jsonschema/1-0-0`
44
+ * Background event schema: `iglu:com.snowplowanalytics.snowplow/application_background/jsonschema/1-0-0`
45
+ * Context entity schema: `iglu:com.snowplowanalytics.mobile/application_lifecycle/jsonschema/1-0-0`
46
+ *
47
+ * @defaultValue true
48
+ */
49
+ lifecycleAutotracking?: boolean;
50
+ /**
51
+ * Whether to automatically track app install event on first run.
52
+ *
53
+ * Schema: `iglu:com.snowplowanalytics.mobile/application_install/jsonschema/1-0-0`
54
+ *
55
+ * @defaultValue false
56
+ */
57
+ installAutotracking?: boolean;
58
+ /**
59
+ * Version number of the application e.g 1.1.0 (semver or git commit hash).
60
+ *
61
+ * Entity schema if `appBuild` property is set: `iglu:com.snowplowanalytics.mobile/application/jsonschema/1-0-0`
62
+ * Entity schema if `appBuild` property is not set: `iglu:com.snowplowanalytics.snowplow/application/jsonschema/1-0-0`
63
+ */
64
+ appVersion?: string;
65
+ /**
66
+ * Build name of the application e.g s9f2k2d or 1.1.0 beta
67
+ *
68
+ * Entity schema: `iglu:com.snowplowanalytics.mobile/application/jsonschema/1-0-0`
69
+ */
70
+ appBuild?: string;
71
+ }
72
+ /**
73
+ * The configuration object for initialising the tracker
74
+ */
75
+ export interface TrackerConfiguration {
76
+ /** The namespace of the tracker */
77
+ namespace: string;
78
+ /** The application ID */
79
+ appId?: string;
80
+ /**
81
+ * Whether unstructured events and custom contexts should be base64 encoded.
82
+ * @defaultValue false
83
+ **/
84
+ encodeBase64?: boolean;
85
+ /**
86
+ * Inject plugins which will be evaluated for each event
87
+ * @defaultValue []
88
+ */
89
+ plugins?: BrowserPlugin[];
90
+ }
91
+ export declare enum PlatformContextProperty {
92
+ /**
93
+ * The carrier of the SIM inserted in the device.
94
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
95
+ */
96
+ Carrier = "carrier",
97
+ /**
98
+ * Type of network the device is connected to.
99
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
100
+ */
101
+ NetworkType = "networkType",
102
+ /**
103
+ * Radio access technology that the device is using.
104
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
105
+ */
106
+ NetworkTechnology = "networkTechnology",
107
+ /**
108
+ * Advertising identifier on iOS.
109
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
110
+ */
111
+ AppleIdfa = "appleIdfa",
112
+ /**
113
+ * UUID identifier for vendors on iOS.
114
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
115
+ */
116
+ AppleIdfv = "appleIdfv",
117
+ /**
118
+ * Total physical system memory in bytes.
119
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
120
+ */
121
+ PhysicalMemory = "physicalMemory",
122
+ /**
123
+ * Amount of memory in bytes available to the current app.
124
+ * The property is not tracked in the current version of the tracker due to the tracker not being able to access the API, see the issue here: https://github.com/snowplow/snowplow-ios-tracker/issues/772
125
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
126
+ */
127
+ AppAvailableMemory = "appAvailableMemory",
128
+ /**
129
+ * Remaining battery level as an integer percentage of total battery capacity.
130
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
131
+ */
132
+ BatteryLevel = "batteryLevel",
133
+ /**
134
+ * Battery state for the device.
135
+ * Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
136
+ */
137
+ BatteryState = "batteryState",
138
+ /** A Boolean indicating whether Low Power Mode is enabled. */
139
+ LowPowerMode = "lowPowerMode",
140
+ /**
141
+ * Bytes of storage remaining.
142
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
143
+ */
144
+ AvailableStorage = "availableStorage",
145
+ /**
146
+ * Total size of storage in bytes.
147
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
148
+ */
149
+ TotalStorage = "totalStorage",
150
+ /**
151
+ * A Boolean indicating whether the device orientation is portrait (either upright or upside down).
152
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
153
+ */
154
+ IsPortrait = "isPortrait",
155
+ /**
156
+ * Screen resolution in pixels. Arrives in the form of WIDTHxHEIGHT (e.g., 1200x900). Doesn't change when device orientation changes.
157
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
158
+ */
159
+ Resolution = "resolution",
160
+ /**
161
+ * Scale factor used to convert logical coordinates to device coordinates of the screen (uses UIScreen.scale on iOS).
162
+ */
163
+ Scale = "scale",
164
+ /**
165
+ * System language currently used on the device (ISO 639).
166
+ */
167
+ Language = "language",
168
+ /**
169
+ * Advertising identifier on Android.
170
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
171
+ */
172
+ AndroidIdfa = "androidIdfa",
173
+ /**
174
+ * Available memory on the system in bytes (Android only).
175
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
176
+ */
177
+ SystemAvailableMemory = "systemAvailableMemory",
178
+ /**
179
+ * Android vendor ID scoped to the set of apps published under the same Google Play developer account (see https://developer.android.com/training/articles/app-set-id).
180
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
181
+ */
182
+ AppSetId = "appSetId",
183
+ /**
184
+ * Scope of the `appSetId`. Can be scoped to the app or to a developer account on an app store (all apps from the same developer on the same device will have the same ID).
185
+ * Note: This is not automatically assigned by the tracker as it may be considered as fingerprinting. You can assign it using the PlatformContextRetriever.
186
+ */
187
+ AppSetIdScope = "appSetIdScope"
188
+ }
189
+ /**
190
+ * Overrides for the values for properties of the platform context.
191
+ */
192
+ export interface PlatformContextRetriever {
193
+ /** Operating system type (e.g., ios, tvos, watchos, osx, android) */
194
+ getOsType?: () => Promise<string>;
195
+ /** The current version of the operating system */
196
+ getOsVersion?: () => Promise<string>;
197
+ /** The end-user-visible name for the end product */
198
+ getDeviceModel?: () => Promise<string>;
199
+ /** The manufacturer of the product/hardware */
200
+ getDeviceManufacturer?: () => Promise<string>;
201
+ /** The carrier of the SIM inserted in the device */
202
+ getCarrier?: () => Promise<string | undefined>;
203
+ /** Type of network the device is connected to */
204
+ getNetworkType?: () => Promise<'mobile' | 'wifi' | 'offline' | undefined>;
205
+ /** Radio access technology that the device is using */
206
+ getNetworkTechnology?: () => Promise<string | undefined>;
207
+ /** Advertising identifier on iOS (UUID formatted string) */
208
+ getAppleIdfa?: () => Promise<string | undefined>;
209
+ /** UUID identifier for vendors on iOS */
210
+ getAppleIdfv?: () => Promise<string | undefined>;
211
+ /** Bytes of storage remaining */
212
+ getAvailableStorage?: () => Promise<number | undefined>;
213
+ /** Total size of storage in bytes */
214
+ getTotalStorage?: () => Promise<number | undefined>;
215
+ /** Total physical system memory in bytes */
216
+ getPhysicalMemory?: () => Promise<number | undefined>;
217
+ /** Amount of memory in bytes available to the current app */
218
+ getAppAvailableMemory?: () => Promise<number | undefined>;
219
+ /** Remaining battery level as an integer percentage of total battery capacity */
220
+ getBatteryLevel?: () => Promise<number | undefined>;
221
+ /** Battery state for the device */
222
+ getBatteryState?: () => Promise<'unplugged' | 'charging' | 'full' | undefined>;
223
+ /** A Boolean indicating whether Low Power Mode is enabled */
224
+ getLowPowerMode?: () => Promise<boolean | undefined>;
225
+ /** A Boolean indicating whether the device orientation is portrait (either upright or upside down) */
226
+ isPortrait?: () => Promise<boolean | undefined>;
227
+ /** Screen resolution in pixels. Arrives in the form of WIDTHxHEIGHT (e.g., 1200x900). Doesn't change when device orientation changes */
228
+ getResolution?: () => Promise<string | undefined>;
229
+ /** Scale factor used to convert logical coordinates to device coordinates of the screen (uses UIScreen.scale on iOS) */
230
+ getScale?: () => Promise<number | undefined>;
231
+ /** System language currently used on the device (ISO 639) */
232
+ getLanguage?: () => Promise<string | undefined>;
233
+ /** Advertising identifier on Android. */
234
+ getAndroidIdfa?: () => Promise<string | undefined>;
235
+ /** Available memory on the system in bytes (Android only). */
236
+ getSystemAvailableMemory?: () => Promise<number | undefined>;
237
+ /** Android vendor ID scoped to the set of apps published under the same Google Play developer account (see https://developer.android.com/training/articles/app-set-id). */
238
+ getAppSetId?: () => Promise<string | undefined>;
239
+ /** Scope of the `appSetId`. Can be scoped to the app or to a developer account on an app store (all apps from the same developer on the same device will have the same ID). */
240
+ getAppSetIdScope?: () => Promise<string | undefined>;
241
+ }
242
+ export interface PlatformContextConfiguration {
243
+ /**
244
+ * Whether to track the mobile context with information about the device.
245
+ * Note: Only some properties (osType, osVersion, deviceManufacturer, deviceModel, resolution, language, scale) will be tracked by default. Other properties can be assigned using the PlatformContextRetriever.
246
+ * @defaultValue true
247
+ */
248
+ platformContext?: boolean;
249
+ /**
250
+ * List of properties of the platform context to track. If not passed and `platformContext` is enabled, all available properties will be tracked.
251
+ * The required `osType`, `osVersion`, `deviceManufacturer`, and `deviceModel` properties will be tracked in the entity regardless of this setting.
252
+ */
253
+ platformContextProperties?: PlatformContextProperty[];
254
+ /**
255
+ * Set of callbacks to be used to retrieve properties of the platform context.
256
+ * Overrides the tracker implementation for setting the properties.
257
+ */
258
+ platformContextRetriever?: PlatformContextRetriever;
259
+ }
260
+ /**
261
+ * Configuration for deep link tracking
262
+ */
263
+ export interface DeepLinkConfiguration {
264
+ /**
265
+ * Whether to track the deep link context entity with information from the deep link received event on the first screen view event.
266
+ * @defaultValue true
267
+ */
268
+ deepLinkContext?: boolean;
269
+ }
270
+ /**
271
+ * Configuration of subject properties tracked with events
272
+ */
273
+ export interface SubjectConfiguration {
274
+ /**
275
+ * Business-defined user ID for this user
276
+ */
277
+ userId?: string;
278
+ /**
279
+ * Override the network user id (UUIDv4) that is assigned by the collector and stored in cookies
280
+ */
281
+ networkUserId?: string;
282
+ /**
283
+ * The domain user id (DUID) is a generated identifier that is stored in a first party cookie on Web.
284
+ * The React Native tracker does not assign it automatically.
285
+ */
286
+ domainUserId?: string;
287
+ /**
288
+ * The custom user-agent. It overrides the user-agent used by default.
289
+ */
290
+ useragent?: string;
291
+ /**
292
+ * Override the IP address of the device
293
+ */
294
+ ipAddress?: string;
295
+ /**
296
+ * The timezone label
297
+ */
298
+ timezone?: string;
299
+ /**
300
+ * The language set in the device
301
+ */
302
+ language?: string;
303
+ /**
304
+ * The screen resolution
305
+ */
306
+ screenResolution?: ScreenSize;
307
+ /**
308
+ * The screen viewport size
309
+ */
310
+ screenViewport?: ScreenSize;
311
+ /**
312
+ * Color depth (integer)
313
+ */
314
+ colorDepth?: number;
315
+ }
316
+ /**
317
+ * Screen size in pixels
318
+ */
319
+ export declare type ScreenSize = [number, number];
320
+ /**
321
+ * Trigger for MessageNotification event
322
+ */
323
+ export declare type Trigger = 'push' | 'location' | 'calendar' | 'timeInterval' | 'other';
324
+ /**
325
+ * Attachment object that identify an attachment in the MessageNotification.
326
+ */
327
+ export declare type MessageNotificationAttachmentProps = {
328
+ identifier: string;
329
+ type: string;
330
+ url: string;
331
+ };
332
+ /**
333
+ * MessageNotification event properties
334
+ * schema: iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0
335
+ */
336
+ export declare type MessageNotificationProps = {
337
+ /**
338
+ * The action associated with the notification.
339
+ */
340
+ action?: string;
341
+ attachments?: MessageNotificationAttachmentProps[];
342
+ /**
343
+ * The notification's body.
344
+ */
345
+ body: string;
346
+ bodyLocArgs?: string[];
347
+ /**
348
+ * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.
349
+ */
350
+ bodyLocKey?: string;
351
+ /**
352
+ * The category associated to the notification.
353
+ */
354
+ category?: string;
355
+ /**
356
+ * The application is notified of the delivery of the notification if it's in the foreground or background, the app will be woken up (iOS only).
357
+ */
358
+ contentAvailable?: boolean;
359
+ /**
360
+ * The group which this notification is part of.
361
+ */
362
+ group?: string;
363
+ /**
364
+ * The icon associated to the notification (Android only).
365
+ */
366
+ icon?: string;
367
+ /**
368
+ * The number of items this notification represent.
369
+ */
370
+ notificationCount?: number;
371
+ /**
372
+ * The time when the event of the notification occurred.
373
+ */
374
+ notificationTimestamp?: string;
375
+ /**
376
+ * The sound played when the device receives the notification.
377
+ */
378
+ sound?: string;
379
+ /**
380
+ * The notification's subtitle. (iOS only)
381
+ */
382
+ subtitle?: string;
383
+ /**
384
+ * An identifier similar to 'group' but usable for different purposes (Android only).
385
+ */
386
+ tag?: string;
387
+ /**
388
+ * An identifier similar to 'group' but usable for different purposes (iOS only).
389
+ */
390
+ threadIdentifier?: string;
391
+ /**
392
+ * The notification's title.
393
+ */
394
+ title: string;
395
+ /**
396
+ * Variable string values to be used in place of the format specifiers in titleLocArgs to use to localize the title text to the user's current localization.
397
+ */
398
+ titleLocArgs?: string[];
399
+ /**
400
+ * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.
401
+ */
402
+ titleLocKey?: string;
403
+ /**
404
+ * The trigger that raised the notification message. Must be one of: push, location, calendar, timeInterval, other
405
+ */
406
+ trigger: Trigger;
407
+ };
408
+ /**
409
+ * EventContext type
410
+ */
411
+ export declare type EventContext = SelfDescribingJson;
412
+ /**
413
+ * ScreenView event properties
414
+ * schema: iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0
415
+ */
416
+ export declare type ScreenViewProps = {
417
+ /**
418
+ * The name of the screen viewed
419
+ */
420
+ name: string;
421
+ /**
422
+ * The id(UUID) of screen that was viewed
423
+ */
424
+ id?: string;
425
+ /**
426
+ * The type of screen that was viewed
427
+ */
428
+ type?: string;
429
+ /**
430
+ * The name of the previous screen that was viewed
431
+ */
432
+ previousName?: string;
433
+ /**
434
+ * The id(UUID) of the previous screen that was viewed
435
+ */
436
+ previousId?: string;
437
+ /**
438
+ * The type of the previous screen that was viewed
439
+ */
440
+ previousType?: string;
441
+ /**
442
+ * The type of transition that led to the screen being viewed
443
+ */
444
+ transitionType?: string;
445
+ };
446
+ /**
447
+ * Event tracked when a scroll view's scroll position changes.
448
+ * If screen engagement tracking is enabled, the scroll changed events will be aggregated into a `screen_summary` entity.
449
+ *
450
+ * Schema: `iglu:com.snowplowanalytics.mobile/scroll_changed/jsonschema/1-0-0`
451
+ */
452
+ export declare type ScrollChangedProps = {
453
+ /**
454
+ * Vertical scroll offset in pixels
455
+ */
456
+ yOffset?: number;
457
+ /**
458
+ * Horizontal scroll offset in pixels.
459
+ */
460
+ xOffset?: number;
461
+ /**
462
+ * The height of the scroll view in pixels
463
+ */
464
+ viewHeight?: number;
465
+ /**
466
+ * The width of the scroll view in pixels
467
+ */
468
+ viewWidth?: number;
469
+ /**
470
+ * The height of the content in the scroll view in pixels
471
+ */
472
+ contentHeight?: number;
473
+ /**
474
+ * The width of the content in the scroll view in pixels
475
+ */
476
+ contentWidth?: number;
477
+ };
478
+ /**
479
+ * Event tracking the view of an item in a list.
480
+ * If screen engagement tracking is enabled, the list item view events will be aggregated into a `screen_summary` entity.
481
+ *
482
+ * Schema: `iglu:com.snowplowanalytics.mobile/list_item_view/jsonschema/1-0-0`
483
+ */
484
+ export declare type ListItemViewProps = {
485
+ /**
486
+ * Index of the item in the list
487
+ */
488
+ index: number;
489
+ /**
490
+ * Total number of items in the list
491
+ */
492
+ itemsCount?: number;
493
+ };
494
+ /**
495
+ * Timing event properties
496
+ */
497
+ export declare type TimingProps = {
498
+ /**
499
+ * The timing category
500
+ */
501
+ category: string;
502
+ /**
503
+ * The timing variable
504
+ */
505
+ variable: string;
506
+ /**
507
+ * The time
508
+ */
509
+ timing: number;
510
+ /**
511
+ * The timing label
512
+ */
513
+ label?: string;
514
+ };
515
+ /**
516
+ * DeepLinkReceived event properties
517
+ * schema: iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0
518
+ */
519
+ export declare type DeepLinkReceivedProps = {
520
+ /**
521
+ * URL in the received deep-link.
522
+ */
523
+ url: string;
524
+ /**
525
+ * Referrer URL, source of this deep-link.
526
+ */
527
+ referrer?: string;
528
+ };
529
+ /**
530
+ * Current session state that is tracked in events.
531
+ */
532
+ export interface SessionState {
533
+ /**
534
+ * An identifier for the user of the session
535
+ */
536
+ userId: string;
537
+ /**
538
+ * An identifier for the session
539
+ */
540
+ sessionId: string;
541
+ /**
542
+ * The index of the current session for this user
543
+ */
544
+ sessionIndex: number;
545
+ /**
546
+ * Optional index of the current event in the session
547
+ */
548
+ eventIndex?: number;
549
+ /**
550
+ * The previous session identifier for this user
551
+ */
552
+ previousSessionId?: string;
553
+ /**
554
+ * The mechanism that the session information has been stored on the device
555
+ */
556
+ storageMechanism: string;
557
+ /**
558
+ * The optional identifier of the first event for this session
559
+ */
560
+ firstEventId?: string;
561
+ /**
562
+ * Optional date-time timestamp of when the first event in the session was tracked
563
+ */
564
+ firstEventTimestamp?: string;
565
+ }
566
+ /**
567
+ * The ReactNativeTracker type
568
+ */
569
+ export declare type ReactNativeTracker = {
570
+ /**
571
+ * The namespace of the tracker
572
+ */
573
+ namespace: string;
574
+ /**
575
+ * Tracks a self-describing event
576
+ *
577
+ * @param argmap - The self-describing event properties
578
+ * @param contexts - The array of event contexts
579
+ * @typeParam TData - The type of the data object within the SelfDescribing object
580
+ */
581
+ readonly trackSelfDescribingEvent: <T extends Record<string, unknown> = Record<string, unknown>>(argmap: SelfDescribingJson<T>, contexts?: EventContext[]) => void;
582
+ /**
583
+ * Tracks a screen-view event
584
+ *
585
+ * @param argmap - The screen-view event's properties
586
+ * @param contexts - The array of event contexts
587
+ */
588
+ readonly trackScreenViewEvent: (argmap: ScreenViewProps, contexts?: EventContext[]) => void;
589
+ /**
590
+ * Tracks a scroll changed event
591
+ *
592
+ * @param argmap - The scroll changed event's properties
593
+ * @param contexts - The array of event contexts
594
+ */
595
+ readonly trackScrollChangedEvent: (argmap: ScrollChangedProps, contexts?: EventContext[]) => void;
596
+ /**
597
+ * Tracks a list item view event
598
+ *
599
+ * @param argmap - The list item view event's properties
600
+ * @param contexts - The array of event contexts
601
+ */
602
+ readonly trackListItemViewEvent: (argmap: ListItemViewProps, contexts?: EventContext[]) => void;
603
+ /**
604
+ * Tracks a structured event
605
+ *
606
+ * @param argmap - The structured event properties
607
+ * @param contexts - The array of event contexts
608
+ */
609
+ readonly trackStructuredEvent: (argmap: StructuredEvent, contexts?: EventContext[]) => void;
610
+ /**
611
+ * Tracks a page-view event
612
+ *
613
+ * @param argmap - The page-view event properties
614
+ * @param contexts - The array of event contexts
615
+ */
616
+ readonly trackPageViewEvent: (argmap: PageViewEvent, contexts?: EventContext[]) => void;
617
+ /**
618
+ * Tracks a timing event
619
+ *
620
+ * @param argmap - The timing event properties
621
+ * @param contexts - The array of event contexts
622
+ */
623
+ readonly trackTimingEvent: (argmap: TimingProps, contexts?: EventContext[]) => void;
624
+ /**
625
+ * Tracks a deep link received event
626
+ *
627
+ * @param argmap - The deep link received event properties
628
+ * @param contexts - The array of event contexts
629
+ */
630
+ readonly trackDeepLinkReceivedEvent: (argmap: DeepLinkReceivedProps, contexts?: EventContext[]) => void;
631
+ /**
632
+ * Tracks a message notification event
633
+ *
634
+ * @param argmap - The message notification event properties
635
+ * @param contexts - The array of event contexts
636
+ */
637
+ readonly trackMessageNotificationEvent: (argmap: MessageNotificationProps, contexts?: EventContext[]) => void;
638
+ /**
639
+ * Adds contexts globally, contexts added here will be attached to all applicable events
640
+ * @param contexts - An array containing either contexts or a conditional contexts
641
+ */
642
+ addGlobalContexts(contexts: Array<ConditionalContextProvider | ContextPrimitive> | Record<string, ConditionalContextProvider | ContextPrimitive>): void;
643
+ /**
644
+ * Removes all global contexts
645
+ */
646
+ clearGlobalContexts(): void;
647
+ /**
648
+ * Removes previously added global context, performs a deep comparison of the contexts or conditional contexts
649
+ * @param contexts - An array containing either contexts or a conditional contexts
650
+ */
651
+ removeGlobalContexts(contexts: Array<ConditionalContextProvider | ContextPrimitive | string>): void;
652
+ /**
653
+ * Add a plugin into the plugin collection after Core has already been initialised
654
+ * @param configuration - The plugin to add
655
+ */
656
+ addPlugin(configuration: BrowserPluginConfiguration): void;
657
+ /**
658
+ * Calls flush on all emitters in order to send all queued events to the collector
659
+ * @returns Promise<void> - Promise that resolves when all emitters have flushed
660
+ */
661
+ flush: () => Promise<void>;
662
+ /**
663
+ * Set the application ID
664
+ *
665
+ * @param appId - An application ID which identifies the current application
666
+ */
667
+ readonly setAppId: (appId: string) => void;
668
+ /**
669
+ * Set the platform
670
+ *
671
+ * @param value - A valid Snowplow platform value
672
+ */
673
+ readonly setPlatform: (value: string) => void;
674
+ /**
675
+ * Sets the business-defined user ID for this user
676
+ *
677
+ * @param newUid - The new userId
678
+ */
679
+ readonly setUserId: (newUid: string) => void;
680
+ /**
681
+ * Override the network user id (UUIDv4) that is assigned by the collector and stored in cookies
682
+ *
683
+ * @param newNuid - The new networkUserId
684
+ */
685
+ readonly setNetworkUserId: (newNuid: string | undefined) => void;
686
+ /**
687
+ * The domain user id (DUID) is a generated identifier that is stored in a first party cookie on Web.
688
+ * The React Native tracker does not assign it automatically.
689
+ *
690
+ * @param newDuid - The new domainUserId
691
+ */
692
+ readonly setDomainUserId: (newDuid: string | undefined) => void;
693
+ /**
694
+ * Override the IP address of the device
695
+ *
696
+ * @param newIp - The new ipAddress
697
+ */
698
+ readonly setIpAddress: (newIp: string) => void;
699
+ /**
700
+ * The custom user-agent. It overrides the user-agent used by default.
701
+ *
702
+ * @param newUagent - The new useragent
703
+ */
704
+ readonly setUseragent: (newUagent: string) => void;
705
+ /**
706
+ * Sets the timezone of the tracker subject
707
+ *
708
+ * @param newTz - The new timezone
709
+ */
710
+ readonly setTimezone: (newTz: string) => void;
711
+ /**
712
+ * Sets the language of the tracker subject
713
+ *
714
+ * @param newLang - The new language
715
+ */
716
+ readonly setLanguage: (newLang: string) => void;
717
+ /**
718
+ * Sets the screenResolution of the tracker subject
719
+ *
720
+ * @param newRes - The new screenResolution
721
+ */
722
+ readonly setScreenResolution: (newRes: ScreenSize) => void;
723
+ /**
724
+ * Sets the screenViewport of the tracker subject
725
+ *
726
+ * @param newView - The new screenViewport
727
+ */
728
+ readonly setScreenViewport: (newView: ScreenSize) => void;
729
+ /**
730
+ * Sets the colorDepth of the tracker subject
731
+ *
732
+ * @param newColorD - The new colorDepth
733
+ */
734
+ readonly setColorDepth: (newLang: number) => void;
735
+ /**
736
+ * Sets subject data
737
+ *
738
+ * @param config - The new subject data
739
+ */
740
+ readonly setSubjectData: (config: SubjectConfiguration) => void;
741
+ /**
742
+ * Gets the identifier for the user of the session
743
+ */
744
+ readonly getSessionUserId: () => Promise<string | undefined>;
745
+ /**
746
+ * Gets the identifier for the session
747
+ */
748
+ readonly getSessionId: () => Promise<string | undefined>;
749
+ /**
750
+ * Gets the index of the current session for this user
751
+ */
752
+ readonly getSessionIndex: () => Promise<number | undefined>;
753
+ /**
754
+ * Gets the current session state
755
+ */
756
+ readonly getSessionState: () => Promise<SessionState | undefined>;
757
+ /**
758
+ * Gets whether the app is currently in background state
759
+ */
760
+ readonly getIsInBackground: () => boolean | undefined;
761
+ /**
762
+ * Gets the number of background transitions in the current session
763
+ */
764
+ readonly getBackgroundIndex: () => number | undefined;
765
+ /**
766
+ * Gets the number of foreground transitions in the current session.
767
+ */
768
+ readonly getForegroundIndex: () => number | undefined;
769
+ /**
770
+ * Enables tracking the platform context with information about the device.
771
+ * Note: Only some properties (osType, osVersion, deviceManufacturer, deviceModel, resolution, language, scale) will be tracked by default. Other properties can be assigned using the PlatformContextRetriever.
772
+ */
773
+ readonly enablePlatformContext: () => Promise<void>;
774
+ /**
775
+ * Disables tracking the platform context with information about the device.
776
+ */
777
+ readonly disablePlatformContext: () => void;
778
+ /**
779
+ * Refreshes the platform context with the latest values.
780
+ */
781
+ readonly refreshPlatformContext: () => Promise<void>;
782
+ };
783
+ export { version, PageViewEvent, StructuredEvent, FormFocusOrChangeEvent, SelfDescribingJson, Timestamp, PayloadBuilder, Payload, CorePlugin, CoreConfiguration, ContextGenerator, ContextFilter, EventPayloadAndContext, EventStore, EventStoreIterator, EventStorePayload, TrackerCore, Logger, EmitterConfiguration, EmitterConfigurationBase, EventJson, JsonProcessor, TrueTimestamp, DeviceTimestamp, EventMethod, RequestFailure, EventBatch, EventJsonWithKeys, LOG_LEVEL, ConditionalContextProvider, ContextPrimitive, CorePluginConfiguration, Emitter, FilterProvider, RuleSetProvider, RuleSet, } from '@snowplow/tracker-core';
784
+ //# sourceMappingURL=types.d.ts.map