@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.
Files changed (104) hide show
  1. package/LogBrewReactNative.podspec +1 -1
  2. package/README.md +17 -15
  3. package/android-native-diagnostics.d.ts +15 -5
  4. package/android-native-diagnostics.js +170 -94
  5. package/apollo.cjs +435 -226
  6. package/apollo.d.cts +2 -70
  7. package/apollo.d.ts +24 -12
  8. package/apollo.js +438 -221
  9. package/apple-native-diagnostics-config.js +176 -0
  10. package/apple-native-diagnostics-context.js +232 -0
  11. package/apple-native-diagnostics-module.js +229 -0
  12. package/apple-native-diagnostics.d.ts +42 -11
  13. package/apple-native-diagnostics.js +60 -389
  14. package/expo.cjs +29 -16
  15. package/expo.d.ts +10 -9
  16. package/expo.js +4 -3
  17. package/fatal-admission.cjs +113 -0
  18. package/fatal-record.cjs +317 -0
  19. package/fatal-replay.cjs +297 -508
  20. package/global-errors-capture.cjs +369 -0
  21. package/global-errors-event.cjs +174 -0
  22. package/global-errors-support.cjs +128 -0
  23. package/global-errors.cjs +75 -351
  24. package/global-errors.d.cts +29 -278
  25. package/global-errors.d.ts +57 -27
  26. package/global-errors.js +7 -2
  27. package/global-errors.native.js +83 -48
  28. package/index-breadcrumbs.cjs +139 -0
  29. package/index-errors.cjs +167 -0
  30. package/index-events.cjs +365 -0
  31. package/index-navigation.cjs +327 -0
  32. package/index-random.cjs +120 -0
  33. package/index-react.cjs +189 -0
  34. package/index-spans.cjs +190 -0
  35. package/index-trace-fetch.cjs +322 -0
  36. package/index-trace.cjs +335 -0
  37. package/index-transport.cjs +201 -0
  38. package/index-values.cjs +232 -0
  39. package/index.cjs +95 -1220
  40. package/index.d.cts +2 -505
  41. package/index.d.ts +130 -469
  42. package/index.native.d.ts +146 -22
  43. package/index.native.js +184 -159
  44. package/instrumentation-fetch.cjs +113 -0
  45. package/instrumentation-install.cjs +241 -0
  46. package/instrumentation-runtime.cjs +65 -0
  47. package/instrumentation-teardown.cjs +93 -0
  48. package/instrumentation-values.cjs +282 -0
  49. package/instrumentation-xhr-request.cjs +298 -0
  50. package/instrumentation-xhr.cjs +233 -0
  51. package/instrumentation.cjs +110 -599
  52. package/instrumentation.d.cts +2 -84
  53. package/instrumentation.d.ts +22 -8
  54. package/ios/AppleDiagnostics/LBRNAppleNativeDiagnostics.swift +1 -1
  55. package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryEngine.swift +7 -1
  56. package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryEngineAutomatic.swift +36 -4
  57. package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryEngineQueue.swift +17 -0
  58. package/ios/GeneratedAppleDiagnostics/LogBrew/DeliveryLifecycle.swift +2 -0
  59. package/ios/GeneratedAppleDiagnostics/LogBrew/Transport.swift +41 -6
  60. package/ios/GeneratedAppleDiagnostics/SOURCE-MANIFEST.json +5 -5
  61. package/lifecycle.cjs +181 -78
  62. package/lifecycle.d.cts +1 -50
  63. package/lifecycle.d.ts +17 -6
  64. package/metadata.cjs +279 -114
  65. package/metro-debug-id.cjs +296 -0
  66. package/metro-serializer.cjs +219 -0
  67. package/metro.cjs +153 -297
  68. package/metro.d.cts +2 -57
  69. package/metro.d.ts +27 -13
  70. package/metro.js +2 -3
  71. package/native-bridge-async.cjs +165 -0
  72. package/native-bridge-scope.cjs +148 -0
  73. package/native-bridge.cjs +83 -186
  74. package/native-bridge.d.cts +2 -94
  75. package/native-bridge.d.ts +28 -15
  76. package/native-client-bindings.js +230 -0
  77. package/native-diagnostics-values.js +120 -0
  78. package/native-module-lookup.js +31 -0
  79. package/native-null.js +3 -0
  80. package/null-value.cjs +4 -0
  81. package/package.json +44 -2
  82. package/persistent-delivery-store.js +247 -0
  83. package/persistent-delivery.native.js +183 -261
  84. package/promise-rejection-handlers.cjs +368 -0
  85. package/promise-rejections.cjs +169 -361
  86. package/react-native.config.js +3 -1
  87. package/release-artifacts-files.cjs +94 -0
  88. package/release-artifacts-options.cjs +182 -0
  89. package/release-artifacts.cjs +278 -207
  90. package/release-artifacts.d.cts +2 -55
  91. package/release-artifacts.d.ts +18 -7
  92. package/release-artifacts.js +2 -4
  93. package/resource-fetch-graphql.cjs +265 -0
  94. package/resource-fetch-size.cjs +156 -0
  95. package/resource-fetch.cjs +227 -428
  96. package/resource-fetch.d.cts +1 -60
  97. package/resource-fetch.d.ts +17 -6
  98. package/scripts/sync-apple-native-sources.mjs +101 -53
  99. package/types/capture.d.ts +95 -0
  100. package/types/config.d.ts +85 -0
  101. package/types/defaults.d.ts +55 -0
  102. package/types/events.d.ts +203 -0
  103. package/types/provider.d.ts +81 -0
  104. package/types/trace.d.ts +104 -0
