@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/native-bridge.cjs
CHANGED
|
@@ -1,53 +1,46 @@
|
|
|
1
1
|
const { SdkError } = require("@logbrew/sdk");
|
|
2
|
-
const {
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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 =
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
92
|
-
return result;
|
|
76
|
+
|
|
77
|
+
return Promise.resolve(result).then(clearAfterValue, clearAfterFailure);
|
|
93
78
|
}
|
|
94
79
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
-
|
|
165
|
-
|
|
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
|
|
117
|
+
return outcome.value;
|
|
221
118
|
}
|
|
222
119
|
|
|
223
120
|
const defaultExport = {
|
package/native-bridge.d.cts
CHANGED
|
@@ -1,94 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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";
|
package/native-bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from "@logbrew/sdk";
|
|
2
2
|
import type { ReactNativeTraceInput } from "./index.js";
|
|
3
3
|
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
+
declare function createLogBrewNativeBridgeScope(
|
|
44
44
|
input?: LogBrewNativeBridgeScopeInput
|
|
45
45
|
): LogBrewNativeBridgeScope;
|
|
46
|
-
|
|
46
|
+
declare function syncLogBrewNativeBridgeScope(
|
|
47
47
|
nativeBridge: LogBrewNativeBridgeLike,
|
|
48
48
|
input?: LogBrewNativeBridgeScopeInput
|
|
49
49
|
): LogBrewNativeBridgeScope;
|
|
50
|
-
|
|
50
|
+
declare function clearLogBrewNativeBridgeScope(
|
|
51
51
|
nativeBridge: LogBrewNativeBridgeLike
|
|
52
52
|
): void;
|
|
53
|
-
|
|
53
|
+
declare function withLogBrewNativeBridgeScope<TResult>(
|
|
54
54
|
nativeBridge: LogBrewNativeBridgeLike,
|
|
55
|
-
|
|
55
|
+
operation: (scope: LogBrewNativeBridgeScope) => TResult
|
|
56
56
|
): TResult;
|
|
57
|
-
|
|
57
|
+
declare function withLogBrewNativeBridgeScope<TResult>(
|
|
58
58
|
nativeBridge: LogBrewNativeBridgeLike,
|
|
59
59
|
input: LogBrewNativeBridgeScopeInput,
|
|
60
|
-
|
|
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
|
-
|
|
76
|
+
declare function withLogBrewNativeBridgeScopeAsync<TResult>(
|
|
77
77
|
nativeBridge: LogBrewAsyncNativeBridgeLike,
|
|
78
|
-
|
|
78
|
+
operation: (scope: LogBrewNativeBridgeScope) => TResult
|
|
79
79
|
): Promise<Awaited<TResult>>;
|
|
80
|
-
|
|
80
|
+
declare function withLogBrewNativeBridgeScopeAsync<TResult>(
|
|
81
81
|
nativeBridge: LogBrewAsyncNativeBridgeLike,
|
|
82
82
|
input: LogBrewNativeBridgeScopeInput,
|
|
83
|
-
|
|
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;
|