@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.
Files changed (96) hide show
  1. package/android-native-diagnostics.d.ts +15 -5
  2. package/android-native-diagnostics.js +170 -94
  3. package/apollo.cjs +435 -226
  4. package/apollo.d.cts +2 -70
  5. package/apollo.d.ts +24 -12
  6. package/apollo.js +438 -221
  7. package/apple-native-diagnostics-config.js +176 -0
  8. package/apple-native-diagnostics-context.js +232 -0
  9. package/apple-native-diagnostics-module.js +229 -0
  10. package/apple-native-diagnostics.d.ts +42 -11
  11. package/apple-native-diagnostics.js +60 -389
  12. package/expo.cjs +29 -16
  13. package/expo.d.ts +10 -9
  14. package/expo.js +4 -3
  15. package/fatal-admission.cjs +113 -0
  16. package/fatal-record.cjs +317 -0
  17. package/fatal-replay.cjs +297 -508
  18. package/global-errors-capture.cjs +369 -0
  19. package/global-errors-event.cjs +174 -0
  20. package/global-errors-support.cjs +128 -0
  21. package/global-errors.cjs +75 -351
  22. package/global-errors.d.cts +29 -278
  23. package/global-errors.d.ts +57 -27
  24. package/global-errors.js +7 -2
  25. package/global-errors.native.js +83 -48
  26. package/index-breadcrumbs.cjs +139 -0
  27. package/index-errors.cjs +167 -0
  28. package/index-events.cjs +365 -0
  29. package/index-navigation.cjs +327 -0
  30. package/index-random.cjs +120 -0
  31. package/index-react.cjs +189 -0
  32. package/index-spans.cjs +190 -0
  33. package/index-trace-fetch.cjs +322 -0
  34. package/index-trace.cjs +335 -0
  35. package/index-transport.cjs +201 -0
  36. package/index-values.cjs +232 -0
  37. package/index.cjs +95 -1243
  38. package/index.d.cts +2 -505
  39. package/index.d.ts +130 -469
  40. package/index.native.d.ts +146 -22
  41. package/index.native.js +184 -159
  42. package/instrumentation-fetch.cjs +113 -0
  43. package/instrumentation-install.cjs +241 -0
  44. package/instrumentation-runtime.cjs +65 -0
  45. package/instrumentation-teardown.cjs +93 -0
  46. package/instrumentation-values.cjs +282 -0
  47. package/instrumentation-xhr-request.cjs +298 -0
  48. package/instrumentation-xhr.cjs +233 -0
  49. package/instrumentation.cjs +110 -599
  50. package/instrumentation.d.cts +2 -84
  51. package/instrumentation.d.ts +22 -8
  52. package/ios/AppleDiagnostics/LBRNAppleNativeDiagnostics.swift +1 -1
  53. package/lifecycle.cjs +181 -78
  54. package/lifecycle.d.cts +1 -50
  55. package/lifecycle.d.ts +17 -6
  56. package/metadata.cjs +279 -114
  57. package/metro-debug-id.cjs +296 -0
  58. package/metro-serializer.cjs +219 -0
  59. package/metro.cjs +153 -297
  60. package/metro.d.cts +2 -57
  61. package/metro.d.ts +27 -13
  62. package/metro.js +2 -3
  63. package/native-bridge-async.cjs +165 -0
  64. package/native-bridge-scope.cjs +148 -0
  65. package/native-bridge.cjs +83 -186
  66. package/native-bridge.d.cts +2 -94
  67. package/native-bridge.d.ts +28 -15
  68. package/native-client-bindings.js +230 -0
  69. package/native-diagnostics-values.js +120 -0
  70. package/native-module-lookup.js +31 -0
  71. package/native-null.js +3 -0
  72. package/null-value.cjs +4 -0
  73. package/package.json +43 -1
  74. package/persistent-delivery-store.js +247 -0
  75. package/persistent-delivery.native.js +183 -261
  76. package/promise-rejection-handlers.cjs +368 -0
  77. package/promise-rejections.cjs +169 -361
  78. package/react-native.config.js +3 -1
  79. package/release-artifacts-files.cjs +94 -0
  80. package/release-artifacts-options.cjs +182 -0
  81. package/release-artifacts.cjs +278 -207
  82. package/release-artifacts.d.cts +2 -55
  83. package/release-artifacts.d.ts +18 -7
  84. package/release-artifacts.js +2 -4
  85. package/resource-fetch-graphql.cjs +265 -0
  86. package/resource-fetch-size.cjs +156 -0
  87. package/resource-fetch.cjs +227 -428
  88. package/resource-fetch.d.cts +1 -60
  89. package/resource-fetch.d.ts +17 -6
  90. package/scripts/sync-apple-native-sources.mjs +101 -53
  91. package/types/capture.d.ts +95 -0
  92. package/types/config.d.ts +85 -0
  93. package/types/defaults.d.ts +55 -0
  94. package/types/events.d.ts +203 -0
  95. package/types/provider.d.ts +81 -0
  96. package/types/trace.d.ts +104 -0