package/native-bridge.cjs CHANGED
@@ -1,53 +1,46 @@
1
1
  const { SdkError } = require("@logbrew/sdk");
2
- const {
3
- getActiveLogBrewTrace,
4
- getReactNativeTraceMetadata
5
- } = require("./index.cjs");
2
+ const { isCallable, readField } = require("./instrumentation-values.cjs");
3
+ const { bridgeClear, bridgeSetter, createLogBrewNativeBridgeScope } = require("./native-bridge-scope.cjs");
4
+ const { withLogBrewNativeBridgeScopeAsync } = require("./native-bridge-async.cjs");
6
5
 
7
- const DEFAULT_SCOPE_SOURCE = "react-native.native_bridge";
8
- const ASYNC_BRIDGE_QUEUES = new WeakMap();
9
- const MAX_PENDING_ASYNC_SCOPES = 128;
10
- const MAX_ASYNC_SCOPE_METADATA_ENTRIES = 64;
11
- const MAX_ASYNC_SCOPE_JSON_LENGTH = 8192;
12
- const RESERVED_TRACE_METADATA_KEYS = new Set([
13
- "parentSpanId",
14
- "spanId",
15
- "traceFlags",
16
- "traceId",
17
- "traceSampled",
18
- "traceparent"
19
- ]);
6
+ /**
7
+ * @import { NativeBridgeScope, NativeBridgeScopeInput } from "./native-bridge-scope.cjs"
8
+ * @import { Callable } from "./instrumentation-values.cjs"
9
+ */
20
10
 
