@oodle-ai/mobile-sdk-reactnative 0.0.0-stage → 0.1.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.
- package/LICENSE +201 -0
- package/OodleMobileSdkReactNative.podspec +24 -0
- package/README.md +191 -2
- package/android/build.gradle +55 -0
- package/android/proguard-rules.pro +5 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/ai/oodle/rum/Connectivity.kt +19 -0
- package/android/src/main/java/ai/oodle/rum/CrashReporter.kt +88 -0
- package/android/src/main/java/ai/oodle/rum/DeviceInfo.kt +50 -0
- package/android/src/main/java/ai/oodle/rum/ExitReasons.kt +104 -0
- package/android/src/main/java/ai/oodle/rum/NativeEvents.kt +24 -0
- package/android/src/main/java/ai/oodle/rum/OodleRumModule.kt +96 -0
- package/android/src/main/java/ai/oodle/rum/OodleRumPackage.kt +26 -0
- package/android/src/main/java/ai/oodle/rum/Storage.kt +84 -0
- package/android/src/main/java/ai/oodle/rum/Vitals.kt +188 -0
- package/android/src/main/java/ai/oodle/rum/Watchdog.kt +81 -0
- package/android/src/main/java/ai/oodle/rum/WireframeCapture.kt +398 -0
- package/bin/oodle-rum-upload.mjs +104 -0
- package/ios/OodleCrashReporter.h +16 -0
- package/ios/OodleCrashReporter.m +202 -0
- package/ios/OodleRum.h +18 -0
- package/ios/OodleRum.mm +129 -0
- package/ios/OodleRumImpl.swift +450 -0
- package/ios/WireframeWalker.swift +279 -0
- package/lib/core/clock.d.ts +19 -0
- package/lib/core/clock.js +47 -0
- package/lib/core/clock.js.map +1 -0
- package/lib/core/config.d.ts +142 -0
- package/lib/core/config.js +178 -0
- package/lib/core/config.js.map +1 -0
- package/lib/core/consent.d.ts +5 -0
- package/lib/core/consent.js +33 -0
- package/lib/core/consent.js.map +1 -0
- package/lib/core/context.d.ts +36 -0
- package/lib/core/context.js +172 -0
- package/lib/core/context.js.map +1 -0
- package/lib/core/flags.d.ts +3 -0
- package/lib/core/flags.js +20 -0
- package/lib/core/flags.js.map +1 -0
- package/lib/core/ids.d.ts +7 -0
- package/lib/core/ids.js +40 -0
- package/lib/core/ids.js.map +1 -0
- package/lib/core/internal.d.ts +6 -0
- package/lib/core/internal.js +10 -0
- package/lib/core/internal.js.map +1 -0
- package/lib/core/logger.d.ts +8 -0
- package/lib/core/logger.js +38 -0
- package/lib/core/logger.js.map +1 -0
- package/lib/core/native.d.ts +71 -0
- package/lib/core/native.js +156 -0
- package/lib/core/native.js.map +1 -0
- package/lib/core/rate-limiter.d.ts +7 -0
- package/lib/core/rate-limiter.js +31 -0
- package/lib/core/rate-limiter.js.map +1 -0
- package/lib/core/session.d.ts +51 -0
- package/lib/core/session.js +196 -0
- package/lib/core/session.js.map +1 -0
- package/lib/core/size.d.ts +15 -0
- package/lib/core/size.js +68 -0
- package/lib/core/size.js.map +1 -0
- package/lib/core/tags.d.ts +10 -0
- package/lib/core/tags.js +33 -0
- package/lib/core/tags.js.map +1 -0
- package/lib/core/telemetry.d.ts +6 -0
- package/lib/core/telemetry.js +37 -0
- package/lib/core/telemetry.js.map +1 -0
- package/lib/core/tracing.d.ts +9 -0
- package/lib/core/tracing.js +57 -0
- package/lib/core/tracing.js.map +1 -0
- package/lib/core/transport.d.ts +76 -0
- package/lib/core/transport.js +560 -0
- package/lib/core/transport.js.map +1 -0
- package/lib/core/user.d.ts +12 -0
- package/lib/core/user.js +41 -0
- package/lib/core/user.js.map +1 -0
- package/lib/events/actions.d.ts +13 -0
- package/lib/events/actions.js +147 -0
- package/lib/events/actions.js.map +1 -0
- package/lib/events/emit.d.ts +21 -0
- package/lib/events/emit.js +144 -0
- package/lib/events/emit.js.map +1 -0
- package/lib/events/errors.d.ts +19 -0
- package/lib/events/errors.js +257 -0
- package/lib/events/errors.js.map +1 -0
- package/lib/events/lifecycle.d.ts +7 -0
- package/lib/events/lifecycle.js +101 -0
- package/lib/events/lifecycle.js.map +1 -0
- package/lib/events/longtasks.d.ts +2 -0
- package/lib/events/longtasks.js +42 -0
- package/lib/events/longtasks.js.map +1 -0
- package/lib/events/resources.d.ts +15 -0
- package/lib/events/resources.js +156 -0
- package/lib/events/resources.js.map +1 -0
- package/lib/events/tap-target.d.ts +42 -0
- package/lib/events/tap-target.js +191 -0
- package/lib/events/tap-target.js.map +1 -0
- package/lib/events/view-state.d.ts +13 -0
- package/lib/events/view-state.js +25 -0
- package/lib/events/view-state.js.map +1 -0
- package/lib/events/views.d.ts +21 -0
- package/lib/events/views.js +347 -0
- package/lib/events/views.js.map +1 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/navigation/react-navigation.d.ts +33 -0
- package/lib/navigation/react-navigation.js +61 -0
- package/lib/navigation/react-navigation.js.map +1 -0
- package/lib/react/OodlePrivacy.d.ts +15 -0
- package/lib/react/OodlePrivacy.js +13 -0
- package/lib/react/OodlePrivacy.js.map +1 -0
- package/lib/react/OodleProvider.d.ts +18 -0
- package/lib/react/OodleProvider.js +72 -0
- package/lib/react/OodleProvider.js.map +1 -0
- package/lib/replay/recorder.d.ts +22 -0
- package/lib/replay/recorder.js +317 -0
- package/lib/replay/recorder.js.map +1 -0
- package/lib/replay/rrweb.d.ts +105 -0
- package/lib/replay/rrweb.js +335 -0
- package/lib/replay/rrweb.js.map +1 -0
- package/lib/rum.d.ts +52 -0
- package/lib/rum.js +281 -0
- package/lib/rum.js.map +1 -0
- package/lib/specs/NativeOodleRum.d.ts +43 -0
- package/lib/specs/NativeOodleRum.js +5 -0
- package/lib/specs/NativeOodleRum.js.map +1 -0
- package/lib/version.d.ts +1 -0
- package/lib/version.js +6 -0
- package/lib/version.js.map +1 -0
- package/package.json +91 -4
- package/react-native.config.js +10 -0
- package/src/core/clock.ts +43 -0
- package/src/core/config.ts +344 -0
- package/src/core/consent.ts +32 -0
- package/src/core/context.ts +189 -0
- package/src/core/flags.ts +15 -0
- package/src/core/ids.ts +35 -0
- package/src/core/internal.ts +6 -0
- package/src/core/logger.ts +37 -0
- package/src/core/native.ts +201 -0
- package/src/core/rate-limiter.ts +34 -0
- package/src/core/session.ts +209 -0
- package/src/core/size.ts +79 -0
- package/src/core/tags.ts +30 -0
- package/src/core/telemetry.ts +35 -0
- package/src/core/tracing.ts +60 -0
- package/src/core/transport.ts +590 -0
- package/src/core/user.ts +45 -0
- package/src/events/actions.ts +157 -0
- package/src/events/emit.ts +131 -0
- package/src/events/errors.ts +283 -0
- package/src/events/lifecycle.ts +102 -0
- package/src/events/longtasks.ts +40 -0
- package/src/events/resources.ts +167 -0
- package/src/events/tap-target.ts +210 -0
- package/src/events/view-state.ts +30 -0
- package/src/events/views.ts +356 -0
- package/src/index.ts +34 -0
- package/src/navigation/react-navigation.ts +72 -0
- package/src/react/OodlePrivacy.tsx +25 -0
- package/src/react/OodleProvider.tsx +88 -0
- package/src/replay/recorder.ts +310 -0
- package/src/replay/rrweb.ts +460 -0
- package/src/rum.ts +295 -0
- package/src/specs/NativeOodleRum.ts +51 -0
- package/src/version.ts +2 -0
package/src/rum.ts
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import {
|
|
3
|
+
getConfig,
|
|
4
|
+
resolveConfig,
|
|
5
|
+
setConfig,
|
|
6
|
+
type OodleRumConfig,
|
|
7
|
+
type TagValue,
|
|
8
|
+
type TrackingConsent,
|
|
9
|
+
} from './core/config';
|
|
10
|
+
import { getConsent, onConsentChange, setConsentState } from './core/consent';
|
|
11
|
+
import { saveLastContext, setReplayIdProvider } from './core/context';
|
|
12
|
+
import { addFeatureFlag as addFlag } from './core/flags';
|
|
13
|
+
import { logger, setVerbosity } from './core/logger';
|
|
14
|
+
import { hasNative, native } from './core/native';
|
|
15
|
+
import {
|
|
16
|
+
isSessionExpired,
|
|
17
|
+
onSessionRenew,
|
|
18
|
+
peekSession,
|
|
19
|
+
setSampleRates,
|
|
20
|
+
stopSession as endSession,
|
|
21
|
+
} from './core/session';
|
|
22
|
+
import { initTags, removeTag as dropTag, setTags as putTags } from './core/tags';
|
|
23
|
+
import { takeTelemetry } from './core/telemetry';
|
|
24
|
+
import {
|
|
25
|
+
TELEMETRY_BATCH_KEY,
|
|
26
|
+
clearAll,
|
|
27
|
+
enqueue,
|
|
28
|
+
flush as flushTransport,
|
|
29
|
+
restoreOutbox,
|
|
30
|
+
resume,
|
|
31
|
+
setCanSend,
|
|
32
|
+
setReplayDropHandler,
|
|
33
|
+
} from './core/transport';
|
|
34
|
+
import { clearUser as dropUser, setUser as putUser, type UserInfo } from './core/user';
|
|
35
|
+
import * as actions from './events/actions';
|
|
36
|
+
import {
|
|
37
|
+
addError as recordError,
|
|
38
|
+
drainNativeEvents,
|
|
39
|
+
installConsoleTracking,
|
|
40
|
+
installErrorTracking,
|
|
41
|
+
reportPendingCrash,
|
|
42
|
+
} from './events/errors';
|
|
43
|
+
import { installLifecycle } from './events/lifecycle';
|
|
44
|
+
import { installResourceTracking } from './events/resources';
|
|
45
|
+
import * as views from './events/views';
|
|
46
|
+
import {
|
|
47
|
+
flushReplay,
|
|
48
|
+
initReplay,
|
|
49
|
+
onReplayBackground,
|
|
50
|
+
onReplayForeground,
|
|
51
|
+
onReplaySessionRenew,
|
|
52
|
+
onSegmentDropped,
|
|
53
|
+
onViewChanged,
|
|
54
|
+
replayIdForEvents,
|
|
55
|
+
syncRecording,
|
|
56
|
+
} from './replay/recorder';
|
|
57
|
+
import { isoTime } from './core/clock';
|
|
58
|
+
|
|
59
|
+
const TELEMETRY_INTERVAL_MS = 60_000;
|
|
60
|
+
const MAX_BUFFERED_CALLS = 100;
|
|
61
|
+
|
|
62
|
+
let initialized = false;
|
|
63
|
+
let telemetryTimer: ReturnType<typeof setInterval> | null = null;
|
|
64
|
+
/** Calls made before init(). They run, in order, once init() succeeds. */
|
|
65
|
+
let buffered: Array<() => void> = [];
|
|
66
|
+
|
|
67
|
+
function whenReady(fn: () => void) {
|
|
68
|
+
if (initialized) {
|
|
69
|
+
try {
|
|
70
|
+
fn();
|
|
71
|
+
} catch (e) {
|
|
72
|
+
logger.debug('call failed', e);
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (buffered.length < MAX_BUFFERED_CALLS) buffered.push(fn);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function flushTelemetry() {
|
|
80
|
+
const counters = takeTelemetry();
|
|
81
|
+
if (!counters) return;
|
|
82
|
+
enqueue(TELEMETRY_BATCH_KEY, {
|
|
83
|
+
_type: 'sdk_telemetry',
|
|
84
|
+
timestamp: isoTime(),
|
|
85
|
+
session_id: peekSession()?.id ?? '',
|
|
86
|
+
...counters,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function init(input: OodleRumConfig): boolean {
|
|
91
|
+
if (initialized) {
|
|
92
|
+
logger.warn('init() was already called; this call is ignored');
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
const { config, error } = resolveConfig(input, Platform.OS);
|
|
96
|
+
if (!config) {
|
|
97
|
+
logger.error(`init() failed: ${error}`);
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
setVerbosity(config.verbosity);
|
|
101
|
+
setConfig(config);
|
|
102
|
+
setConsentState(config.trackingConsent);
|
|
103
|
+
setSampleRates(config.sessionSampleRate, config.replay.sampleRate);
|
|
104
|
+
initTags(config.tags);
|
|
105
|
+
|
|
106
|
+
setCanSend(() => getConsent() === 'granted');
|
|
107
|
+
setReplayDropHandler(onSegmentDropped);
|
|
108
|
+
setReplayIdProvider(replayIdForEvents);
|
|
109
|
+
onSessionRenew((session, previous) => {
|
|
110
|
+
onReplaySessionRenew(previous);
|
|
111
|
+
views.restartViewForNewSession(session.id);
|
|
112
|
+
});
|
|
113
|
+
onConsentChange((next) => {
|
|
114
|
+
if (next === 'granted') resume();
|
|
115
|
+
else if (next === 'not-granted') clearAll();
|
|
116
|
+
syncRecording();
|
|
117
|
+
});
|
|
118
|
+
views.onViewStart(() => onViewChanged());
|
|
119
|
+
|
|
120
|
+
// The crash report reads the context the last run saved, so it goes
|
|
121
|
+
// before anything in this run saves a new one.
|
|
122
|
+
if (hasNative()) {
|
|
123
|
+
reportPendingCrash();
|
|
124
|
+
if (config.nativeCrashReporting) native.enableCrashReporting();
|
|
125
|
+
if (config.trackAnrs) native.startWatchdog(config.anrThresholdMs);
|
|
126
|
+
if (config.vitals) native.startVitals();
|
|
127
|
+
}
|
|
128
|
+
restoreOutbox();
|
|
129
|
+
|
|
130
|
+
if (config.trackErrors) installErrorTracking();
|
|
131
|
+
if (config.trackConsole) installConsoleTracking();
|
|
132
|
+
if (config.trackResources) installResourceTracking();
|
|
133
|
+
installLifecycle({
|
|
134
|
+
onBackground: () => {
|
|
135
|
+
onReplayBackground();
|
|
136
|
+
flushTelemetry();
|
|
137
|
+
},
|
|
138
|
+
onForeground: () => onReplayForeground(),
|
|
139
|
+
});
|
|
140
|
+
telemetryTimer = setInterval(flushTelemetry, TELEMETRY_INTERVAL_MS);
|
|
141
|
+
|
|
142
|
+
initialized = true;
|
|
143
|
+
const calls = buffered;
|
|
144
|
+
buffered = [];
|
|
145
|
+
for (const fn of calls) whenReady(fn);
|
|
146
|
+
initReplay();
|
|
147
|
+
saveLastContext();
|
|
148
|
+
logger.debug('initialized', { service: config.service, endpoint: config.endpoint });
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const OodleRum = {
|
|
153
|
+
/**
|
|
154
|
+
* Starts the SDK. Call it once, as early as possible. Returns false when
|
|
155
|
+
* the configuration is not usable; the reason is logged. All other
|
|
156
|
+
* methods are safe to call before init(), or when it is never called.
|
|
157
|
+
*/
|
|
158
|
+
init,
|
|
159
|
+
|
|
160
|
+
isInitialized(): boolean {
|
|
161
|
+
return initialized;
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/** Starts a screen view. A view with another key stops the current one. */
|
|
165
|
+
startView(key: string, name?: string, attributes?: Record<string, unknown>) {
|
|
166
|
+
const at = Date.now();
|
|
167
|
+
whenReady(() => views.startView(key, name, attributes, at));
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
stopView(key?: string) {
|
|
171
|
+
whenReady(() => views.stopView(key));
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
/** Records a named user action. */
|
|
175
|
+
addAction(name: string, attributes?: Record<string, unknown>) {
|
|
176
|
+
whenReady(() => actions.addAction(name, attributes));
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
/** Records a handled error. */
|
|
180
|
+
addError(error: unknown, attributes?: Record<string, unknown>) {
|
|
181
|
+
whenReady(() => recordError(error, attributes, 'custom'));
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
/** Records a custom event with properties. */
|
|
185
|
+
trackEvent(name: string, properties?: Record<string, unknown>) {
|
|
186
|
+
whenReady(() => actions.trackEvent(name, properties));
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
/** Records the time since the current view started, under a name. */
|
|
190
|
+
addTiming(name: string) {
|
|
191
|
+
const at = Date.now();
|
|
192
|
+
whenReady(() => {
|
|
193
|
+
const elapsed = views.viewElapsedMs();
|
|
194
|
+
if (elapsed < 0 || !name) return;
|
|
195
|
+
actions.trackEvent(`timing:${name}`, { value_ms: elapsed - (Date.now() - at) });
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
/** Marks the current view as loaded (`view_loading_time_ms`). */
|
|
200
|
+
reportViewLoaded(overwrite = false) {
|
|
201
|
+
whenReady(() => views.reportViewLoaded(overwrite));
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
/** Marks the app as fully displayed after a cold start (`app_ttfd_ms`). */
|
|
205
|
+
reportAppFullyDisplayed() {
|
|
206
|
+
whenReady(() => views.reportAppFullyDisplayed());
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
/** Identifies the user. Keys other than id, name and email go out as `usr.<key>` tags. */
|
|
210
|
+
setUser(user: UserInfo) {
|
|
211
|
+
if (!user || !user.id) {
|
|
212
|
+
logger.warn('setUser() needs an id');
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
putUser(user);
|
|
216
|
+
if (initialized) saveLastContext();
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
clearUser() {
|
|
220
|
+
dropUser();
|
|
221
|
+
if (initialized) saveLastContext();
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
/** Adds or replaces tags on every later event. */
|
|
225
|
+
setTags(tags: Record<string, TagValue>) {
|
|
226
|
+
putTags(tags);
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
removeTag(key: string) {
|
|
230
|
+
dropTag(key);
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
addFeatureFlag(name: string, value: unknown) {
|
|
234
|
+
addFlag(name, value);
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* `pending` holds events on the device; `granted` sends them;
|
|
239
|
+
* `not-granted` deletes them and stops collection and replay.
|
|
240
|
+
*/
|
|
241
|
+
setTrackingConsent(consent: TrackingConsent) {
|
|
242
|
+
if (consent !== 'granted' && consent !== 'pending' && consent !== 'not-granted') return;
|
|
243
|
+
setConsentState(consent);
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
getTrackingConsent(): TrackingConsent {
|
|
247
|
+
return getConsent();
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
/** Ends the session. The next view or event starts a new one. */
|
|
251
|
+
stopSession() {
|
|
252
|
+
whenReady(() => {
|
|
253
|
+
views.stopView();
|
|
254
|
+
flushReplay();
|
|
255
|
+
endSession();
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
/** The current session id, or an empty string when there is none. */
|
|
260
|
+
getSessionId(): string {
|
|
261
|
+
if (!initialized || !getConfig()) return '';
|
|
262
|
+
const s = peekSession();
|
|
263
|
+
return s && !isSessionExpired() && s.sampled ? s.id : '';
|
|
264
|
+
},
|
|
265
|
+
|
|
266
|
+
startOperation(name: string, key?: string) {
|
|
267
|
+
whenReady(() => actions.startOperation(name, key));
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
succeedOperation(name: string, key?: string, attributes?: Record<string, unknown>) {
|
|
271
|
+
whenReady(() => actions.succeedOperation(name, key, attributes));
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
failOperation(name: string, key?: string, reason?: string, attributes?: Record<string, unknown>) {
|
|
275
|
+
whenReady(() => actions.failOperation(name, key, reason, attributes));
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
/** Sends everything queued now. */
|
|
279
|
+
flush() {
|
|
280
|
+
if (!initialized) return;
|
|
281
|
+
drainNativeEvents();
|
|
282
|
+
views.flushActiveView();
|
|
283
|
+
flushReplay();
|
|
284
|
+
flushTransport();
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/** Test hook: forget init() so a test can start again. */
|
|
289
|
+
export function __resetForTests() {
|
|
290
|
+
if (telemetryTimer) clearInterval(telemetryTimer);
|
|
291
|
+
telemetryTimer = null;
|
|
292
|
+
initialized = false;
|
|
293
|
+
buffered = [];
|
|
294
|
+
setConfig(null);
|
|
295
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Native half of the SDK. Structured results cross the bridge as JSON
|
|
6
|
+
* strings, so the iOS and Android implementations stay small and the
|
|
7
|
+
* codegen output does not need typed structs.
|
|
8
|
+
*
|
|
9
|
+
* Methods that return a value are synchronous. The SDK calls them from
|
|
10
|
+
* paths that cannot wait for a later tick, such as a fatal JS error
|
|
11
|
+
* that ends the process right after the handler returns.
|
|
12
|
+
*/
|
|
13
|
+
export interface Spec extends TurboModule {
|
|
14
|
+
/** Device, OS, app and process facts. JSON object. */
|
|
15
|
+
getDeviceInfo(): string;
|
|
16
|
+
|
|
17
|
+
storageGet(key: string): string | null;
|
|
18
|
+
storageSet(key: string, value: string): boolean;
|
|
19
|
+
storageRemove(key: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Writes on a background thread. For large values on paths that can
|
|
22
|
+
* wait. A later synchronous write of the same key always wins.
|
|
23
|
+
*/
|
|
24
|
+
storageSetAsync(key: string, value: string): Promise<boolean>;
|
|
25
|
+
|
|
26
|
+
/** Installs the native uncaught exception and signal handlers. */
|
|
27
|
+
enableCrashReporting(): boolean;
|
|
28
|
+
/** Returns the crash that ended the previous run, as JSON, once. */
|
|
29
|
+
consumePendingCrash(): string | null;
|
|
30
|
+
|
|
31
|
+
/** Starts the main thread watchdog (ANR on Android, hang on iOS). */
|
|
32
|
+
startWatchdog(thresholdMs: number): boolean;
|
|
33
|
+
/** Returns and clears the native events since the last call. JSON array. */
|
|
34
|
+
drainNativeEvents(): string;
|
|
35
|
+
|
|
36
|
+
startVitals(): boolean;
|
|
37
|
+
/** Returns and resets frame, memory and CPU stats. JSON object. */
|
|
38
|
+
collectVitals(): string;
|
|
39
|
+
|
|
40
|
+
/** wifi, cellular, ethernet, other, none or unknown. */
|
|
41
|
+
getConnectivity(): string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Walks the visible view tree on the main thread. JSON object. With
|
|
45
|
+
* `skipUnchanged`, returns `{"unchanged":true}` when the screen did not
|
|
46
|
+
* change since the last walk.
|
|
47
|
+
*/
|
|
48
|
+
captureWireframes(optionsJson: string): Promise<string>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default TurboModuleRegistry.get<Spec>('OodleRum');
|
package/src/version.ts
ADDED