@logbrew/react-native 0.1.38 → 0.1.40
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/LogBrewReactNative.podspec +1 -1
- package/README.md +17 -15
- package/android-native-diagnostics.d.ts +15 -5
- package/android-native-diagnostics.js +170 -94
- package/apollo.cjs +435 -226
- package/apollo.d.cts +2 -70
- package/apollo.d.ts +24 -12
- package/apollo.js +438 -221
- package/apple-native-diagnostics-config.js +176 -0
- package/apple-native-diagnostics-context.js +232 -0
- package/apple-native-diagnostics-module.js +229 -0
- package/apple-native-diagnostics.d.ts +42 -11
- package/apple-native-diagnostics.js +60 -389
- package/expo.cjs +29 -16
- package/expo.d.ts +10 -9
- package/expo.js +4 -3
- package/fatal-admission.cjs +113 -0
- package/fatal-record.cjs +317 -0
- package/fatal-replay.cjs +297 -508
- package/global-errors-capture.cjs +369 -0
- package/global-errors-event.cjs +174 -0
- package/global-errors-support.cjs +128 -0
- package/global-errors.cjs +75 -351
- package/global-errors.d.cts +29 -278
- package/global-errors.d.ts +57 -27
- package/global-errors.js +7 -2
- package/global-errors.native.js +83 -48
- package/index-breadcrumbs.cjs +139 -0
- package/index-errors.cjs +167 -0
- package/index-events.cjs +365 -0
- package/index-navigation.cjs +327 -0
- package/index-random.cjs +120 -0
- package/index-react.cjs +189 -0
- package/index-spans.cjs +190 -0
- package/index-trace-fetch.cjs +322 -0
- package/index-trace.cjs +335 -0
- package/index-transport.cjs +201 -0
- package/index-values.cjs +232 -0
- package/index.cjs +95 -1220
- package/index.d.cts +2 -505
- package/index.d.ts +130 -469
- package/index.native.d.ts +146 -22
- package/index.native.js +184 -159
- package/instrumentation-fetch.cjs +113 -0
- package/instrumentation-install.cjs +241 -0
- package/instrumentation-runtime.cjs +65 -0
- package/instrumentation-teardown.cjs +93 -0
- package/instrumentation-values.cjs +282 -0
- package/instrumentation-xhr-request.cjs +298 -0
- package/instrumentation-xhr.cjs +233 -0
- package/instrumentation.cjs +110 -599
- package/instrumentation.d.cts +2 -84
- package/instrumentation.d.ts +22 -8
- package/ios/AppleDiagnostics/LBRNAppleNativeDiagnostics.swift +1 -1
- package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryEngine.swift +7 -1
- package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryEngineAutomatic.swift +36 -4
- package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryEngineQueue.swift +17 -0
- package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryLifecycle.swift +2 -0
- package/ios/GeneratedAppleDiagnostics/LogBrew/Transport.swift +41 -6
- package/ios/GeneratedAppleDiagnostics/SOURCE-MANIFEST.json +5 -5
- package/lifecycle.cjs +181 -78
- package/lifecycle.d.cts +1 -50
- package/lifecycle.d.ts +17 -6
- package/metadata.cjs +279 -114
- package/metro-debug-id.cjs +296 -0
- package/metro-serializer.cjs +219 -0
- package/metro.cjs +153 -297
- package/metro.d.cts +2 -57
- package/metro.d.ts +27 -13
- package/metro.js +2 -3
- package/native-bridge-async.cjs +165 -0
- package/native-bridge-scope.cjs +148 -0
- package/native-bridge.cjs +83 -186
- package/native-bridge.d.cts +2 -94
- package/native-bridge.d.ts +28 -15
- package/native-client-bindings.js +230 -0
- package/native-diagnostics-values.js +120 -0
- package/native-module-lookup.js +31 -0
- package/native-null.js +3 -0
- package/null-value.cjs +4 -0
- package/package.json +44 -2
- package/persistent-delivery-store.js +247 -0
- package/persistent-delivery.native.js +183 -261
- package/promise-rejection-handlers.cjs +368 -0
- package/promise-rejections.cjs +169 -361
- package/react-native.config.js +3 -1
- package/release-artifacts-files.cjs +94 -0
- package/release-artifacts-options.cjs +182 -0
- package/release-artifacts.cjs +278 -207
- package/release-artifacts.d.cts +2 -55
- package/release-artifacts.d.ts +18 -7
- package/release-artifacts.js +2 -4
- package/resource-fetch-graphql.cjs +265 -0
- package/resource-fetch-size.cjs +156 -0
- package/resource-fetch.cjs +227 -428
- package/resource-fetch.d.cts +1 -60
- package/resource-fetch.d.ts +17 -6
- package/scripts/sync-apple-native-sources.mjs +101 -53
- package/types/capture.d.ts +95 -0
- package/types/config.d.ts +85 -0
- package/types/defaults.d.ts +55 -0
- package/types/events.d.ts +203 -0
- package/types/provider.d.ts +81 -0
- package/types/trace.d.ts +104 -0
package/lifecycle.cjs
CHANGED
|
@@ -1,13 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { SdkError } = require("@logbrew/sdk");
|
|
4
|
-
const {
|
|
5
|
-
createReactNativeSpanAttributes,
|
|
6
|
-
createReactNativeTraceContext,
|
|
7
|
-
getActiveLogBrewTrace,
|
|
8
|
-
getReactNativeContext
|
|
9
|
-
} = require("./index.cjs");
|
|
4
|
+
const { indexRuntime, isCallable, readField } = require("./instrumentation-values.cjs");
|
|
10
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @import { LogBrewClient, Metadata, SpanAttributes } from "@logbrew/sdk"
|
|
8
|
+
* @import { ReactNativeSpanEvent } from "./index.cjs"
|
|
9
|
+
* @import { AppStateInput, PlatformInput, TraceInput } from "./instrumentation-values.cjs"
|
|
10
|
+
* @import { LifecycleListenerOptions } from "./instrumentation-runtime.cjs"
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @typedef {{ readonly fromState: string | undefined, readonly screen: string | undefined, readonly toState: string | undefined }} LifecycleIdContext
|
|
15
|
+
* @typedef {{
|
|
16
|
+
* readonly appState?: AppStateInput | undefined,
|
|
17
|
+
* readonly durationMs?: number | undefined,
|
|
18
|
+
* readonly fromState?: unknown,
|
|
19
|
+
* readonly id?: string | undefined,
|
|
20
|
+
* readonly idFactory?: ((context: LifecycleIdContext) => string) | undefined,
|
|
21
|
+
* readonly metadata?: Readonly<Metadata> | undefined,
|
|
22
|
+
* readonly name?: string | undefined,
|
|
23
|
+
* readonly now?: (() => string) | undefined,
|
|
24
|
+
* readonly platform?: PlatformInput | undefined,
|
|
25
|
+
* readonly screen?: string | undefined,
|
|
26
|
+
* readonly sessionId?: string | undefined,
|
|
27
|
+
* readonly state?: unknown,
|
|
28
|
+
* readonly status?: SpanAttributes["status"] | undefined,
|
|
29
|
+
* readonly timestamp?: string | undefined,
|
|
30
|
+
* readonly toState?: unknown,
|
|
31
|
+
* readonly trace?: TraceInput | undefined
|
|
32
|
+
* }} LifecycleSpanInput
|
|
33
|
+
* @typedef {{
|
|
34
|
+
* readonly appState: AppStateInput,
|
|
35
|
+
* readonly client: LogBrewClient,
|
|
36
|
+
* readonly options: Readonly<{ metadata: Readonly<Metadata>, now: () => string, nowMs: () => number }> & LifecycleListenerOptions
|
|
37
|
+
* }} LifecycleContext
|
|
38
|
+
* @typedef {{ readonly changedAtMs: number, readonly state: string | undefined }} LifecycleMoment
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
const MIN_DURATION_MS = 0;
|
|
42
|
+
|
|
43
|
+
function defaultLifecycleSpanEventId() {
|
|
44
|
+
return `evt_native_lifecycle_${indexRuntime.createReactNativeTraceContext().traceId}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param {unknown} state
|
|
49
|
+
* @returns {string | undefined}
|
|
50
|
+
*/
|
|
51
|
+
function normalizeLifecycleState(state) {
|
|
52
|
+
return typeof state === "string" && state.trim() !== "" ? state.trim() : undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param {LifecycleSpanInput} [input]
|
|
57
|
+
* @returns {ReactNativeSpanEvent}
|
|
58
|
+
*/
|
|
11
59
|
function createReactNativeLifecycleSpanEvent({
|
|
12
60
|
durationMs, fromState, id, idFactory = defaultLifecycleSpanEventId, metadata = {}, name,
|
|
13
61
|
now = () => new Date().toISOString(), platform, appState, screen, sessionId, state, status = "ok",
|
|
@@ -15,32 +63,52 @@ function createReactNativeLifecycleSpanEvent({
|
|
|
15
63
|
} = {}) {
|
|
16
64
|
const safeFromState = normalizeLifecycleState(fromState);
|
|
17
65
|
const safeToState = normalizeLifecycleState(toState ?? state);
|
|
18
|
-
const transition = [safeFromState, safeToState].filter(
|
|
19
|
-
const spanName = name ?? `app_state:${transition
|
|
20
|
-
const activeTrace = trace ?? getActiveLogBrewTrace() ?? createReactNativeTraceContext();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
66
|
+
const transition = [safeFromState, safeToState].filter(knownState => knownState !== undefined).join("->");
|
|
67
|
+
const spanName = name ?? `app_state:${transition === "" ? "change" : transition}`;
|
|
68
|
+
const activeTrace = trace ?? indexRuntime.getActiveLogBrewTrace() ?? indexRuntime.createReactNativeTraceContext();
|
|
69
|
+
const eventId = id ?? idFactory({ fromState: safeFromState, screen, toState: safeToState });
|
|
70
|
+
const eventTimestamp = timestamp ?? now();
|
|
71
|
+
const attributes = indexRuntime.createReactNativeSpanAttributes({
|
|
72
|
+
durationMs,
|
|
73
|
+
metadata: {
|
|
74
|
+
...indexRuntime.getReactNativeContext({ appState, platform }),
|
|
75
|
+
source: "react-native.lifecycle",
|
|
76
|
+
|
|
77
|
+
appState: safeToState,
|
|
27
78
|
durationMs,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
79
|
+
fromAppState: safeFromState,
|
|
80
|
+
screen,
|
|
81
|
+
sessionId,
|
|
82
|
+
toAppState: safeToState,
|
|
83
|
+
...metadata
|
|
84
|
+
},
|
|
85
|
+
name: spanName,
|
|
86
|
+
status,
|
|
87
|
+
trace: activeTrace
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
id: eventId,
|
|
91
|
+
timestamp: eventTimestamp,
|
|
92
|
+
|
|
93
|
+
attributes
|
|
41
94
|
};
|
|
42
95
|
}
|
|
43
96
|
|
|
97
|
+
/**
|
|
98
|
+
* @param {LogBrewClient | null | undefined} client
|
|
99
|
+
* @returns {asserts client is LogBrewClient}
|
|
100
|
+
*/
|
|
101
|
+
function requireClient(client) {
|
|
102
|
+
if (!client) {
|
|
103
|
+
throw new SdkError("configuration_error", "LogBrew React Native lifecycle helpers require a client");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {LogBrewClient | null | undefined} client
|
|
109
|
+
* @param {LifecycleSpanInput} [input]
|
|
110
|
+
* @returns {ReactNativeSpanEvent}
|
|
111
|
+
*/
|
|
44
112
|
function captureReactNativeLifecycleSpan(client, input = {}) {
|
|
45
113
|
requireClient(client);
|
|
46
114
|
const event = createReactNativeLifecycleSpanEvent(input);
|
|
@@ -48,71 +116,106 @@ function captureReactNativeLifecycleSpan(client, input = {}) {
|
|
|
48
116
|
return event;
|
|
49
117
|
}
|
|
50
118
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
|
|
119
|
+
/**
|
|
120
|
+
* @param {unknown} subscription
|
|
121
|
+
* @returns {() => unknown}
|
|
122
|
+
*/
|
|
123
|
+
function subscriptionRemover(subscription) {
|
|
124
|
+
if (isCallable(subscription)) {
|
|
125
|
+
return subscription;
|
|
58
126
|
}
|
|
127
|
+
if (isCallable(readField(subscription, "remove"))) {
|
|
128
|
+
return () => {
|
|
129
|
+
const remove = readField(subscription, "remove");
|
|
130
|
+
if (!isCallable(remove)) {
|
|
131
|
+
throw new TypeError("subscription.remove is not a function");
|
|
132
|
+
}
|
|
133
|
+
return Reflect.apply(remove, subscription, []);
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return () => undefined;
|
|
137
|
+
}
|
|
59
138
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
139
|
+
/**
|
|
140
|
+
* @param {LifecycleContext} context
|
|
141
|
+
* @param {LifecycleMoment} previous
|
|
142
|
+
* @param {LifecycleMoment} next
|
|
143
|
+
* @returns {LifecycleSpanInput}
|
|
144
|
+
*/
|
|
145
|
+
function lifecycleChangeInput({ appState, options }, previous, next) {
|
|
146
|
+
return {
|
|
147
|
+
appState,
|
|
148
|
+
durationMs: previous.state === undefined ? undefined : Math.max(MIN_DURATION_MS, next.changedAtMs - previous.changedAtMs),
|
|
149
|
+
fromState: previous.state,
|
|
150
|
+
metadata: options.metadata,
|
|
151
|
+
now: options.now,
|
|
152
|
+
platform: options.platform,
|
|
153
|
+
screen: options.screen,
|
|
154
|
+
sessionId: options.sessionId,
|
|
155
|
+
timestamp: options.now(),
|
|
156
|
+
toState: next.state,
|
|
157
|
+
trace: options.trace
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @param {((error: unknown) => void) | undefined} onError
|
|
163
|
+
* @param {unknown} error
|
|
164
|
+
* @returns {void}
|
|
165
|
+
*/
|
|
166
|
+
function reportLifecycleError(onError, error) {
|
|
167
|
+
if (typeof onError === "function") {
|
|
168
|
+
onError(error);
|
|
169
|
+
} else {
|
|
170
|
+
throw error;
|
|
66
171
|
}
|
|
172
|
+
}
|
|
67
173
|
|
|
68
|
-
|
|
174
|
+
/**
|
|
175
|
+
* @param {LifecycleContext} context
|
|
176
|
+
* @param {LifecycleMoment} initial
|
|
177
|
+
* @returns {(nextState: string) => void}
|
|
178
|
+
*/
|
|
179
|
+
function lifecycleChangeListener(context, initial) {
|
|
180
|
+
let previous = initial;
|
|
181
|
+
return (nextState) => {
|
|
69
182
|
try {
|
|
70
183
|
const safeNextState = normalizeLifecycleState(nextState);
|
|
71
184
|
if (safeNextState === undefined) {
|
|
72
185
|
return;
|
|
73
186
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
appState, durationMs, fromState: previousState, metadata, now, platform, screen, sessionId,
|
|
78
|
-
timestamp: now(), toState: safeNextState, trace
|
|
79
|
-
});
|
|
80
|
-
previousState = safeNextState;
|
|
81
|
-
previousChangedAtMs = changedAtMs;
|
|
187
|
+
const next = { changedAtMs: context.options.nowMs(), state: safeNextState };
|
|
188
|
+
captureReactNativeLifecycleSpan(context.client, lifecycleChangeInput(context, previous, next));
|
|
189
|
+
previous = next;
|
|
82
190
|
} catch (error) {
|
|
83
|
-
|
|
84
|
-
onError(error);
|
|
85
|
-
} else {
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
191
|
+
reportLifecycleError(context.options.onError, error);
|
|
88
192
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return subscriptionRemover(subscription);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function requireClient(client) {
|
|
95
|
-
if (!client) {
|
|
96
|
-
throw new SdkError("configuration_error", "LogBrew React Native lifecycle helpers require a client");
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function defaultLifecycleSpanEventId() {
|
|
101
|
-
return `evt_native_lifecycle_${createReactNativeTraceContext().traceId}`;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function normalizeLifecycleState(state) {
|
|
105
|
-
return typeof state === "string" && state.trim() !== "" ? state.trim() : undefined;
|
|
193
|
+
};
|
|
106
194
|
}
|
|
107
195
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
196
|
+
/**
|
|
197
|
+
* @param {LogBrewClient | null | undefined} client
|
|
198
|
+
* @param {AppStateInput | null | undefined} appState
|
|
199
|
+
* @param {LifecycleListenerOptions} [options]
|
|
200
|
+
* @returns {() => unknown}
|
|
201
|
+
*/
|
|
202
|
+
function createAppStateLifecycleSpanListener(client, appState, {
|
|
203
|
+
captureInitialState = false, metadata = {}, now = () => new Date().toISOString(), nowMs = () => Date.now(),
|
|
204
|
+
onError, platform, screen, sessionId, trace
|
|
205
|
+
} = {}) {
|
|
206
|
+
requireClient(client);
|
|
207
|
+
if (!appState || typeof appState.addEventListener !== "function") {
|
|
208
|
+
throw new SdkError("configuration_error", "createAppStateLifecycleSpanListener requires AppState.addEventListener");
|
|
111
209
|
}
|
|
112
|
-
|
|
113
|
-
|
|
210
|
+
const options = { metadata, now, nowMs, onError, platform, screen, sessionId, trace };
|
|
211
|
+
const state = normalizeLifecycleState(appState.currentState);
|
|
212
|
+
const initial = { changedAtMs: nowMs(), state };
|
|
213
|
+
if (captureInitialState && state !== undefined) {
|
|
214
|
+
captureReactNativeLifecycleSpan(client, {
|
|
215
|
+
appState, metadata, now, platform, screen, sessionId, toState: state, trace
|
|
216
|
+
});
|
|
114
217
|
}
|
|
115
|
-
return (
|
|
218
|
+
return subscriptionRemover(appState.addEventListener("change", lifecycleChangeListener({ appState, client, options }, initial)));
|
|
116
219
|
}
|
|
117
220
|
|
|
118
221
|
module.exports = {
|
package/lifecycle.d.cts
CHANGED
|
@@ -1,50 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
ReactNativeAppStateLike,
|
|
4
|
-
ReactNativeContextOptions,
|
|
5
|
-
ReactNativeSpanEvent
|
|
6
|
-
} from "./index.cjs";
|
|
7
|
-
|
|
8
|
-
export type ReactNativeLifecycleSpanInput = ReactNativeContextOptions & {
|
|
9
|
-
durationMs?: number;
|
|
10
|
-
fromState?: string;
|
|
11
|
-
id?: string;
|
|
12
|
-
idFactory?: (context: ReactNativeLifecycleSpanIdFactoryContext) => string;
|
|
13
|
-
name?: string;
|
|
14
|
-
now?: () => string;
|
|
15
|
-
screen?: string;
|
|
16
|
-
sessionId?: string;
|
|
17
|
-
state?: string;
|
|
18
|
-
status?: SpanAttributes["status"];
|
|
19
|
-
timestamp?: string;
|
|
20
|
-
toState?: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type ReactNativeLifecycleSpanIdFactoryContext = {
|
|
24
|
-
fromState?: string;
|
|
25
|
-
screen?: string;
|
|
26
|
-
toState?: string;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type AppStateLifecycleSpanListenerOptions = ReactNativeContextOptions & {
|
|
30
|
-
captureInitialState?: boolean;
|
|
31
|
-
metadata?: Metadata;
|
|
32
|
-
now?: () => string;
|
|
33
|
-
nowMs?: () => number;
|
|
34
|
-
onError?: (error: unknown) => void;
|
|
35
|
-
screen?: string;
|
|
36
|
-
sessionId?: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export declare function createReactNativeLifecycleSpanEvent(
|
|
40
|
-
input?: ReactNativeLifecycleSpanInput
|
|
41
|
-
): ReactNativeSpanEvent;
|
|
42
|
-
export declare function captureReactNativeLifecycleSpan(
|
|
43
|
-
client: LogBrewClient,
|
|
44
|
-
input?: ReactNativeLifecycleSpanInput
|
|
45
|
-
): ReactNativeSpanEvent;
|
|
46
|
-
export declare function createAppStateLifecycleSpanListener(
|
|
47
|
-
client: LogBrewClient,
|
|
48
|
-
appState: ReactNativeAppStateLike,
|
|
49
|
-
options?: AppStateLifecycleSpanListenerOptions
|
|
50
|
-
): () => void;
|
|
1
|
+
export * from "./lifecycle.js";
|
package/lifecycle.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
ReactNativeSpanEvent
|
|
6
6
|
} from "./index.js";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
type ReactNativeLifecycleSpanInput = ReactNativeContextOptions & {
|
|
9
9
|
durationMs?: number;
|
|
10
10
|
fromState?: string;
|
|
11
11
|
id?: string;
|
|
@@ -20,13 +20,13 @@ export type ReactNativeLifecycleSpanInput = ReactNativeContextOptions & {
|
|
|
20
20
|
toState?: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
type ReactNativeLifecycleSpanIdFactoryContext = {
|
|
24
24
|
fromState?: string;
|
|
25
25
|
screen?: string;
|
|
26
26
|
toState?: string;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
type AppStateLifecycleSpanListenerOptions = ReactNativeContextOptions & {
|
|
30
30
|
captureInitialState?: boolean;
|
|
31
31
|
metadata?: Metadata;
|
|
32
32
|
now?: () => string;
|
|
@@ -36,15 +36,26 @@ export type AppStateLifecycleSpanListenerOptions = ReactNativeContextOptions & {
|
|
|
36
36
|
sessionId?: string;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
declare function createReactNativeLifecycleSpanEvent(
|
|
40
40
|
input?: ReactNativeLifecycleSpanInput
|
|
41
41
|
): ReactNativeSpanEvent;
|
|
42
|
-
|
|
42
|
+
declare function captureReactNativeLifecycleSpan(
|
|
43
43
|
client: LogBrewClient,
|
|
44
44
|
input?: ReactNativeLifecycleSpanInput
|
|
45
45
|
): ReactNativeSpanEvent;
|
|
46
|
-
|
|
46
|
+
declare function createAppStateLifecycleSpanListener(
|
|
47
47
|
client: LogBrewClient,
|
|
48
48
|
appState: ReactNativeAppStateLike,
|
|
49
49
|
options?: AppStateLifecycleSpanListenerOptions
|
|
50
50
|
): () => void;
|
|
51
|
+
|
|
52
|
+
export type {
|
|
53
|
+
AppStateLifecycleSpanListenerOptions,
|
|
54
|
+
ReactNativeLifecycleSpanIdFactoryContext,
|
|
55
|
+
ReactNativeLifecycleSpanInput
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
createReactNativeLifecycleSpanEvent,
|
|
59
|
+
captureReactNativeLifecycleSpan,
|
|
60
|
+
createAppStateLifecycleSpanListener
|
|
61
|
+
};
|