21
- function createLogBrewNativeBridgeScope({
22
- logger,
23
- metadata = {},
24
- screen,
25
- sessionId,
26
- source = DEFAULT_SCOPE_SOURCE,
27
- trace = getActiveLogBrewTrace()
28
- } = {}) {
29
- const traceMetadata = getReactNativeTraceMetadata(trace);
30
- return {
31
- trace: Object.keys(traceMetadata).length === 0 ? undefined : {
32
- parentSpanId: traceMetadata.parentSpanId,
33
- spanId: traceMetadata.spanId,
34
- traceFlags: traceMetadata.traceFlags,
35
- traceId: traceMetadata.traceId,
36
- traceSampled: traceMetadata.traceSampled
37
- },
38
- metadata: compactMetadata({
39
- ...metadata,
40
- logger,
41
- screen,
42
- sessionId,
43
- source
44
- })
45
- };
11
+ /**
12
+ * @typedef {{ readonly settled: boolean, readonly value: unknown }} ScopeOutcome
13
+ */
14
+
15
+ /**
16
+ * @param {unknown} nativeBridge
17
+ * @returns {void}
18
+ */
19
+ function clearLogBrewNativeBridgeScope(nativeBridge) {
20
+ bridgeClear(nativeBridge)();
21
+ }
22
+
23
+ /**
24
+ * @param {unknown} nativeBridge
25
+ * @returns {boolean}
26
+ */
27
+ function clearPreservingFailure(nativeBridge) {
28
+ try {
29
+ clearLogBrewNativeBridgeScope(nativeBridge);
30
+ } catch {
31
+ return false;
32
+ }
33
+ return true;
46
34
  }
47
35
 
36
+ /**
37
+ * @param {unknown} nativeBridge
38
+ * @param {NativeBridgeScopeInput} [options]
39
+ * @returns {NativeBridgeScope}
40
+ */
48
41
  function syncLogBrewNativeBridgeScope(nativeBridge, options = {}) {
49
42
  const payload = createLogBrewNativeBridgeScope(options);
50
- const sync = bridgeSync(nativeBridge);
43
+ const sync = bridgeSetter(nativeBridge);
51
44
  try {
52
45
  sync(payload);
53
46
  } catch (error) {
@@ -57,167 +50,71 @@ function syncLogBrewNativeBridgeScope(nativeBridge, options = {}) {
57
50
  return payload;
58
51
  }
59
52
 
60
- function clearLogBrewNativeBridgeScope(nativeBridge) {
61
- bridgeClear(nativeBridge)();
62
- }
63
-
64
- function withLogBrewNativeBridgeScope(nativeBridge, options, callback) {
65
- const resolvedOptions = typeof options === "function" ? {} : options ?? {};
66
- const resolvedCallback = typeof options === "function" ? options : callback;
67
- if (typeof resolvedCallback !== "function") {
68
- throw new SdkError("configuration_error", "withLogBrewNativeBridgeScope requires a callback");
53
+ /**
54
+ * @param {unknown} nativeBridge
55
+ * @param {unknown} result
56
+ * @returns {PromiseLike<unknown>}
57
+ */
58
+ function settleScopePromise(nativeBridge, result) {
59
+ /**
60
+ * @param {unknown} value
61
+ * @returns {unknown}
62
+ */
63
+ function clearAfterValue(value) {
64
+ clearLogBrewNativeBridgeScope(nativeBridge);
65
+ return value;
69
66
  }
70
67
 
71
- const payload = syncLogBrewNativeBridgeScope(nativeBridge, resolvedOptions);
72
- let result;
73
- try {
74
- result = resolvedCallback(payload);
75
- if (result && typeof result.then === "function") {
76
- return Promise.resolve(result).then(
77
- (value) => {
78
- clearLogBrewNativeBridgeScope(nativeBridge);
79
- return value;
80
- },
81
- (error) => {
82
- clearPreservingFailure(nativeBridge);
83
- throw error;
84
- }
85
- );
86
- }
87
- } catch (error) {
68
+ /**
69
+ * @param {unknown} error
70
+ * @returns {never}
71
+ */
72
+ function clearAfterFailure(error) {
88
73
  clearPreservingFailure(nativeBridge);
89
74
  throw error;
90
75
  }
91
- clearLogBrewNativeBridgeScope(nativeBridge);
92
- return result;
76
+
77
+ return Promise.resolve(result).then(clearAfterValue, clearAfterFailure);
93
78
  }
94
79
 
95
- async function withLogBrewNativeBridgeScopeAsync(nativeBridge, options, callback) {
96
- const resolvedOptions = typeof options === "function" ? {} : options ?? {};
97
- const resolvedCallback = typeof options === "function" ? options : callback;
98
- if (typeof resolvedCallback !== "function") {
99
- throw new SdkError("configuration_error", "withLogBrewNativeBridgeScopeAsync requires a callback");
100
- }
101
- if (nativeBridge === null || (typeof nativeBridge !== "object" && typeof nativeBridge !== "function")) {
102
- throw new SdkError("configuration_error", "async native bridge scope requires an adapter object or function");
103
- }
104
- const queue = ASYNC_BRIDGE_QUEUES.get(nativeBridge) ?? { pending: 0, tail: Promise.resolve() };
105
- if (queue.pending >= MAX_PENDING_ASYNC_SCOPES) {
106
- throw new SdkError("native_scope_queue_full", "async native bridge scope queue is full");
107
- }
108
- queue.pending += 1;
109
- ASYNC_BRIDGE_QUEUES.set(nativeBridge, queue);
110
- let sync;
111
- let clear;
112
- let payload;
80
+ /**
81
+ * @param {unknown} nativeBridge
82
+ * @param {Callable} work
83
+ * @param {NativeBridgeScope} payload
84
+ * @returns {ScopeOutcome}
85
+ */
86
+ function runScopeCallback(nativeBridge, work, payload) {
113
87
  try {
114
- sync = bridgeSync(nativeBridge);
115
- clear = bridgeClear(nativeBridge, true);
116
- payload = createLogBrewNativeBridgeScope(resolvedOptions);
117
- if (Object.keys(payload.metadata).length > MAX_ASYNC_SCOPE_METADATA_ENTRIES
118
- || JSON.stringify(payload).length > MAX_ASYNC_SCOPE_JSON_LENGTH) {
119
- throw new SdkError("native_scope_too_large", "async native bridge scope exceeds its payload limit");
88
+ const result = work(payload);
89
+ if (isCallable(readField(result, "then"))) {
90
+ return { settled: false, value: settleScopePromise(nativeBridge, result) };
120
91
  }
92
+ return { settled: true, value: result };
121
93
  } catch (error) {
122
- releaseAsyncScopeReservation(nativeBridge, queue);
94
+ clearPreservingFailure(nativeBridge);
123
95
  throw error;
124
96
  }
125
- return runQueuedNativeBridgeScope(nativeBridge, queue, sync, clear, payload, resolvedCallback);
126
- }
127
-
128
- async function runQueuedNativeBridgeScope(nativeBridge, queue, sync, clear, payload, callback) {
129
- const previous = queue.tail;
130
- let release;
131
- const completion = new Promise((resolve) => { release = resolve; });
132
- const turn = previous.then(() => completion);
133
- queue.tail = turn;
134
- await previous;
135
- try {
136
- await clear();
137
- let result;
138
- try {
139
- await sync(payload);
140
- result = await callback(payload);
141
- } catch (error) {
142
- try {
143
- await clear();
144
- } catch {
145
- // Preserve the setter or callback failure after attempting scope clear.
146
- }
147
- throw error;
148
- }
149
- await clear();
150
- return result;
151
- } finally {
152
- release();
153
- releaseAsyncScopeReservation(nativeBridge, queue);
154
- }
155
97
  }
156
98
 
157
- function releaseAsyncScopeReservation(nativeBridge, queue) {
158
- queue.pending -= 1;
159
- if (queue.pending === 0) {
160
- ASYNC_BRIDGE_QUEUES.delete(nativeBridge);
99
+ /**
100
+ * @param {unknown} nativeBridge
101
+ * @param {NativeBridgeScopeInput | Callable | null | undefined} options
102
+ * @param {unknown} [work]
103
+ * @returns {unknown}
104
+ */
105
+ function withLogBrewNativeBridgeScope(nativeBridge, options, work) {
106
+ const resolvedOptions = typeof options === "function" ? {} : options ?? {};
107
+ const resolvedWork = typeof options === "function" ? options : work;
108
+ if (!isCallable(resolvedWork)) {
109
+ throw new SdkError("configuration_error", "withLogBrewNativeBridgeScope requires a callback");
161
110
  }
162
- }
163
111
 
164
- function clearPreservingFailure(nativeBridge) {
165
- try {
112
+ const payload = syncLogBrewNativeBridgeScope(nativeBridge, resolvedOptions);
113
+ const outcome = runScopeCallback(nativeBridge, resolvedWork, payload);
114
+ if (outcome.settled) {
166
115
  clearLogBrewNativeBridgeScope(nativeBridge);
167
- } catch {
168
- // Keep the original failure when clearing the scope also fails.
169
- }
170
- }
171
-
172
- function bridgeSync(nativeBridge) {
173
- if (typeof nativeBridge === "function") {
174
- return nativeBridge;
175
- }
176
- if (nativeBridge && typeof nativeBridge.setLogBrewScope === "function") {
177
- return nativeBridge.setLogBrewScope.bind(nativeBridge);
178
- }
179
- if (nativeBridge && typeof nativeBridge.syncLogBrewScope === "function") {
180
- return nativeBridge.syncLogBrewScope.bind(nativeBridge);
181
- }
182
- throw new SdkError(
183
- "configuration_error",
184
- "LogBrew native bridge scope sync requires a function, setLogBrewScope, or syncLogBrewScope"
185
- );
186
- }
187
-
188
- function bridgeClear(nativeBridge, required = false) {
189
- if (nativeBridge && typeof nativeBridge.clearLogBrewScope === "function") {
190
- return nativeBridge.clearLogBrewScope.bind(nativeBridge);
191
- }
192
- if (nativeBridge && typeof nativeBridge.clearLogBrewTraceContext === "function") {
193
- return nativeBridge.clearLogBrewTraceContext.bind(nativeBridge);
194
- }
195
- if (typeof nativeBridge === "function") {
196
- return () => nativeBridge(undefined);
197
- }
198
- if (required) {
199
- throw new SdkError(
200
- "configuration_error",
201
- "async LogBrew native bridge scope requires clearLogBrewScope or clearLogBrewTraceContext"
202
- );
203
- }
204
- return () => {};
205
- }
206
-
207
- function compactMetadata(metadata) {
208
- const compacted = {};
209
- for (const [key, value] of Object.entries(metadata)) {
210
- if (value === undefined) {
211
- continue;
212
- }
213
- if (RESERVED_TRACE_METADATA_KEYS.has(key)) {
214
- continue;
215
- }
216
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) {
217
- compacted[key] = value;
218
- }
219
116
  }
220
- return compacted;
117
+ return outcome.value;
221
118
  }
222
119
 
223
120
  const defaultExport = {
@@ -1,94 +1,2 @@
1
- import type { Metadata } from "@logbrew/sdk";
2
- import type { ReactNativeTraceInput } from "./index.js";
3
-
4
- export type LogBrewNativeBridgeScope = {
5
- trace?: {
6
- traceId: string;
7
- spanId: string;
8
- parentSpanId?: string;
9
- traceFlags: string;
10
- traceSampled: boolean;
11
- };
12
- metadata: Metadata;
13
- };
14
-
15
- export type LogBrewNativeBridgeLike =
16
- | ((scope: LogBrewNativeBridgeScope | undefined) => void)
17
- | {
18
- setLogBrewScope?: (scope: LogBrewNativeBridgeScope) => void;
19
- syncLogBrewScope?: (scope: LogBrewNativeBridgeScope) => void;
20
- clearLogBrewScope?: () => void;
21
- clearLogBrewTraceContext?: () => void;
22
- };
23
-
24
- export type LogBrewNativeBridgeScopeInput = {
25
- logger?: string;
26
- metadata?: Metadata;
27
- screen?: string;
28
- sessionId?: string;
29
- source?: string;
30
- trace?: ReactNativeTraceInput;
31
- };
32
-
33
- export type LogBrewAsyncNativeBridgeLike =
34
- | ((scope: LogBrewNativeBridgeScope | undefined) => void | PromiseLike<void>)
35
- | ({
36
- setLogBrewScope?: (scope: LogBrewNativeBridgeScope) => void | PromiseLike<void>;
37
- syncLogBrewScope?: (scope: LogBrewNativeBridgeScope) => void | PromiseLike<void>;
38
- } & (
39
- | { clearLogBrewScope: () => void | PromiseLike<void> }
40
- | { clearLogBrewTraceContext: () => void | PromiseLike<void> }
41
- ));
42
-
43
- export declare function createLogBrewNativeBridgeScope(
44
- input?: LogBrewNativeBridgeScopeInput
45
- ): LogBrewNativeBridgeScope;
46
- export declare function syncLogBrewNativeBridgeScope(
47
- nativeBridge: LogBrewNativeBridgeLike,
48
- input?: LogBrewNativeBridgeScopeInput
49
- ): LogBrewNativeBridgeScope;
50
- export declare function clearLogBrewNativeBridgeScope(
51
- nativeBridge: LogBrewNativeBridgeLike
52
- ): void;
53
- export declare function withLogBrewNativeBridgeScope<TResult>(
54
- nativeBridge: LogBrewNativeBridgeLike,
55
- callback: (scope: LogBrewNativeBridgeScope) => TResult
56
- ): TResult;
57
- export declare function withLogBrewNativeBridgeScope<TResult>(
58
- nativeBridge: LogBrewNativeBridgeLike,
59
- input: LogBrewNativeBridgeScopeInput,
60
- callback: (scope: LogBrewNativeBridgeScope) => TResult
61
- ): TResult;
62
-
63
- /**
64
- * Serializes calls to this helper for the same adapter object or function.
65
- * Clears native scope before and after each callback, including rejection.
66
- * Snapshots input at enqueue time and awaits native setters and clear methods.
67
- * Allows 128 active or queued calls per adapter; excess calls reject with
68
- * native_scope_queue_full before input is snapshotted. Each scope permits at
69
- * most 64 metadata entries, including derived fields, and 8192 UTF-16 code
70
- * units in its JSON representation. Larger scopes reject with native_scope_too_large.
71
- * External scope writes and the synchronous helper do not share this queue.
72
- * Do not await another call on the same bridge from inside its callback.
73
- * An unsettled callback keeps its scope and queue slot. There is no timeout or
74
- * cancellation contract; queued callbacks wait until it settles and native scope is cleared.
75
- */
76
- export declare function withLogBrewNativeBridgeScopeAsync<TResult>(
77
- nativeBridge: LogBrewAsyncNativeBridgeLike,
78
- callback: (scope: LogBrewNativeBridgeScope) => TResult
79
- ): Promise<Awaited<TResult>>;
80
- export declare function withLogBrewNativeBridgeScopeAsync<TResult>(
81
- nativeBridge: LogBrewAsyncNativeBridgeLike,
82
- input: LogBrewNativeBridgeScopeInput,
83
- callback: (scope: LogBrewNativeBridgeScope) => TResult
84
- ): Promise<Awaited<TResult>>;
85
-
86
- declare const defaultExport: {
87
- clearLogBrewNativeBridgeScope: typeof clearLogBrewNativeBridgeScope;
88
- createLogBrewNativeBridgeScope: typeof createLogBrewNativeBridgeScope;
89
- syncLogBrewNativeBridgeScope: typeof syncLogBrewNativeBridgeScope;
90
- withLogBrewNativeBridgeScope: typeof withLogBrewNativeBridgeScope;
91
- withLogBrewNativeBridgeScopeAsync: typeof withLogBrewNativeBridgeScopeAsync;
92
- };
93
-
94
- export default defaultExport;
1
+ export * from "./native-bridge.js";
2
+ export { default } from "./native-bridge.js";
@@ -1,7 +1,7 @@
1
1
  import type { Metadata } from "@logbrew/sdk";
2
2
  import type { ReactNativeTraceInput } from "./index.js";
3
3
 
4
- export type LogBrewNativeBridgeScope = {
4
+ type LogBrewNativeBridgeScope = {
5
5
  trace?: {
6
6
  traceId: string;
7
7
  spanId: string;
@@ -12,7 +12,7 @@ export type LogBrewNativeBridgeScope = {
12
12
  metadata: Metadata;
13
13
  };
14
14
 
15
- export type LogBrewNativeBridgeLike =
15
+ type LogBrewNativeBridgeLike =
16
16
  | ((scope: LogBrewNativeBridgeScope | undefined) => void)
17
17
  | {
18
18
  setLogBrewScope?: (scope: LogBrewNativeBridgeScope) => void;
@@ -21,7 +21,7 @@ export type LogBrewNativeBridgeLike =
21
21
  clearLogBrewTraceContext?: () => void;
22
22
  };
23
23
 
24
- export type LogBrewNativeBridgeScopeInput = {
24
+ type LogBrewNativeBridgeScopeInput = {
25
25
  logger?: string;
26
26
  metadata?: Metadata;
27
27
  screen?: string;
@@ -30,7 +30,7 @@ export type LogBrewNativeBridgeScopeInput = {
30
30
  trace?: ReactNativeTraceInput;
31
31
  };
32
32
 
33
- export type LogBrewAsyncNativeBridgeLike =
33
+ type LogBrewAsyncNativeBridgeLike =
34
34
  | ((scope: LogBrewNativeBridgeScope | undefined) => void | PromiseLike<void>)
35
35
  | ({
36
36
  setLogBrewScope?: (scope: LogBrewNativeBridgeScope) => void | PromiseLike<void>;
@@ -40,24 +40,24 @@ export type LogBrewAsyncNativeBridgeLike =
40
40
  | { clearLogBrewTraceContext: () => void | PromiseLike<void> }
41
41
  ));
42
42
 
43
- export declare function createLogBrewNativeBridgeScope(
43
+ declare function createLogBrewNativeBridgeScope(
44
44
  input?: LogBrewNativeBridgeScopeInput
45
45
  ): LogBrewNativeBridgeScope;
46
- export declare function syncLogBrewNativeBridgeScope(
46
+ declare function syncLogBrewNativeBridgeScope(
47
47
  nativeBridge: LogBrewNativeBridgeLike,
48
48
  input?: LogBrewNativeBridgeScopeInput
49
49
  ): LogBrewNativeBridgeScope;
50
- export declare function clearLogBrewNativeBridgeScope(
50
+ declare function clearLogBrewNativeBridgeScope(
51
51
  nativeBridge: LogBrewNativeBridgeLike
52
52
  ): void;
53
- export declare function withLogBrewNativeBridgeScope<TResult>(
53
+ declare function withLogBrewNativeBridgeScope<TResult>(
54
54
  nativeBridge: LogBrewNativeBridgeLike,
55
- callback: (scope: LogBrewNativeBridgeScope) => TResult
55
+ operation: (scope: LogBrewNativeBridgeScope) => TResult
56
56
  ): TResult;
57
- export declare function withLogBrewNativeBridgeScope<TResult>(
57
+ declare function withLogBrewNativeBridgeScope<TResult>(
58
58
  nativeBridge: LogBrewNativeBridgeLike,
59
59
  input: LogBrewNativeBridgeScopeInput,
60
- callback: (scope: LogBrewNativeBridgeScope) => TResult
60
+ operation: (scope: LogBrewNativeBridgeScope) => TResult
61
61
  ): TResult;
62
62
 
63
63
  /**
@@ -73,14 +73,14 @@ export declare function withLogBrewNativeBridgeScope<TResult>(
73
73
  * An unsettled callback keeps its scope and queue slot. There is no timeout or
74
74
  * cancellation contract; queued callbacks wait until it settles and native scope is cleared.
75
75
  */
76
- export declare function withLogBrewNativeBridgeScopeAsync<TResult>(
76
+ declare function withLogBrewNativeBridgeScopeAsync<TResult>(
77
77
  nativeBridge: LogBrewAsyncNativeBridgeLike,
78
- callback: (scope: LogBrewNativeBridgeScope) => TResult
78
+ operation: (scope: LogBrewNativeBridgeScope) => TResult
79
79
  ): Promise<Awaited<TResult>>;
80
- export declare function withLogBrewNativeBridgeScopeAsync<TResult>(
80
+ declare function withLogBrewNativeBridgeScopeAsync<TResult>(
81
81
  nativeBridge: LogBrewAsyncNativeBridgeLike,
82
82
  input: LogBrewNativeBridgeScopeInput,
83
- callback: (scope: LogBrewNativeBridgeScope) => TResult
83
+ operation: (scope: LogBrewNativeBridgeScope) => TResult
84
84
  ): Promise<Awaited<TResult>>;
85
85
 
86
86
  declare const defaultExport: {
@@ -91,4 +91,17 @@ declare const defaultExport: {
91
91
  withLogBrewNativeBridgeScopeAsync: typeof withLogBrewNativeBridgeScopeAsync;
92
92
  };
93
93
 
94
+ export type {
95
+ LogBrewAsyncNativeBridgeLike,
96
+ LogBrewNativeBridgeLike,
97
+ LogBrewNativeBridgeScope,
98
+ LogBrewNativeBridgeScopeInput
99
+ };
100
+ export {
101
+ createLogBrewNativeBridgeScope,
102
+ syncLogBrewNativeBridgeScope,
103
+ clearLogBrewNativeBridgeScope,
104
+ withLogBrewNativeBridgeScope,
105
+ withLogBrewNativeBridgeScopeAsync
106
+ };
94
107
  export default defaultExport;