@@ -1,278 +1,29 @@
1
- import type { LogBrewClient } from "@logbrew/sdk";
2
-
3
- export type ReactNativeGlobalErrorHandler = (error: unknown, isFatal?: boolean) => void;
4
-
5
- export type ReactNativeErrorUtilsLike = {
6
- getGlobalHandler(): ReactNativeGlobalErrorHandler | undefined;
7
- setGlobalHandler(handler: ReactNativeGlobalErrorHandler | undefined): void;
8
- };
9
-
10
- export type ReactNativeIssueCaptureClient = Pick<LogBrewClient, "issue"> & {
11
- /** Optional synchronous receipt for this call. Older clients remain supported. */
12
- issueWithAdmission?: (...args: Parameters<LogBrewClient["issue"]>) => unknown;
13
- };
14
-
15
- export type ReactNativePromiseRejectionDiagnosticCode =
16
- | "promise_rejection_admission_unavailable"
17
- | "promise_rejection_capture_failed"
18
- | "promise_rejection_configuration_invalid"
19
- | "promise_rejection_duplicate_suppressed"
20
- | "promise_rejection_filtered"
21
- | "promise_rejection_handler_unavailable"
22
- | "promise_rejection_id_unavailable"
23
- | "promise_rejection_recursive_capture_suppressed"
24
- | "promise_rejection_tracker_installation_failed"
25
- | "promise_rejection_tracker_ownership_required"
26
- | "promise_rejection_tracker_unavailable"
27
- | "promise_rejection_tracking_evicted";
28
-
29
- export type ReactNativePromiseRejectionDiagnostic = Readonly<{
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";
@@ -1,18 +1,18 @@
1
1
  import type { LogBrewClient } from "@logbrew/sdk";
2
2
 
3
- export type ReactNativeGlobalErrorHandler = (error: unknown, isFatal?: boolean) => void;
3
+ type ReactNativeGlobalErrorHandler = (error: unknown, isFatal?: boolean) => void;
4
4
 
5
- export type ReactNativeErrorUtilsLike = {
5
+ type ReactNativeErrorUtilsLike = {
6
6
  getGlobalHandler(): ReactNativeGlobalErrorHandler | undefined;
7
7
  setGlobalHandler(handler: ReactNativeGlobalErrorHandler | undefined): void;
8
8
  };
9
9
 
10
- export type ReactNativeIssueCaptureClient = Pick<LogBrewClient, "issue"> & {
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
- export type ReactNativePromiseRejectionDiagnosticCode =
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
- export type ReactNativePromiseRejectionDiagnostic = Readonly<{
29
+ type ReactNativePromiseRejectionDiagnostic = Readonly<{
30
30
  code: ReactNativePromiseRejectionDiagnosticCode;
31
31
  }>;
32
32
 
33
- export type ReactNativeGlobalErrorDiagnosticCode =
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
- export type ReactNativeGlobalErrorDiagnostic = Readonly<{
51
+ type ReactNativeGlobalErrorDiagnostic = Readonly<{
52
52
  code: ReactNativeGlobalErrorDiagnosticCode;
53
53
  }>;
54
54
 
55
- export type ReactNativeGlobalErrorHealth = Readonly<{
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
- export type ReactNativePromiseRejectionHealth = Readonly<{
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
- export type CreateLogBrewReactNativePromiseRejectionHandlersOptions = {
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
- export type LogBrewReactNativePromiseRejectionHandlers = Readonly<{
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
- export type ReactNativePromiseRejectionTrackerLike = {
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
- export type InstallLogBrewReactNativePromiseRejectionTrackerOptions = {
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
- export type ReactNativePromiseRejectionTrackerHealth = Readonly<{
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
- export type LogBrewReactNativePromiseRejectionTrackerInstallation = Readonly<{
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
- export type ReactNativeFatalRecord = Readonly<{
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: 1;
171
- stackFrames: ReadonlyArray<Readonly<{
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
- export type ReactNativeFatalStoreResult = Readonly<{
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
- export type ReactNativeFatalStoreLike = {
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
- export type ReactNativeFatalReplayHealth = Readonly<{
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
- export type InstallLogBrewReactNativeGlobalErrorHandlerOptions = {
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
- export type LogBrewReactNativeGlobalErrorHandlerInstallation = Readonly<{
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
- export declare function createLogBrewReactNativePromiseRejectionHandlers(
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
- export declare function installLogBrewReactNativePromiseRejectionTracker(
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
- export declare function installLogBrewReactNativeGlobalErrorHandler(
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
- export const {
3
+ const {
4
4
  createLogBrewReactNativePromiseRejectionHandlers,
5
5
  installLogBrewReactNativeGlobalErrorHandler,
6
6
  installLogBrewReactNativePromiseRejectionTracker
7
7
  } = implementation;
8
8
 
9
- export default implementation;
9
+ export {
10
+ createLogBrewReactNativePromiseRejectionHandlers,
11
+ installLogBrewReactNativeGlobalErrorHandler,
12
+ installLogBrewReactNativePromiseRejectionTracker
13
+ };
14
+ export { default } from "./global-errors.cjs";