posthog-react-native 1.1.5 → 2.0.0-alpha10
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.
- package/README.md +9 -0
- package/lib/index.cjs.js +1773 -0
- package/lib/index.cjs.js.map +1 -0
- package/lib/index.d.ts +214 -0
- package/lib/index.esm.js +1737 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/node_modules/tslib/tslib.es6.d.ts +35 -0
- package/lib/posthog-core/src/eventemitter.d.ts +8 -0
- package/lib/posthog-core/src/index.d.ts +87 -0
- package/lib/posthog-core/src/lz-string.d.ts +8 -0
- package/lib/posthog-core/src/types.d.ts +68 -0
- package/lib/posthog-core/src/utils.d.ts +13 -0
- package/lib/posthog-react-native/index.d.ts +10 -0
- package/lib/posthog-react-native/src/PostHogProvider.d.ts +13 -0
- package/lib/posthog-react-native/src/PosthogContext.d.ts +5 -0
- package/lib/posthog-react-native/src/autocapture.d.ts +3 -0
- package/lib/posthog-react-native/src/hooks/useFeatureFlag.d.ts +1 -0
- package/lib/posthog-react-native/src/hooks/useFeatureFlags.d.ts +3 -0
- package/lib/posthog-react-native/src/hooks/useLifecycleTracker.d.ts +2 -0
- package/lib/posthog-react-native/src/hooks/useNavigationTracker.d.ts +5 -0
- package/lib/posthog-react-native/src/hooks/usePostHog.d.ts +2 -0
- package/lib/posthog-react-native/src/legacy.d.ts +4 -0
- package/lib/posthog-react-native/src/optional-imports.d.ts +6 -0
- package/lib/posthog-react-native/src/posthog-rn.d.ts +14 -0
- package/lib/posthog-react-native/src/storage.d.ts +8 -0
- package/lib/posthog-react-native/src/types.d.ts +12 -0
- package/package.json +35 -51
- package/RNPostHog.podspec +0 -21
- package/android/build.gradle +0 -46
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/java/com/posthog/reactnative/core/RNPostHogModule.kt +0 -250
- package/android/src/main/java/com/posthog/reactnative/core/RNPostHogPackage.kt +0 -44
- package/build/cjs/__mocks__/bridge.d.ts +0 -14
- package/build/cjs/__mocks__/bridge.js +0 -15
- package/build/cjs/__mocks__/bridge.js.map +0 -1
- package/build/cjs/__tests__/bridge.spec.d.ts +0 -1
- package/build/cjs/__tests__/bridge.spec.js +0 -19
- package/build/cjs/__tests__/bridge.spec.js.map +0 -1
- package/build/cjs/__tests__/configuration.spec.d.ts +0 -1
- package/build/cjs/__tests__/configuration.spec.js +0 -131
- package/build/cjs/__tests__/configuration.spec.js.map +0 -1
- package/build/cjs/__tests__/index.spec.d.ts +0 -1
- package/build/cjs/__tests__/index.spec.js +0 -9
- package/build/cjs/__tests__/index.spec.js.map +0 -1
- package/build/cjs/__tests__/posthog.spec.d.ts +0 -1
- package/build/cjs/__tests__/posthog.spec.js +0 -193
- package/build/cjs/__tests__/posthog.spec.js.map +0 -1
- package/build/cjs/bridge.d.ts +0 -50
- package/build/cjs/bridge.js +0 -9
- package/build/cjs/bridge.js.map +0 -1
- package/build/cjs/configuration.d.ts +0 -3
- package/build/cjs/configuration.js +0 -94
- package/build/cjs/configuration.js.map +0 -1
- package/build/cjs/index.d.ts +0 -5
- package/build/cjs/index.js +0 -6
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/make-pkg.d.ts +0 -1
- package/build/cjs/make-pkg.js +0 -5
- package/build/cjs/make-pkg.js.map +0 -1
- package/build/cjs/middleware.d.ts +0 -41
- package/build/cjs/middleware.js +0 -114
- package/build/cjs/middleware.js.map +0 -1
- package/build/cjs/posthog.d.ts +0 -228
- package/build/cjs/posthog.js +0 -309
- package/build/cjs/posthog.js.map +0 -1
- package/build/cjs/utils.d.ts +0 -1
- package/build/cjs/utils.js +0 -7
- package/build/cjs/utils.js.map +0 -1
- package/build/cjs/wrapper.d.ts +0 -22
- package/build/cjs/wrapper.js +0 -114
- package/build/cjs/wrapper.js.map +0 -1
- package/build/coverage/clover.xml +0 -169
- package/build/coverage/coverage-final.json +0 -8
- package/build/coverage/lcov-report/base.css +0 -212
- package/build/coverage/lcov-report/bridge.ts.html +0 -228
- package/build/coverage/lcov-report/configuration.ts.html +0 -228
- package/build/coverage/lcov-report/index.html +0 -151
- package/build/coverage/lcov-report/index.ts.html +0 -60
- package/build/coverage/lcov-report/middleware.ts.html +0 -429
- package/build/coverage/lcov-report/posthog.ts.html +0 -960
- package/build/coverage/lcov-report/prettify.css +0 -1
- package/build/coverage/lcov-report/prettify.js +0 -1
- package/build/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/build/coverage/lcov-report/sorter.js +0 -158
- package/build/coverage/lcov-report/utils.ts.html +0 -54
- package/build/coverage/lcov-report/wrapper.ts.html +0 -228
- package/build/coverage/lcov.info +0 -365
- package/build/esm/__mocks__/bridge.d.ts +0 -14
- package/build/esm/__mocks__/bridge.js +0 -13
- package/build/esm/__mocks__/bridge.js.map +0 -1
- package/build/esm/__tests__/bridge.spec.d.ts +0 -1
- package/build/esm/__tests__/bridge.spec.js +0 -19
- package/build/esm/__tests__/bridge.spec.js.map +0 -1
- package/build/esm/__tests__/configuration.spec.d.ts +0 -1
- package/build/esm/__tests__/configuration.spec.js +0 -129
- package/build/esm/__tests__/configuration.spec.js.map +0 -1
- package/build/esm/__tests__/index.spec.d.ts +0 -1
- package/build/esm/__tests__/index.spec.js +0 -7
- package/build/esm/__tests__/index.spec.js.map +0 -1
- package/build/esm/__tests__/posthog.spec.d.ts +0 -1
- package/build/esm/__tests__/posthog.spec.js +0 -191
- package/build/esm/__tests__/posthog.spec.js.map +0 -1
- package/build/esm/bridge.d.ts +0 -50
- package/build/esm/bridge.js +0 -7
- package/build/esm/bridge.js.map +0 -1
- package/build/esm/configuration.d.ts +0 -3
- package/build/esm/configuration.js +0 -92
- package/build/esm/configuration.js.map +0 -1
- package/build/esm/index.d.ts +0 -5
- package/build/esm/index.js +0 -4
- package/build/esm/index.js.map +0 -1
- package/build/esm/make-pkg.d.ts +0 -1
- package/build/esm/make-pkg.js +0 -3
- package/build/esm/make-pkg.js.map +0 -1
- package/build/esm/middleware.d.ts +0 -41
- package/build/esm/middleware.js +0 -112
- package/build/esm/middleware.js.map +0 -1
- package/build/esm/posthog.d.ts +0 -228
- package/build/esm/posthog.js +0 -307
- package/build/esm/posthog.js.map +0 -1
- package/build/esm/utils.d.ts +0 -1
- package/build/esm/utils.js +0 -4
- package/build/esm/utils.js.map +0 -1
- package/build/esm/wrapper.d.ts +0 -22
- package/build/esm/wrapper.js +0 -112
- package/build/esm/wrapper.js.map +0 -1
- package/build/package.json +0 -3
- package/ios/RNPostHog/RNPostHog.h +0 -9
- package/ios/RNPostHog/RNPostHog.m +0 -128
- package/ios/RNPostHog.xcodeproj/project.pbxproj +0 -336
- package/ios/RNPostHog.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/src/__mocks__/bridge.ts +0 -12
- package/src/__tests__/bridge.spec.ts +0 -23
- package/src/__tests__/configuration.spec.ts +0 -79
- package/src/__tests__/index.spec.ts +0 -7
- package/src/__tests__/posthog.spec.ts +0 -108
- package/src/bridge.ts +0 -61
- package/src/configuration.ts +0 -61
- package/src/index.ts +0 -5
- package/src/make-pkg.ts +0 -3
- package/src/middleware.ts +0 -128
- package/src/modules.d.ts +0 -2
- package/src/posthog.ts +0 -305
- package/src/utils.ts +0 -3
- package/src/wrapper.ts +0 -61
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
body, html {
|
|
2
|
-
margin:0; padding: 0;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
body {
|
|
6
|
-
font-family: Helvetica Neue, Helvetica, Arial;
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
color:#333;
|
|
9
|
-
}
|
|
10
|
-
.small { font-size: 12px; }
|
|
11
|
-
*, *:after, *:before {
|
|
12
|
-
-webkit-box-sizing:border-box;
|
|
13
|
-
-moz-box-sizing:border-box;
|
|
14
|
-
box-sizing:border-box;
|
|
15
|
-
}
|
|
16
|
-
h1 { font-size: 20px; margin: 0;}
|
|
17
|
-
h2 { font-size: 14px; }
|
|
18
|
-
pre {
|
|
19
|
-
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
20
|
-
margin: 0;
|
|
21
|
-
padding: 0;
|
|
22
|
-
-moz-tab-size: 2;
|
|
23
|
-
-o-tab-size: 2;
|
|
24
|
-
tab-size: 2;
|
|
25
|
-
}
|
|
26
|
-
a { color:#0074D9; text-decoration:none; }
|
|
27
|
-
a:hover { text-decoration:underline; }
|
|
28
|
-
.strong { font-weight: bold; }
|
|
29
|
-
.space-top1 { padding: 10px 0 0 0; }
|
|
30
|
-
.pad2y { padding: 20px 0; }
|
|
31
|
-
.pad1y { padding: 10px 0; }
|
|
32
|
-
.pad2x { padding: 0 20px; }
|
|
33
|
-
.pad2 { padding: 20px; }
|
|
34
|
-
.pad1 { padding: 10px; }
|
|
35
|
-
.space-left2 { padding-left:55px; }
|
|
36
|
-
.space-right2 { padding-right:20px; }
|
|
37
|
-
.center { text-align:center; }
|
|
38
|
-
.clearfix { display:block; }
|
|
39
|
-
.clearfix:after {
|
|
40
|
-
content:'';
|
|
41
|
-
display:block;
|
|
42
|
-
height:0;
|
|
43
|
-
clear:both;
|
|
44
|
-
visibility:hidden;
|
|
45
|
-
}
|
|
46
|
-
.fl { float: left; }
|
|
47
|
-
@media only screen and (max-width:640px) {
|
|
48
|
-
.col3 { width:100%; max-width:100%; }
|
|
49
|
-
.hide-mobile { display:none!important; }
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.quiet {
|
|
53
|
-
color: #7f7f7f;
|
|
54
|
-
color: rgba(0,0,0,0.5);
|
|
55
|
-
}
|
|
56
|
-
.quiet a { opacity: 0.7; }
|
|
57
|
-
|
|
58
|
-
.fraction {
|
|
59
|
-
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
60
|
-
font-size: 10px;
|
|
61
|
-
color: #555;
|
|
62
|
-
background: #E8E8E8;
|
|
63
|
-
padding: 4px 5px;
|
|
64
|
-
border-radius: 3px;
|
|
65
|
-
vertical-align: middle;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
div.path a:link, div.path a:visited { color: #333; }
|
|
69
|
-
table.coverage {
|
|
70
|
-
border-collapse: collapse;
|
|
71
|
-
margin: 10px 0 0 0;
|
|
72
|
-
padding: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
table.coverage td {
|
|
76
|
-
margin: 0;
|
|
77
|
-
padding: 0;
|
|
78
|
-
vertical-align: top;
|
|
79
|
-
}
|
|
80
|
-
table.coverage td.line-count {
|
|
81
|
-
text-align: right;
|
|
82
|
-
padding: 0 5px 0 20px;
|
|
83
|
-
}
|
|
84
|
-
table.coverage td.line-coverage {
|
|
85
|
-
text-align: right;
|
|
86
|
-
padding-right: 10px;
|
|
87
|
-
min-width:20px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
table.coverage td span.cline-any {
|
|
91
|
-
display: inline-block;
|
|
92
|
-
padding: 0 5px;
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
.missing-if-branch {
|
|
96
|
-
display: inline-block;
|
|
97
|
-
margin-right: 5px;
|
|
98
|
-
border-radius: 3px;
|
|
99
|
-
position: relative;
|
|
100
|
-
padding: 0 4px;
|
|
101
|
-
background: #333;
|
|
102
|
-
color: yellow;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.skip-if-branch {
|
|
106
|
-
display: none;
|
|
107
|
-
margin-right: 10px;
|
|
108
|
-
position: relative;
|
|
109
|
-
padding: 0 4px;
|
|
110
|
-
background: #ccc;
|
|
111
|
-
color: white;
|
|
112
|
-
}
|
|
113
|
-
.missing-if-branch .typ, .skip-if-branch .typ {
|
|
114
|
-
color: inherit !important;
|
|
115
|
-
}
|
|
116
|
-
.coverage-summary {
|
|
117
|
-
border-collapse: collapse;
|
|
118
|
-
width: 100%;
|
|
119
|
-
}
|
|
120
|
-
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
|
121
|
-
.keyline-all { border: 1px solid #ddd; }
|
|
122
|
-
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
|
123
|
-
.coverage-summary tbody { border: 1px solid #bbb; }
|
|
124
|
-
.coverage-summary td { border-right: 1px solid #bbb; }
|
|
125
|
-
.coverage-summary td:last-child { border-right: none; }
|
|
126
|
-
.coverage-summary th {
|
|
127
|
-
text-align: left;
|
|
128
|
-
font-weight: normal;
|
|
129
|
-
white-space: nowrap;
|
|
130
|
-
}
|
|
131
|
-
.coverage-summary th.file { border-right: none !important; }
|
|
132
|
-
.coverage-summary th.pct { }
|
|
133
|
-
.coverage-summary th.pic,
|
|
134
|
-
.coverage-summary th.abs,
|
|
135
|
-
.coverage-summary td.pct,
|
|
136
|
-
.coverage-summary td.abs { text-align: right; }
|
|
137
|
-
.coverage-summary td.file { white-space: nowrap; }
|
|
138
|
-
.coverage-summary td.pic { min-width: 120px !important; }
|
|
139
|
-
.coverage-summary tfoot td { }
|
|
140
|
-
|
|
141
|
-
.coverage-summary .sorter {
|
|
142
|
-
height: 10px;
|
|
143
|
-
width: 7px;
|
|
144
|
-
display: inline-block;
|
|
145
|
-
margin-left: 0.5em;
|
|
146
|
-
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
|
147
|
-
}
|
|
148
|
-
.coverage-summary .sorted .sorter {
|
|
149
|
-
background-position: 0 -20px;
|
|
150
|
-
}
|
|
151
|
-
.coverage-summary .sorted-desc .sorter {
|
|
152
|
-
background-position: 0 -10px;
|
|
153
|
-
}
|
|
154
|
-
.status-line { height: 10px; }
|
|
155
|
-
/* dark red */
|
|
156
|
-
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
|
157
|
-
.low .chart { border:1px solid #C21F39 }
|
|
158
|
-
/* medium red */
|
|
159
|
-
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
|
160
|
-
/* light red */
|
|
161
|
-
.low, .cline-no { background:#FCE1E5 }
|
|
162
|
-
/* light green */
|
|
163
|
-
.high, .cline-yes { background:rgb(230,245,208) }
|
|
164
|
-
/* medium green */
|
|
165
|
-
.cstat-yes { background:rgb(161,215,106) }
|
|
166
|
-
/* dark green */
|
|
167
|
-
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
|
168
|
-
.high .chart { border:1px solid rgb(77,146,33) }
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
.medium .chart { border:1px solid #666; }
|
|
172
|
-
.medium .cover-fill { background: #666; }
|
|
173
|
-
|
|
174
|
-
.cbranch-no { background: yellow !important; color: #111; }
|
|
175
|
-
|
|
176
|
-
.cstat-skip { background: #ddd; color: #111; }
|
|
177
|
-
.fstat-skip { background: #ddd; color: #111 !important; }
|
|
178
|
-
.cbranch-skip { background: #ddd !important; color: #111; }
|
|
179
|
-
|
|
180
|
-
span.cline-neutral { background: #eaeaea; }
|
|
181
|
-
.medium { background: #eaeaea; }
|
|
182
|
-
|
|
183
|
-
.cover-fill, .cover-empty {
|
|
184
|
-
display:inline-block;
|
|
185
|
-
height: 12px;
|
|
186
|
-
}
|
|
187
|
-
.chart {
|
|
188
|
-
line-height: 0;
|
|
189
|
-
}
|
|
190
|
-
.cover-empty {
|
|
191
|
-
background: white;
|
|
192
|
-
}
|
|
193
|
-
.cover-full {
|
|
194
|
-
border-right: none !important;
|
|
195
|
-
}
|
|
196
|
-
pre.prettyprint {
|
|
197
|
-
border: none !important;
|
|
198
|
-
padding: 0 !important;
|
|
199
|
-
margin: 0 !important;
|
|
200
|
-
}
|
|
201
|
-
.com { color: #999 !important; }
|
|
202
|
-
.ignore-none { color: #999; font-weight: normal; }
|
|
203
|
-
|
|
204
|
-
.wrapper {
|
|
205
|
-
min-height: 100%;
|
|
206
|
-
height: auto !important;
|
|
207
|
-
height: 100%;
|
|
208
|
-
margin: 0 auto -48px;
|
|
209
|
-
}
|
|
210
|
-
.footer, .push {
|
|
211
|
-
height: 48px;
|
|
212
|
-
}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Code coverage report for bridge.ts</title>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<link rel="stylesheet" href="prettify.css" />
|
|
7
|
-
<link rel="stylesheet" href="base.css" />
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<style type='text/css'>
|
|
10
|
-
.coverage-summary .sorter {
|
|
11
|
-
background-image: url(sort-arrow-sprite.png);
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div class='wrapper'>
|
|
17
|
-
<div class='pad1'>
|
|
18
|
-
<h1>
|
|
19
|
-
<a href="index.html">All files</a> bridge.ts
|
|
20
|
-
</h1>
|
|
21
|
-
<div class='clearfix'>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div class='status-line high'></div>
|
|
25
|
-
<pre><table class="coverage">
|
|
26
|
-
<tr><td class="line-count quiet">1
|
|
27
|
-
2
|
|
28
|
-
3
|
|
29
|
-
4
|
|
30
|
-
5
|
|
31
|
-
6
|
|
32
|
-
7
|
|
33
|
-
8
|
|
34
|
-
9
|
|
35
|
-
10
|
|
36
|
-
11
|
|
37
|
-
12
|
|
38
|
-
13
|
|
39
|
-
14
|
|
40
|
-
15
|
|
41
|
-
16
|
|
42
|
-
17
|
|
43
|
-
18
|
|
44
|
-
19
|
|
45
|
-
20
|
|
46
|
-
21
|
|
47
|
-
22
|
|
48
|
-
23
|
|
49
|
-
24
|
|
50
|
-
25
|
|
51
|
-
26
|
|
52
|
-
27
|
|
53
|
-
28
|
|
54
|
-
29
|
|
55
|
-
30
|
|
56
|
-
31
|
|
57
|
-
32
|
|
58
|
-
33
|
|
59
|
-
34
|
|
60
|
-
35
|
|
61
|
-
36
|
|
62
|
-
37
|
|
63
|
-
38
|
|
64
|
-
39
|
|
65
|
-
40
|
|
66
|
-
41
|
|
67
|
-
42
|
|
68
|
-
43
|
|
69
|
-
44
|
|
70
|
-
45
|
|
71
|
-
46
|
|
72
|
-
47
|
|
73
|
-
48
|
|
74
|
-
49
|
|
75
|
-
50
|
|
76
|
-
51
|
|
77
|
-
52
|
|
78
|
-
53
|
|
79
|
-
54
|
|
80
|
-
55
|
|
81
|
-
56
|
|
82
|
-
57
|
|
83
|
-
58
|
|
84
|
-
59
|
|
85
|
-
60
|
|
86
|
-
61
|
|
87
|
-
62</td><td class="line-coverage quiet"><span class="cline-any cline-yes">2x</span>
|
|
88
|
-
<span class="cline-any cline-neutral"> </span>
|
|
89
|
-
<span class="cline-any cline-neutral"> </span>
|
|
90
|
-
<span class="cline-any cline-neutral"> </span>
|
|
91
|
-
<span class="cline-any cline-neutral"> </span>
|
|
92
|
-
<span class="cline-any cline-neutral"> </span>
|
|
93
|
-
<span class="cline-any cline-neutral"> </span>
|
|
94
|
-
<span class="cline-any cline-neutral"> </span>
|
|
95
|
-
<span class="cline-any cline-neutral"> </span>
|
|
96
|
-
<span class="cline-any cline-neutral"> </span>
|
|
97
|
-
<span class="cline-any cline-neutral"> </span>
|
|
98
|
-
<span class="cline-any cline-neutral"> </span>
|
|
99
|
-
<span class="cline-any cline-neutral"> </span>
|
|
100
|
-
<span class="cline-any cline-neutral"> </span>
|
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
|
102
|
-
<span class="cline-any cline-neutral"> </span>
|
|
103
|
-
<span class="cline-any cline-neutral"> </span>
|
|
104
|
-
<span class="cline-any cline-neutral"> </span>
|
|
105
|
-
<span class="cline-any cline-neutral"> </span>
|
|
106
|
-
<span class="cline-any cline-neutral"> </span>
|
|
107
|
-
<span class="cline-any cline-neutral"> </span>
|
|
108
|
-
<span class="cline-any cline-neutral"> </span>
|
|
109
|
-
<span class="cline-any cline-neutral"> </span>
|
|
110
|
-
<span class="cline-any cline-neutral"> </span>
|
|
111
|
-
<span class="cline-any cline-neutral"> </span>
|
|
112
|
-
<span class="cline-any cline-neutral"> </span>
|
|
113
|
-
<span class="cline-any cline-neutral"> </span>
|
|
114
|
-
<span class="cline-any cline-neutral"> </span>
|
|
115
|
-
<span class="cline-any cline-neutral"> </span>
|
|
116
|
-
<span class="cline-any cline-neutral"> </span>
|
|
117
|
-
<span class="cline-any cline-neutral"> </span>
|
|
118
|
-
<span class="cline-any cline-neutral"> </span>
|
|
119
|
-
<span class="cline-any cline-neutral"> </span>
|
|
120
|
-
<span class="cline-any cline-neutral"> </span>
|
|
121
|
-
<span class="cline-any cline-neutral"> </span>
|
|
122
|
-
<span class="cline-any cline-neutral"> </span>
|
|
123
|
-
<span class="cline-any cline-neutral"> </span>
|
|
124
|
-
<span class="cline-any cline-neutral"> </span>
|
|
125
|
-
<span class="cline-any cline-neutral"> </span>
|
|
126
|
-
<span class="cline-any cline-neutral"> </span>
|
|
127
|
-
<span class="cline-any cline-neutral"> </span>
|
|
128
|
-
<span class="cline-any cline-neutral"> </span>
|
|
129
|
-
<span class="cline-any cline-neutral"> </span>
|
|
130
|
-
<span class="cline-any cline-neutral"> </span>
|
|
131
|
-
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-neutral"> </span>
|
|
133
|
-
<span class="cline-any cline-neutral"> </span>
|
|
134
|
-
<span class="cline-any cline-neutral"> </span>
|
|
135
|
-
<span class="cline-any cline-neutral"> </span>
|
|
136
|
-
<span class="cline-any cline-neutral"> </span>
|
|
137
|
-
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-neutral"> </span>
|
|
139
|
-
<span class="cline-any cline-neutral"> </span>
|
|
140
|
-
<span class="cline-any cline-neutral"> </span>
|
|
141
|
-
<span class="cline-any cline-yes">2x</span>
|
|
142
|
-
<span class="cline-any cline-neutral"> </span>
|
|
143
|
-
<span class="cline-any cline-yes">2x</span>
|
|
144
|
-
<span class="cline-any cline-yes">1x</span>
|
|
145
|
-
<span class="cline-any cline-neutral"> </span>
|
|
146
|
-
<span class="cline-any cline-neutral"> </span>
|
|
147
|
-
<span class="cline-any cline-yes">1x</span>
|
|
148
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { NativeModules } from 'react-native'
|
|
149
|
-
|
|
150
|
-
export interface Context extends JsonMap {
|
|
151
|
-
$lib: string
|
|
152
|
-
$lib_version: string
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface Configuration {
|
|
156
|
-
apiKey: string
|
|
157
|
-
host: string
|
|
158
|
-
recordScreenViews: boolean
|
|
159
|
-
captureApplicationLifecycleEvents: boolean
|
|
160
|
-
captureDeepLinks?: boolean
|
|
161
|
-
flushAt?: number
|
|
162
|
-
flushInterval?: number
|
|
163
|
-
debug: boolean
|
|
164
|
-
json: string
|
|
165
|
-
context: Context
|
|
166
|
-
android: {
|
|
167
|
-
collectDeviceId?: boolean
|
|
168
|
-
}
|
|
169
|
-
ios: {
|
|
170
|
-
capturePushNotifications?: boolean
|
|
171
|
-
captureInAppPurchases?: boolean
|
|
172
|
-
maxQueueSize?: number
|
|
173
|
-
shouldUseBluetooth?: boolean
|
|
174
|
-
shouldUseLocationServices?: boolean
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export type JsonValue = boolean | number | string | null | JsonList | JsonMap
|
|
179
|
-
export interface JsonMap {
|
|
180
|
-
[key: string]: JsonValue
|
|
181
|
-
[index: number]: JsonValue
|
|
182
|
-
}
|
|
183
|
-
export interface JsonList extends Array<JsonValue> {}
|
|
184
|
-
|
|
185
|
-
export interface Options {
|
|
186
|
-
context?: Context
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface Bridge {
|
|
190
|
-
setup(configuration: Configuration): Promise<void>
|
|
191
|
-
capture(event: string, properties: JsonMap): Promise<void>
|
|
192
|
-
identify(distinctId: string | null, properties: JsonMap): Promise<void>
|
|
193
|
-
screen(screen: string, properties: JsonMap): Promise<void>
|
|
194
|
-
alias(alias: string): Promise<void>
|
|
195
|
-
reset(): Promise<void>
|
|
196
|
-
flush(): Promise<void>
|
|
197
|
-
enable(): Promise<void>
|
|
198
|
-
disable(): Promise<void>
|
|
199
|
-
getAnonymousId(): Promise<string>
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const bridge: Bridge = NativeModules.RNPostHog
|
|
203
|
-
|
|
204
|
-
if (!bridge) {
|
|
205
|
-
throw new Error('Failed to load PostHog native module.')
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export default bridge
|
|
209
|
-
</pre></td></tr>
|
|
210
|
-
</table></pre>
|
|
211
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
212
|
-
</div><!-- /wrapper -->
|
|
213
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
214
|
-
Code coverage
|
|
215
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Mar 29 2022 11:45:52 GMT+0200 (Central European Summer Time)
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
218
|
-
<script src="prettify.js"></script>
|
|
219
|
-
<script>
|
|
220
|
-
window.onload = function () {
|
|
221
|
-
if (typeof prettyPrint === 'function') {
|
|
222
|
-
prettyPrint();
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
</script>
|
|
226
|
-
<script src="sorter.js"></script>
|
|
227
|
-
</body>
|
|
228
|
-
</html>
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>Code coverage report for configuration.ts</title>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<link rel="stylesheet" href="prettify.css" />
|
|
7
|
-
<link rel="stylesheet" href="base.css" />
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
-
<style type='text/css'>
|
|
10
|
-
.coverage-summary .sorter {
|
|
11
|
-
background-image: url(sort-arrow-sprite.png);
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div class='wrapper'>
|
|
17
|
-
<div class='pad1'>
|
|
18
|
-
<h1>
|
|
19
|
-
<a href="index.html">All files</a> configuration.ts
|
|
20
|
-
</h1>
|
|
21
|
-
<div class='clearfix'>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div class='status-line high'></div>
|
|
25
|
-
<pre><table class="coverage">
|
|
26
|
-
<tr><td class="line-count quiet">1
|
|
27
|
-
2
|
|
28
|
-
3
|
|
29
|
-
4
|
|
30
|
-
5
|
|
31
|
-
6
|
|
32
|
-
7
|
|
33
|
-
8
|
|
34
|
-
9
|
|
35
|
-
10
|
|
36
|
-
11
|
|
37
|
-
12
|
|
38
|
-
13
|
|
39
|
-
14
|
|
40
|
-
15
|
|
41
|
-
16
|
|
42
|
-
17
|
|
43
|
-
18
|
|
44
|
-
19
|
|
45
|
-
20
|
|
46
|
-
21
|
|
47
|
-
22
|
|
48
|
-
23
|
|
49
|
-
24
|
|
50
|
-
25
|
|
51
|
-
26
|
|
52
|
-
27
|
|
53
|
-
28
|
|
54
|
-
29
|
|
55
|
-
30
|
|
56
|
-
31
|
|
57
|
-
32
|
|
58
|
-
33
|
|
59
|
-
34
|
|
60
|
-
35
|
|
61
|
-
36
|
|
62
|
-
37
|
|
63
|
-
38
|
|
64
|
-
39
|
|
65
|
-
40
|
|
66
|
-
41
|
|
67
|
-
42
|
|
68
|
-
43
|
|
69
|
-
44
|
|
70
|
-
45
|
|
71
|
-
46
|
|
72
|
-
47
|
|
73
|
-
48
|
|
74
|
-
49
|
|
75
|
-
50
|
|
76
|
-
51
|
|
77
|
-
52
|
|
78
|
-
53
|
|
79
|
-
54
|
|
80
|
-
55
|
|
81
|
-
56
|
|
82
|
-
57
|
|
83
|
-
58
|
|
84
|
-
59
|
|
85
|
-
60
|
|
86
|
-
61
|
|
87
|
-
62</td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
|
|
88
|
-
<span class="cline-any cline-neutral"> </span>
|
|
89
|
-
<span class="cline-any cline-neutral"> </span>
|
|
90
|
-
<span class="cline-any cline-yes">3x</span>
|
|
91
|
-
<span class="cline-any cline-yes">36x</span>
|
|
92
|
-
<span class="cline-any cline-neutral"> </span>
|
|
93
|
-
<span class="cline-any cline-neutral"> </span>
|
|
94
|
-
<span class="cline-any cline-neutral"> </span>
|
|
95
|
-
<span class="cline-any cline-yes">36x</span>
|
|
96
|
-
<span class="cline-any cline-yes">36x</span>
|
|
97
|
-
<span class="cline-any cline-yes">36x</span>
|
|
98
|
-
<span class="cline-any cline-yes">36x</span>
|
|
99
|
-
<span class="cline-any cline-yes">36x</span>
|
|
100
|
-
<span class="cline-any cline-yes">18x</span>
|
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
|
102
|
-
<span class="cline-any cline-neutral"> </span>
|
|
103
|
-
<span class="cline-any cline-neutral"> </span>
|
|
104
|
-
<span class="cline-any cline-neutral"> </span>
|
|
105
|
-
<span class="cline-any cline-neutral"> </span>
|
|
106
|
-
<span class="cline-any cline-neutral"> </span>
|
|
107
|
-
<span class="cline-any cline-neutral"> </span>
|
|
108
|
-
<span class="cline-any cline-neutral"> </span>
|
|
109
|
-
<span class="cline-any cline-yes">3x</span>
|
|
110
|
-
<span class="cline-any cline-neutral"> </span>
|
|
111
|
-
<span class="cline-any cline-neutral"> </span>
|
|
112
|
-
<span class="cline-any cline-yes">36x</span>
|
|
113
|
-
<span class="cline-any cline-yes">36x</span>
|
|
114
|
-
<span class="cline-any cline-yes">36x</span>
|
|
115
|
-
<span class="cline-any cline-yes">36x</span>
|
|
116
|
-
<span class="cline-any cline-yes">36x</span>
|
|
117
|
-
<span class="cline-any cline-yes">36x</span>
|
|
118
|
-
<span class="cline-any cline-yes">36x</span>
|
|
119
|
-
<span class="cline-any cline-yes">36x</span>
|
|
120
|
-
<span class="cline-any cline-yes">36x</span>
|
|
121
|
-
<span class="cline-any cline-neutral"> </span>
|
|
122
|
-
<span class="cline-any cline-neutral"> </span>
|
|
123
|
-
<span class="cline-any cline-yes">18x</span>
|
|
124
|
-
<span class="cline-any cline-neutral"> </span>
|
|
125
|
-
<span class="cline-any cline-neutral"> </span>
|
|
126
|
-
<span class="cline-any cline-neutral"> </span>
|
|
127
|
-
<span class="cline-any cline-neutral"> </span>
|
|
128
|
-
<span class="cline-any cline-neutral"> </span>
|
|
129
|
-
<span class="cline-any cline-neutral"> </span>
|
|
130
|
-
<span class="cline-any cline-neutral"> </span>
|
|
131
|
-
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-neutral"> </span>
|
|
133
|
-
<span class="cline-any cline-neutral"> </span>
|
|
134
|
-
<span class="cline-any cline-neutral"> </span>
|
|
135
|
-
<span class="cline-any cline-neutral"> </span>
|
|
136
|
-
<span class="cline-any cline-neutral"> </span>
|
|
137
|
-
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-neutral"> </span>
|
|
139
|
-
<span class="cline-any cline-neutral"> </span>
|
|
140
|
-
<span class="cline-any cline-neutral"> </span>
|
|
141
|
-
<span class="cline-any cline-yes">18x</span>
|
|
142
|
-
<span class="cline-any cline-neutral"> </span>
|
|
143
|
-
<span class="cline-any cline-yes">18x</span>
|
|
144
|
-
<span class="cline-any cline-neutral"> </span>
|
|
145
|
-
<span class="cline-any cline-neutral"> </span>
|
|
146
|
-
<span class="cline-any cline-neutral"> </span>
|
|
147
|
-
<span class="cline-any cline-neutral"> </span>
|
|
148
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { Configuration } from './bridge'
|
|
149
|
-
import { PostHog } from './posthog'
|
|
150
|
-
|
|
151
|
-
const defaults = {
|
|
152
|
-
android: ({ collectDeviceId = true }: Partial<Configuration['android']>) => ({
|
|
153
|
-
collectDeviceId
|
|
154
|
-
}),
|
|
155
|
-
ios: ({
|
|
156
|
-
capturePushNotifications = false,
|
|
157
|
-
<span class="branch-1 cbranch-no" title="branch not covered" > captureInAppPurchases = false,</span>
|
|
158
|
-
<span class="branch-1 cbranch-no" title="branch not covered" > shouldUseBluetooth = false,</span>
|
|
159
|
-
<span class="branch-1 cbranch-no" title="branch not covered" > shouldUseLocationServices = false,</span>
|
|
160
|
-
<span class="branch-1 cbranch-no" title="branch not covered" > maxQueueSize = 1000</span>
|
|
161
|
-
}: Partial<Configuration['ios']>) => ({
|
|
162
|
-
captureInAppPurchases,
|
|
163
|
-
capturePushNotifications,
|
|
164
|
-
maxQueueSize,
|
|
165
|
-
shouldUseBluetooth,
|
|
166
|
-
shouldUseLocationServices
|
|
167
|
-
})
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export const configure = async (
|
|
171
|
-
apiKey: string,
|
|
172
|
-
{
|
|
173
|
-
flushAt = 20,
|
|
174
|
-
flushInterval = 30,
|
|
175
|
-
debug = false,
|
|
176
|
-
recordScreenViews = false,
|
|
177
|
-
captureApplicationLifecycleEvents = false,
|
|
178
|
-
<span class="branch-1 cbranch-no" title="branch not covered" > captureDeepLinks = false,</span>
|
|
179
|
-
<span class="branch-1 cbranch-no" title="branch not covered" > host = 'https://app.posthog.com',</span>
|
|
180
|
-
ios = {},
|
|
181
|
-
android = {}
|
|
182
|
-
}: PostHog.Configuration
|
|
183
|
-
): Promise<Configuration> => {
|
|
184
|
-
const config = {
|
|
185
|
-
apiKey,
|
|
186
|
-
captureApplicationLifecycleEvents,
|
|
187
|
-
captureDeepLinks,
|
|
188
|
-
debug,
|
|
189
|
-
flushAt,
|
|
190
|
-
flushInterval,
|
|
191
|
-
host,
|
|
192
|
-
recordScreenViews,
|
|
193
|
-
|
|
194
|
-
context: {
|
|
195
|
-
$lib: 'posthog-react-native',
|
|
196
|
-
$lib_version: require('../package.json').version
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
android: defaults.android(android),
|
|
200
|
-
ios: defaults.ios(ios)
|
|
201
|
-
}
|
|
202
|
-
const json = JSON.stringify(config)
|
|
203
|
-
|
|
204
|
-
return {
|
|
205
|
-
...config,
|
|
206
|
-
json
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
</pre></td></tr>
|
|
210
|
-
</table></pre>
|
|
211
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
212
|
-
</div><!-- /wrapper -->
|
|
213
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
214
|
-
Code coverage
|
|
215
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Mar 29 2022 11:45:52 GMT+0200 (Central European Summer Time)
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
218
|
-
<script src="prettify.js"></script>
|
|
219
|
-
<script>
|
|
220
|
-
window.onload = function () {
|
|
221
|
-
if (typeof prettyPrint === 'function') {
|
|
222
|
-
prettyPrint();
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
</script>
|
|
226
|
-
<script src="sorter.js"></script>
|
|
227
|
-
</body>
|
|
228
|
-
</html>
|