@logbrew/react-native 0.1.39 → 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/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 -1243
- 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/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 +43 -1
- 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/global-errors.d.cts
CHANGED
|
@@ -1,278 +1,29 @@
|
|
|
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
|
-
code: ReactNativePromiseRejectionDiagnosticCode;
|
|
31
|
-
}>;
|
|
32
|
-
|
|
33
|
-
export type ReactNativeGlobalErrorDiagnosticCode =
|
|
34
|
-
| "capture_admission_unavailable"
|
|
35
|
-
| "capture_failed"
|
|
36
|
-
| "capture_filtered"
|
|
37
|
-
| "duplicate_capture_suppressed"
|
|
38
|
-
| "fatal_acknowledge_failed"
|
|
39
|
-
| "fatal_admission_unavailable"
|
|
40
|
-
| "fatal_capture_requires_sync_store"
|
|
41
|
-
| "fatal_corrupt_record_discarded"
|
|
42
|
-
| "fatal_discard_failed"
|
|
43
|
-
| "fatal_record_dropped"
|
|
44
|
-
| "fatal_replay_admission_unavailable"
|
|
45
|
-
| "fatal_replay_failed"
|
|
46
|
-
| "fatal_replay_not_admitted"
|
|
47
|
-
| "fatal_store_failed"
|
|
48
|
-
| "handler_unavailable"
|
|
49
|
-
| "recursive_capture_suppressed";
|
|
50
|
-
|
|
51
|
-
export type ReactNativeGlobalErrorDiagnostic = Readonly<{
|
|
52
|
-
code: ReactNativeGlobalErrorDiagnosticCode;
|
|
53
|
-
}>;
|
|
54
|
-
|
|
55
|
-
export type ReactNativeGlobalErrorHealth = Readonly<{
|
|
56
|
-
active: boolean;
|
|
57
|
-
capturedEvents: number;
|
|
58
|
-
lastOutcome:
|
|
59
|
-
| "admission_unavailable"
|
|
60
|
-
| "capture_failed"
|
|
61
|
-
| "captured"
|
|
62
|
-
| "duplicate_suppressed"
|
|
63
|
-
| "fatal_stored"
|
|
64
|
-
| "fatal_store_failed"
|
|
65
|
-
| "fatal_unsupported"
|
|
66
|
-
| "filtered"
|
|
67
|
-
| "handler_replaced"
|
|
68
|
-
| "idle"
|
|
69
|
-
| "recursive_suppressed"
|
|
70
|
-
| "remove_failed"
|
|
71
|
-
| "removed"
|
|
72
|
-
| "unavailable";
|
|
73
|
-
suppressedEvents: number;
|
|
74
|
-
}>;
|
|
75
|
-
|
|
76
|
-
export type ReactNativePromiseRejectionHealth = Readonly<{
|
|
77
|
-
available: boolean;
|
|
78
|
-
capturedEvents: number;
|
|
79
|
-
evictedRejections: number;
|
|
80
|
-
handledLaterEvents: number;
|
|
81
|
-
lastOutcome:
|
|
82
|
-
| "admission_unavailable"
|
|
83
|
-
| "capture_failed"
|
|
84
|
-
| "captured"
|
|
85
|
-
| "captured_untracked"
|
|
86
|
-
| "captured_with_eviction"
|
|
87
|
-
| "duplicate_suppressed"
|
|
88
|
-
| "filtered"
|
|
89
|
-
| "handled_later"
|
|
90
|
-
| "handled_unknown"
|
|
91
|
-
| "idle"
|
|
92
|
-
| "recursive_suppressed"
|
|
93
|
-
| "unavailable";
|
|
94
|
-
maxTrackedRejections: number;
|
|
95
|
-
suppressedEvents: number;
|
|
96
|
-
trackedRejections: number;
|
|
97
|
-
unknownHandledEvents: number;
|
|
98
|
-
untrackedEvents: number;
|
|
99
|
-
}>;
|
|
100
|
-
|
|
101
|
-
export type CreateLogBrewReactNativePromiseRejectionHandlersOptions = {
|
|
102
|
-
client: ReactNativeIssueCaptureClient;
|
|
103
|
-
/**
|
|
104
|
-
* Maximum number of safe runtime rejection identifiers retained for duplicate
|
|
105
|
-
* suppression and later-handled health. Defaults to 128 and must be 1-1024.
|
|
106
|
-
*/
|
|
107
|
-
maxTrackedRejections?: number;
|
|
108
|
-
onDiagnostic?: (diagnostic: ReactNativePromiseRejectionDiagnostic) => void;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export type LogBrewReactNativePromiseRejectionHandlers = Readonly<{
|
|
112
|
-
health(): ReactNativePromiseRejectionHealth;
|
|
113
|
-
onHandled(runtimeRejectionId: unknown): void;
|
|
114
|
-
onUnhandled(runtimeRejectionId: unknown, rejection?: unknown): void;
|
|
115
|
-
}>;
|
|
116
|
-
|
|
117
|
-
export type ReactNativePromiseRejectionTrackerLike = {
|
|
118
|
-
enable(options: Readonly<{
|
|
119
|
-
allRejections: true;
|
|
120
|
-
onHandled(runtimeRejectionId: unknown): void;
|
|
121
|
-
onUnhandled(runtimeRejectionId: unknown, rejection?: unknown): void;
|
|
122
|
-
}>): void;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export type InstallLogBrewReactNativePromiseRejectionTrackerOptions = {
|
|
126
|
-
client: ReactNativeIssueCaptureClient;
|
|
127
|
-
/**
|
|
128
|
-
* Confirms that LogBrew may claim the runtime's single Promise rejection
|
|
129
|
-
* tracker slot. Do not install another tracker owner at the same time.
|
|
130
|
-
*/
|
|
131
|
-
takeOwnership: true;
|
|
132
|
-
/**
|
|
133
|
-
* Optional tracker seam. The React Native conditional export discovers the
|
|
134
|
-
* active Hermes tracker when this is omitted.
|
|
135
|
-
*/
|
|
136
|
-
tracker?: ReactNativePromiseRejectionTrackerLike;
|
|
137
|
-
maxTrackedRejections?: number;
|
|
138
|
-
onDiagnostic?: (diagnostic: ReactNativePromiseRejectionDiagnostic) => void;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export type ReactNativePromiseRejectionTrackerHealth = Readonly<{
|
|
142
|
-
active: boolean;
|
|
143
|
-
available: boolean;
|
|
144
|
-
engine: "custom" | "hermes" | "unavailable";
|
|
145
|
-
lastOutcome:
|
|
146
|
-
| "deactivated"
|
|
147
|
-
| "handler_unavailable"
|
|
148
|
-
| "installation_failed"
|
|
149
|
-
| "installed"
|
|
150
|
-
| "ownership_required"
|
|
151
|
-
| "tracker_unavailable";
|
|
152
|
-
restoration: "deactivate_only";
|
|
153
|
-
}>;
|
|
154
|
-
|
|
155
|
-
export type LogBrewReactNativePromiseRejectionTrackerInstallation = Readonly<{
|
|
156
|
-
/**
|
|
157
|
-
* Stops LogBrew capture through the installed callbacks. Hermes does not
|
|
158
|
-
* expose a previous-owner restoration API, so this cannot restore one.
|
|
159
|
-
*/
|
|
160
|
-
deactivate(): boolean;
|
|
161
|
-
health(): ReactNativePromiseRejectionTrackerHealth;
|
|
162
|
-
rejectionHealth(): ReactNativePromiseRejectionHealth;
|
|
163
|
-
}>;
|
|
164
|
-
|
|
165
|
-
export type ReactNativeFatalRecord = Readonly<{
|
|
166
|
-
corruptRecords: number;
|
|
167
|
-
droppedRecords: number;
|
|
168
|
-
errorName: string;
|
|
169
|
-
id: string;
|
|
170
|
-
schemaVersion: 1;
|
|
171
|
-
stackFrames: ReadonlyArray<Readonly<{
|
|
172
|
-
column: number;
|
|
173
|
-
filename: string;
|
|
174
|
-
line: number;
|
|
175
|
-
}>>;
|
|
176
|
-
timestamp: string;
|
|
177
|
-
}>;
|
|
178
|
-
|
|
179
|
-
export type ReactNativeFatalStoreResult = Readonly<{
|
|
180
|
-
corruptRecords?: number;
|
|
181
|
-
droppedRecords?: number;
|
|
182
|
-
record?: ReactNativeFatalRecord;
|
|
183
|
-
recordId?: string;
|
|
184
|
-
status: string;
|
|
185
|
-
}>;
|
|
186
|
-
|
|
187
|
-
export type ReactNativeFatalStoreLike = {
|
|
188
|
-
writeFatalRecord(record: ReactNativeFatalRecord): ReactNativeFatalStoreResult;
|
|
189
|
-
readFatalRecord(): ReactNativeFatalStoreResult;
|
|
190
|
-
acknowledgeFatalRecord(recordId: string): ReactNativeFatalStoreResult;
|
|
191
|
-
discardFatalRecord(): ReactNativeFatalStoreResult;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export type ReactNativeFatalReplayHealth = Readonly<{
|
|
195
|
-
acknowledgedRecords: number;
|
|
196
|
-
available: boolean;
|
|
197
|
-
corruptRecords: number;
|
|
198
|
-
droppedRecords: number;
|
|
199
|
-
lastOutcome:
|
|
200
|
-
| "acknowledge_failed"
|
|
201
|
-
| "acknowledged"
|
|
202
|
-
| "admission_unavailable"
|
|
203
|
-
| "corrupt_discarded"
|
|
204
|
-
| "discard_failed"
|
|
205
|
-
| "discarded"
|
|
206
|
-
| "dropped_pending"
|
|
207
|
-
| "empty"
|
|
208
|
-
| "idle"
|
|
209
|
-
| "replay_failed"
|
|
210
|
-
| "replay_not_admitted"
|
|
211
|
-
| "storage_error"
|
|
212
|
-
| "stored"
|
|
213
|
-
| "stored_after_corruption"
|
|
214
|
-
| "unavailable";
|
|
215
|
-
replayedRecords: number;
|
|
216
|
-
storedRecords: number;
|
|
217
|
-
}>;
|
|
218
|
-
|
|
219
|
-
export type InstallLogBrewReactNativeGlobalErrorHandlerOptions = {
|
|
220
|
-
client: ReactNativeIssueCaptureClient
|
|
221
|
-
& Partial<Pick<LogBrewClient, "droppedEvents" | "pendingEvents">>;
|
|
222
|
-
errorUtils?: ReactNativeErrorUtilsLike;
|
|
223
|
-
fatalStore?: ReactNativeFatalStoreLike;
|
|
224
|
-
onDiagnostic?: (diagnostic: ReactNativeGlobalErrorDiagnostic) => void;
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export type LogBrewReactNativeGlobalErrorHandlerInstallation = Readonly<{
|
|
228
|
-
discardPendingFatalRecord(): boolean;
|
|
229
|
-
fatalHealth(): ReactNativeFatalReplayHealth;
|
|
230
|
-
health(): ReactNativeGlobalErrorHealth;
|
|
231
|
-
remove(): boolean;
|
|
232
|
-
}>;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Create privacy-safe callbacks for a Promise rejection tracker owned by the app.
|
|
236
|
-
*
|
|
237
|
-
* The callbacks do not install or patch Promise, Hermes, JavaScriptCore, or globals.
|
|
238
|
-
* Automatic reports never inspect or emit the rejection value or runtime identifier.
|
|
239
|
-
* Tracking is bounded and suppresses duplicate callbacks only while an identifier is retained.
|
|
240
|
-
* Capture counts and tracking require an admitted receipt. Without a receipt, each report
|
|
241
|
-
* calls issue once, reports admission_unavailable, and remains eligible for a later report.
|
|
242
|
-
*/
|
|
243
|
-
export declare function createLogBrewReactNativePromiseRejectionHandlers(
|
|
244
|
-
options: CreateLogBrewReactNativePromiseRejectionHandlersOptions
|
|
245
|
-
): LogBrewReactNativePromiseRejectionHandlers;
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Install privacy-safe automatic Promise rejection capture.
|
|
249
|
-
*
|
|
250
|
-
* Installation is opt-in because React Native runtimes expose one tracker slot.
|
|
251
|
-
* The React Native conditional export discovers Hermes without replacing the
|
|
252
|
-
* global Promise. Other runtimes can inject a compatible tracker explicitly.
|
|
253
|
-
*/
|
|
254
|
-
export declare function installLogBrewReactNativePromiseRejectionTracker(
|
|
255
|
-
options: InstallLogBrewReactNativePromiseRejectionTrackerOptions
|
|
256
|
-
): LogBrewReactNativePromiseRejectionTrackerInstallation;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Install reversible automatic capture for React Native global JavaScript errors.
|
|
260
|
-
*
|
|
261
|
-
* The React Native conditional export admits fatal reports into its persistent event queue
|
|
262
|
-
* before the previous handler runs. Direct Node ESM/CJS callers can inject a compatible
|
|
263
|
-
* fatal store explicitly.
|
|
264
|
-
* Capture counts, duplicate suppression, and fatal acknowledgement require an admitted receipt.
|
|
265
|
-
* Older clients receive each report once and report admission_unavailable.
|
|
266
|
-
* This helper does not claim local exactly-once delivery or install Promise rejection handling.
|
|
267
|
-
*/
|
|
268
|
-
export declare function installLogBrewReactNativeGlobalErrorHandler(
|
|
269
|
-
options: InstallLogBrewReactNativeGlobalErrorHandlerOptions
|
|
270
|
-
): LogBrewReactNativeGlobalErrorHandlerInstallation;
|
|
271
|
-
|
|
272
|
-
declare const logBrewReactNativeGlobalErrors: {
|
|
273
|
-
createLogBrewReactNativePromiseRejectionHandlers: typeof createLogBrewReactNativePromiseRejectionHandlers;
|
|
274
|
-
installLogBrewReactNativeGlobalErrorHandler: typeof installLogBrewReactNativeGlobalErrorHandler;
|
|
275
|
-
installLogBrewReactNativePromiseRejectionTracker: typeof installLogBrewReactNativePromiseRejectionTracker;
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
export default logBrewReactNativeGlobalErrors;
|
|
1
|
+
export type {
|
|
2
|
+
CreateLogBrewReactNativePromiseRejectionHandlersOptions,
|
|
3
|
+
InstallLogBrewReactNativeGlobalErrorHandlerOptions,
|
|
4
|
+
InstallLogBrewReactNativePromiseRejectionTrackerOptions,
|
|
5
|
+
LogBrewReactNativeGlobalErrorHandlerInstallation,
|
|
6
|
+
LogBrewReactNativePromiseRejectionHandlers,
|
|
7
|
+
LogBrewReactNativePromiseRejectionTrackerInstallation,
|
|
8
|
+
ReactNativeErrorUtilsLike,
|
|
9
|
+
ReactNativeFatalRecord,
|
|
10
|
+
ReactNativeFatalReplayHealth,
|
|
11
|
+
ReactNativeFatalStoreLike,
|
|
12
|
+
ReactNativeFatalStoreResult,
|
|
13
|
+
ReactNativeGlobalErrorDiagnostic,
|
|
14
|
+
ReactNativeGlobalErrorDiagnosticCode,
|
|
15
|
+
ReactNativeGlobalErrorHandler,
|
|
16
|
+
ReactNativeGlobalErrorHealth,
|
|
17
|
+
ReactNativeIssueCaptureClient,
|
|
18
|
+
ReactNativePromiseRejectionDiagnostic,
|
|
19
|
+
ReactNativePromiseRejectionDiagnosticCode,
|
|
20
|
+
ReactNativePromiseRejectionHealth,
|
|
21
|
+
ReactNativePromiseRejectionTrackerHealth,
|
|
22
|
+
ReactNativePromiseRejectionTrackerLike
|
|
23
|
+
} from "./global-errors.js";
|
|
24
|
+
export {
|
|
25
|
+
createLogBrewReactNativePromiseRejectionHandlers,
|
|
26
|
+
default,
|
|
27
|
+
installLogBrewReactNativeGlobalErrorHandler,
|
|
28
|
+
installLogBrewReactNativePromiseRejectionTracker
|
|
29
|
+
} from "./global-errors.js";
|
package/global-errors.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { LogBrewClient } from "@logbrew/sdk";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type ReactNativeGlobalErrorHandler = (error: unknown, isFatal?: boolean) => void;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type ReactNativeErrorUtilsLike = {
|
|
6
6
|
getGlobalHandler(): ReactNativeGlobalErrorHandler | undefined;
|
|
7
7
|
setGlobalHandler(handler: ReactNativeGlobalErrorHandler | undefined): void;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type ReactNativeIssueCaptureClient = Pick<LogBrewClient, "issue"> & {
|
|
11
11
|
/** Optional synchronous receipt for this call. Older clients remain supported. */
|
|
12
12
|
issueWithAdmission?: (...args: Parameters<LogBrewClient["issue"]>) => unknown;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type ReactNativePromiseRejectionDiagnosticCode =
|
|
16
16
|
| "promise_rejection_admission_unavailable"
|
|
17
17
|
| "promise_rejection_capture_failed"
|
|
18
18
|
| "promise_rejection_configuration_invalid"
|
|
@@ -26,11 +26,11 @@ export type ReactNativePromiseRejectionDiagnosticCode =
|
|
|
26
26
|
| "promise_rejection_tracker_unavailable"
|
|
27
27
|
| "promise_rejection_tracking_evicted";
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
type ReactNativePromiseRejectionDiagnostic = Readonly<{
|
|
30
30
|
code: ReactNativePromiseRejectionDiagnosticCode;
|
|
31
31
|
}>;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
type ReactNativeGlobalErrorDiagnosticCode =
|
|
34
34
|
| "capture_admission_unavailable"
|
|
35
35
|
| "capture_failed"
|
|
36
36
|
| "capture_filtered"
|
|
@@ -48,11 +48,11 @@ export type ReactNativeGlobalErrorDiagnosticCode =
|
|
|
48
48
|
| "handler_unavailable"
|
|
49
49
|
| "recursive_capture_suppressed";
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
type ReactNativeGlobalErrorDiagnostic = Readonly<{
|
|
52
52
|
code: ReactNativeGlobalErrorDiagnosticCode;
|
|
53
53
|
}>;
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
type ReactNativeGlobalErrorHealth = Readonly<{
|
|
56
56
|
active: boolean;
|
|
57
57
|
capturedEvents: number;
|
|
58
58
|
lastOutcome:
|
|
@@ -73,7 +73,7 @@ export type ReactNativeGlobalErrorHealth = Readonly<{
|
|
|
73
73
|
suppressedEvents: number;
|
|
74
74
|
}>;
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
type ReactNativePromiseRejectionHealth = Readonly<{
|
|
77
77
|
available: boolean;
|
|
78
78
|
capturedEvents: number;
|
|
79
79
|
evictedRejections: number;
|
|
@@ -98,7 +98,7 @@ export type ReactNativePromiseRejectionHealth = Readonly<{
|
|
|
98
98
|
untrackedEvents: number;
|
|
99
99
|
}>;
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
type CreateLogBrewReactNativePromiseRejectionHandlersOptions = {
|
|
102
102
|
client: ReactNativeIssueCaptureClient;
|
|
103
103
|
/**
|
|
104
104
|
* Maximum number of safe runtime rejection identifiers retained for duplicate
|
|
@@ -108,13 +108,13 @@ export type CreateLogBrewReactNativePromiseRejectionHandlersOptions = {
|
|
|
108
108
|
onDiagnostic?: (diagnostic: ReactNativePromiseRejectionDiagnostic) => void;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
type LogBrewReactNativePromiseRejectionHandlers = Readonly<{
|
|
112
112
|
health(): ReactNativePromiseRejectionHealth;
|
|
113
113
|
onHandled(runtimeRejectionId: unknown): void;
|
|
114
114
|
onUnhandled(runtimeRejectionId: unknown, rejection?: unknown): void;
|
|
115
115
|
}>;
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
type ReactNativePromiseRejectionTrackerLike = {
|
|
118
118
|
enable(options: Readonly<{
|
|
119
119
|
allRejections: true;
|
|
120
120
|
onHandled(runtimeRejectionId: unknown): void;
|
|
@@ -122,7 +122,7 @@ export type ReactNativePromiseRejectionTrackerLike = {
|
|
|
122
122
|
}>): void;
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
type InstallLogBrewReactNativePromiseRejectionTrackerOptions = {
|
|
126
126
|
client: ReactNativeIssueCaptureClient;
|
|
127
127
|
/**
|
|
128
128
|
* Confirms that LogBrew may claim the runtime's single Promise rejection
|
|
@@ -138,7 +138,7 @@ export type InstallLogBrewReactNativePromiseRejectionTrackerOptions = {
|
|
|
138
138
|
onDiagnostic?: (diagnostic: ReactNativePromiseRejectionDiagnostic) => void;
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
type ReactNativePromiseRejectionTrackerHealth = Readonly<{
|
|
142
142
|
active: boolean;
|
|
143
143
|
available: boolean;
|
|
144
144
|
engine: "custom" | "hermes" | "unavailable";
|
|
@@ -152,7 +152,7 @@ export type ReactNativePromiseRejectionTrackerHealth = Readonly<{
|
|
|
152
152
|
restoration: "deactivate_only";
|
|
153
153
|
}>;
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
type LogBrewReactNativePromiseRejectionTrackerInstallation = Readonly<{
|
|
156
156
|
/**
|
|
157
157
|
* Stops LogBrew capture through the installed callbacks. Hermes does not
|
|
158
158
|
* expose a previous-owner restoration API, so this cannot restore one.
|
|
@@ -162,21 +162,23 @@ export type LogBrewReactNativePromiseRejectionTrackerInstallation = Readonly<{
|
|
|
162
162
|
rejectionHealth(): ReactNativePromiseRejectionHealth;
|
|
163
163
|
}>;
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
declare const FATAL_RECORD_SCHEMA_VERSION = 1;
|
|
166
|
+
|
|
167
|
+
type ReactNativeFatalRecord = Readonly<{
|
|
166
168
|
corruptRecords: number;
|
|
167
169
|
droppedRecords: number;
|
|
168
170
|
errorName: string;
|
|
169
171
|
id: string;
|
|
170
|
-
schemaVersion:
|
|
171
|
-
stackFrames:
|
|
172
|
+
schemaVersion: typeof FATAL_RECORD_SCHEMA_VERSION;
|
|
173
|
+
stackFrames: readonly Readonly<{
|
|
172
174
|
column: number;
|
|
173
175
|
filename: string;
|
|
174
176
|
line: number;
|
|
175
|
-
}
|
|
177
|
+
}>[];
|
|
176
178
|
timestamp: string;
|
|
177
179
|
}>;
|
|
178
180
|
|
|
179
|
-
|
|
181
|
+
type ReactNativeFatalStoreResult = Readonly<{
|
|
180
182
|
corruptRecords?: number;
|
|
181
183
|
droppedRecords?: number;
|
|
182
184
|
record?: ReactNativeFatalRecord;
|
|
@@ -184,14 +186,14 @@ export type ReactNativeFatalStoreResult = Readonly<{
|
|
|
184
186
|
status: string;
|
|
185
187
|
}>;
|
|
186
188
|
|
|
187
|
-
|
|
189
|
+
type ReactNativeFatalStoreLike = {
|
|
188
190
|
writeFatalRecord(record: ReactNativeFatalRecord): ReactNativeFatalStoreResult;
|
|
189
191
|
readFatalRecord(): ReactNativeFatalStoreResult;
|
|
190
192
|
acknowledgeFatalRecord(recordId: string): ReactNativeFatalStoreResult;
|
|
191
193
|
discardFatalRecord(): ReactNativeFatalStoreResult;
|
|
192
194
|
};
|
|
193
195
|
|
|
194
|
-
|
|
196
|
+
type ReactNativeFatalReplayHealth = Readonly<{
|
|
195
197
|
acknowledgedRecords: number;
|
|
196
198
|
available: boolean;
|
|
197
199
|
corruptRecords: number;
|
|
@@ -216,7 +218,7 @@ export type ReactNativeFatalReplayHealth = Readonly<{
|
|
|
216
218
|
storedRecords: number;
|
|
217
219
|
}>;
|
|
218
220
|
|
|
219
|
-
|
|
221
|
+
type InstallLogBrewReactNativeGlobalErrorHandlerOptions = {
|
|
220
222
|
client: ReactNativeIssueCaptureClient
|
|
221
223
|
& Partial<Pick<LogBrewClient, "droppedEvents" | "pendingEvents">>;
|
|
222
224
|
errorUtils?: ReactNativeErrorUtilsLike;
|
|
@@ -224,7 +226,7 @@ export type InstallLogBrewReactNativeGlobalErrorHandlerOptions = {
|
|
|
224
226
|
onDiagnostic?: (diagnostic: ReactNativeGlobalErrorDiagnostic) => void;
|
|
225
227
|
};
|
|
226
228
|
|
|
227
|
-
|
|
229
|
+
type LogBrewReactNativeGlobalErrorHandlerInstallation = Readonly<{
|
|
228
230
|
discardPendingFatalRecord(): boolean;
|
|
229
231
|
fatalHealth(): ReactNativeFatalReplayHealth;
|
|
230
232
|
health(): ReactNativeGlobalErrorHealth;
|
|
@@ -240,7 +242,7 @@ export type LogBrewReactNativeGlobalErrorHandlerInstallation = Readonly<{
|
|
|
240
242
|
* Capture counts and tracking require an admitted receipt. Without a receipt, each report
|
|
241
243
|
* calls issue once, reports admission_unavailable, and remains eligible for a later report.
|
|
242
244
|
*/
|
|
243
|
-
|
|
245
|
+
declare function createLogBrewReactNativePromiseRejectionHandlers(
|
|
244
246
|
options: CreateLogBrewReactNativePromiseRejectionHandlersOptions
|
|
245
247
|
): LogBrewReactNativePromiseRejectionHandlers;
|
|
246
248
|
|
|
@@ -251,7 +253,7 @@ export declare function createLogBrewReactNativePromiseRejectionHandlers(
|
|
|
251
253
|
* The React Native conditional export discovers Hermes without replacing the
|
|
252
254
|
* global Promise. Other runtimes can inject a compatible tracker explicitly.
|
|
253
255
|
*/
|
|
254
|
-
|
|
256
|
+
declare function installLogBrewReactNativePromiseRejectionTracker(
|
|
255
257
|
options: InstallLogBrewReactNativePromiseRejectionTrackerOptions
|
|
256
258
|
): LogBrewReactNativePromiseRejectionTrackerInstallation;
|
|
257
259
|
|
|
@@ -265,7 +267,7 @@ export declare function installLogBrewReactNativePromiseRejectionTracker(
|
|
|
265
267
|
* Older clients receive each report once and report admission_unavailable.
|
|
266
268
|
* This helper does not claim local exactly-once delivery or install Promise rejection handling.
|
|
267
269
|
*/
|
|
268
|
-
|
|
270
|
+
declare function installLogBrewReactNativeGlobalErrorHandler(
|
|
269
271
|
options: InstallLogBrewReactNativeGlobalErrorHandlerOptions
|
|
270
272
|
): LogBrewReactNativeGlobalErrorHandlerInstallation;
|
|
271
273
|
|
|
@@ -275,4 +277,32 @@ declare const logBrewReactNativeGlobalErrors: {
|
|
|
275
277
|
installLogBrewReactNativePromiseRejectionTracker: typeof installLogBrewReactNativePromiseRejectionTracker;
|
|
276
278
|
};
|
|
277
279
|
|
|
280
|
+
export type {
|
|
281
|
+
CreateLogBrewReactNativePromiseRejectionHandlersOptions,
|
|
282
|
+
InstallLogBrewReactNativeGlobalErrorHandlerOptions,
|
|
283
|
+
InstallLogBrewReactNativePromiseRejectionTrackerOptions,
|
|
284
|
+
LogBrewReactNativeGlobalErrorHandlerInstallation,
|
|
285
|
+
LogBrewReactNativePromiseRejectionHandlers,
|
|
286
|
+
LogBrewReactNativePromiseRejectionTrackerInstallation,
|
|
287
|
+
ReactNativeErrorUtilsLike,
|
|
288
|
+
ReactNativeFatalRecord,
|
|
289
|
+
ReactNativeFatalReplayHealth,
|
|
290
|
+
ReactNativeFatalStoreLike,
|
|
291
|
+
ReactNativeFatalStoreResult,
|
|
292
|
+
ReactNativeGlobalErrorDiagnostic,
|
|
293
|
+
ReactNativeGlobalErrorDiagnosticCode,
|
|
294
|
+
ReactNativeGlobalErrorHandler,
|
|
295
|
+
ReactNativeGlobalErrorHealth,
|
|
296
|
+
ReactNativeIssueCaptureClient,
|
|
297
|
+
ReactNativePromiseRejectionDiagnostic,
|
|
298
|
+
ReactNativePromiseRejectionDiagnosticCode,
|
|
299
|
+
ReactNativePromiseRejectionHealth,
|
|
300
|
+
ReactNativePromiseRejectionTrackerHealth,
|
|
301
|
+
ReactNativePromiseRejectionTrackerLike
|
|
302
|
+
};
|
|
303
|
+
export {
|
|
304
|
+
createLogBrewReactNativePromiseRejectionHandlers,
|
|
305
|
+
installLogBrewReactNativePromiseRejectionTracker,
|
|
306
|
+
installLogBrewReactNativeGlobalErrorHandler
|
|
307
|
+
};
|
|
278
308
|
export default logBrewReactNativeGlobalErrors;
|
package/global-errors.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import implementation from "./global-errors.cjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const {
|
|
4
4
|
createLogBrewReactNativePromiseRejectionHandlers,
|
|
5
5
|
installLogBrewReactNativeGlobalErrorHandler,
|
|
6
6
|
installLogBrewReactNativePromiseRejectionTracker
|
|
7
7
|
} = implementation;
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export {
|
|
10
|
+
createLogBrewReactNativePromiseRejectionHandlers,
|
|
11
|
+
installLogBrewReactNativeGlobalErrorHandler,
|
|
12
|
+
installLogBrewReactNativePromiseRejectionTracker
|
|
13
|
+
};
|
|
14
|
+
export { default } from "./global-errors.cjs";
|