1 | import { ICredentials } from '@aws-amplify/core';
|
2 |
|
3 |
|
4 |
|
5 | export interface AnalyticsOptions {
|
6 | appId: string;
|
7 | platform?: string;
|
8 | clientId?: string;
|
9 | region?: string;
|
10 | credentials?: ICredentials;
|
11 | }
|
12 | export interface EventAttributes {
|
13 | [key: string]: string;
|
14 | }
|
15 | export interface EventMetrics {
|
16 | [key: string]: number;
|
17 | }
|
18 | export interface pageViewTrackOpts {
|
19 | enable: boolean;
|
20 | type?: string;
|
21 | eventName?: string;
|
22 | provider?: string;
|
23 | attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
24 | getUrl?: () => string;
|
25 | }
|
26 | export interface EventTrackOpts {
|
27 | enable: boolean;
|
28 | events?: Array<string>;
|
29 | selectorPrefix?: string;
|
30 | provider?: string;
|
31 | attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
32 | }
|
33 | export interface SessionTrackOpts {
|
34 | enable: boolean;
|
35 | attributes?: EventAttributes | (() => EventAttributes | Promise<EventAttributes>);
|
36 | provider?: string;
|
37 | }
|
38 | export declare type AutoTrackAttributes = (() => EventAttributes | Promise<EventAttributes>) | EventAttributes;
|
39 | export interface AutoTrackSessionOpts {
|
40 | enable: boolean;
|
41 | attributes?: AutoTrackAttributes;
|
42 | provider?: string;
|
43 | }
|
44 | export interface AutoTrackPageViewOpts {
|
45 | enable: boolean;
|
46 | eventName?: string;
|
47 | attributes?: AutoTrackAttributes;
|
48 | type?: 'SPA' | 'multiPageApp';
|
49 | provider?: string;
|
50 | getUrl?: () => string;
|
51 | }
|
52 | export interface AutoTrackEventOpts {
|
53 | enable: boolean;
|
54 | events?: string[];
|
55 | selectorPrefix?: string;
|
56 | provider?: string;
|
57 | attributes?: AutoTrackAttributes;
|
58 | }
|
59 | export interface AnalyticsEvent {
|
60 | name: string;
|
61 | attributes?: EventAttributes;
|
62 | metrics?: EventMetrics;
|
63 | immediate?: boolean;
|
64 | }
|