-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy pathtypes.ts
More file actions
141 lines (136 loc) · 4.05 KB
/
types.ts
File metadata and controls
141 lines (136 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
export interface ScreenTrackingConfiguration {
/**
* Whether to enable tracking of the screen end event and the screen summary context entity.
* Make sure that you have lifecycle autotracking enabled for screen summary to have complete information.
* @default true
*/
screenEngagementAutotracking?: boolean;
/**
* Whether to enable tracking of the screen context entity.
* @default true
*/
screenContext?: boolean;
}
/**
* ScreenView event properties
* schema: iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0
*/
export type ScreenViewProps = {
/**
* The name of the screen viewed
*/
name: string;
/**
* The id(UUID) of screen that was viewed
* Will be automatically generated if not provided
*/
id?: string;
/**
* The type of screen that was viewed
*/
type?: string;
/**
* The name of the previous screen that was viewed
*/
previousName?: string;
/**
* The id(UUID) of the previous screen that was viewed
*/
previousId?: string;
/**
* The type of the previous screen that was viewed
*/
previousType?: string;
/**
* The type of transition that led to the screen being viewed
*/
transitionType?: string;
};
/** Screen context entity properties. */
export type ScreenProps = {
/** The name of the screen viewed. */
name: string;
/** The type of screen that was viewed e.g feed / carousel. */
type?: string;
/** An ID from the associated screenview event. */
id: string;
/** iOS specific: class name of the view controller. */
viewController?: string;
/** iOS specific: class name of the top level view controller. */
topViewController?: string;
/** Android specific: name of activity. */
activity?: string;
/** Android specific: name of fragment. */
fragment?: string;
};
/**
* Event tracked when a scroll view's scroll position changes.
* If screen engagement tracking is enabled, the scroll changed events will be aggregated into a `screen_summary` entity.
*
* Schema: `iglu:com.snowplowanalytics.mobile/scroll_changed/jsonschema/1-0-0`
*/
export type ScrollChangedProps = {
/**
* Vertical scroll offset in pixels
*/
yOffset?: number;
/**
* Horizontal scroll offset in pixels.
*/
xOffset?: number;
/**
* The height of the scroll view in pixels
*/
viewHeight?: number;
/**
* The width of the scroll view in pixels
*/
viewWidth?: number;
/**
* The height of the content in the scroll view in pixels
*/
contentHeight?: number;
/**
* The width of the content in the scroll view in pixels
*/
contentWidth?: number;
};
/**
* Event tracking the view of an item in a list.
* If screen engagement tracking is enabled, the list item view events will be aggregated into a `screen_summary` entity.
*
* Schema: `iglu:com.snowplowanalytics.mobile/list_item_view/jsonschema/1-0-0`
*/
export type ListItemViewProps = {
/**
* Index of the item in the list
*/
index: number;
/**
* Total number of items in the list
*/
itemsCount?: number;
};
/** Schema for an entity tracked with foreground/background/screen_end events with summary statistics about the screen view */
export type ScreenSummaryProps = {
/** Time in seconds spent on the current screen while the app was in foreground */
foreground_sec: number;
/** Time in seconds spent on the current screen while the app was in background */
background_sec?: number;
/** Index of the last viewed item in the list on the screen */
last_item_index?: number;
/** Total number of items in the list on the screen */
items_count?: number;
/** Minimum horizontal scroll offset on the scroll view in pixels */
min_x_offset?: number;
/** Maximum horizontal scroll offset on the scroll view in pixels */
max_x_offset?: number;
/** Minimum vertical scroll offset on the scroll view in pixels */
min_y_offset?: number;
/** Maximum vertical scroll offset on the scroll view in pixels */
max_y_offset?: number;
/** Width of the scroll view in pixels */
content_width?: number;
/** Height of the scroll view in pixels */
content_height?: number;
};