|
29 | 29 | */ |
30 | 30 |
|
31 | 31 | import { BrowserPlugin } from '../plugins'; |
32 | | -import { CommonEventProperties, SelfDescribingJson, TrackerCore } from '@snowplow/tracker-core'; |
| 32 | +import { |
| 33 | + CommonEventProperties, |
| 34 | + SelfDescribingJson, |
| 35 | + TrackerCore, |
| 36 | + CorePluginConfiguration, |
| 37 | +} from '@snowplow/tracker-core'; |
33 | 38 | import { SharedState } from '../state'; |
34 | 39 |
|
35 | 40 | /* Configuration for Anonymous Tracking */ |
@@ -241,18 +246,38 @@ export interface PageViewEvent { |
241 | 246 | contextCallback?: (() => Array<SelfDescribingJson>) | null; |
242 | 247 | } |
243 | 248 |
|
| 249 | +/** |
| 250 | + * The configuration that can be changed when disabling anonymous tracking |
| 251 | + */ |
244 | 252 | export interface DisableAnonymousTrackingConfiguration { |
| 253 | + /* Available configurations for different storage strategies */ |
245 | 254 | stateStorageStrategy?: StateStorageStrategy; |
246 | 255 | } |
247 | 256 |
|
| 257 | +/** |
| 258 | + * The configuration that can be changed when enabling anonymous tracking |
| 259 | + */ |
248 | 260 | export interface EnableAnonymousTrackingConfiguration { |
| 261 | + /* Configuration for Anonymous Tracking */ |
249 | 262 | options?: AnonymousTrackingOptions; |
250 | 263 | } |
251 | 264 |
|
| 265 | +/** |
| 266 | + * The configuration that can be changed when flushing the buffer |
| 267 | + */ |
252 | 268 | export interface FlushBufferConfiguration { |
| 269 | + /* The size of the buffer after this flush */ |
253 | 270 | newBufferSize?: number; |
254 | 271 | } |
255 | 272 |
|
| 273 | +/** |
| 274 | + * The configuration of the plugin to add |
| 275 | + */ |
| 276 | +export interface BrowserPluginConfiguration extends CorePluginConfiguration { |
| 277 | + /* The plugin to add */ |
| 278 | + plugin: BrowserPlugin; |
| 279 | +} |
| 280 | + |
256 | 281 | /** |
257 | 282 | * The Browser Tracker |
258 | 283 | */ |
@@ -485,5 +510,9 @@ export interface BrowserTracker { |
485 | 510 | */ |
486 | 511 | clearUserData: () => void; |
487 | 512 |
|
488 | | - addPlugin: (plugin: BrowserPlugin) => void; |
| 513 | + /** |
| 514 | + * Add a plugin into the plugin collection after Tracker has already been initialised |
| 515 | + * @param configuration The plugin to add |
| 516 | + */ |
| 517 | + addPlugin: (configuration: BrowserPluginConfiguration) => void; |
489 | 518 | } |
0 commit comments