react-native-nitro-tracing 0.6.0

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 (233) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +21 -0
  3. package/NitroTracing.podspec +32 -0
  4. package/README.md +75 -0
  5. package/android/CMakeLists.txt +49 -0
  6. package/android/build.gradle +133 -0
  7. package/android/fix-prefab.gradle +51 -0
  8. package/android/gradle.properties +5 -0
  9. package/android/proguard-rules.pro +5 -0
  10. package/android/src/main/AndroidManifest.xml +2 -0
  11. package/android/src/main/cpp/cpp-adapter.cpp +47 -0
  12. package/android/src/main/java/com/margelo/nitro/nitrotracing/HermesSamplingGuard.kt +43 -0
  13. package/android/src/main/java/com/margelo/nitro/nitrotracing/NitroTracingFrameSource.kt +36 -0
  14. package/android/src/main/java/com/margelo/nitro/nitrotracing/NitroTracingPackage.kt +31 -0
  15. package/client.ts +15 -0
  16. package/cpp/HermesSampling.cpp +26 -0
  17. package/cpp/HermesSampling.hpp +10 -0
  18. package/cpp/HybridRecording.cpp +66 -0
  19. package/cpp/HybridRecording.hpp +30 -0
  20. package/cpp/HybridTraceSpan.cpp +10 -0
  21. package/cpp/HybridTraceSpan.hpp +17 -0
  22. package/cpp/HybridTracing.cpp +10 -0
  23. package/cpp/HybridTracing.hpp +10 -0
  24. package/cpp/NativeConversions.cpp +77 -0
  25. package/cpp/NativeConversions.hpp +15 -0
  26. package/cpp/core/NativeSampler.cpp +152 -0
  27. package/cpp/core/NativeSampler.hpp +56 -0
  28. package/cpp/core/Recorder.cpp +218 -0
  29. package/cpp/core/Recorder.hpp +60 -0
  30. package/cpp/core/Retention.cpp +26 -0
  31. package/cpp/core/Retention.hpp +7 -0
  32. package/cpp/core/TraceJson.cpp +214 -0
  33. package/cpp/core/TraceJson.hpp +7 -0
  34. package/cpp/core/TraceTypes.hpp +62 -0
  35. package/expo.ts +2 -0
  36. package/ios/NitroTracingFrameSource.mm +35 -0
  37. package/lib/commonjs/client.cjs +767 -0
  38. package/lib/commonjs/client.cjs.map +7 -0
  39. package/lib/commonjs/expo.cjs +88 -0
  40. package/lib/commonjs/expo.cjs.map +7 -0
  41. package/lib/commonjs/index.cjs +28 -0
  42. package/lib/commonjs/index.cjs.map +7 -0
  43. package/lib/commonjs/performance.cjs +112 -0
  44. package/lib/commonjs/performance.cjs.map +7 -0
  45. package/lib/commonjs/plugins.cjs +477 -0
  46. package/lib/commonjs/plugins.cjs.map +7 -0
  47. package/lib/commonjs/react.cjs +3833 -0
  48. package/lib/commonjs/react.cjs.map +7 -0
  49. package/lib/commonjs/release-profiler.cjs +142 -0
  50. package/lib/commonjs/release-profiler.cjs.map +7 -0
  51. package/lib/commonjs/sentry.cjs +188 -0
  52. package/lib/commonjs/sentry.cjs.map +7 -0
  53. package/lib/module/client.mjs +768 -0
  54. package/lib/module/client.mjs.map +7 -0
  55. package/lib/module/expo.mjs +62 -0
  56. package/lib/module/expo.mjs.map +7 -0
  57. package/lib/module/index.mjs +7 -0
  58. package/lib/module/index.mjs.map +7 -0
  59. package/lib/module/performance.mjs +89 -0
  60. package/lib/module/performance.mjs.map +7 -0
  61. package/lib/module/plugins.mjs +461 -0
  62. package/lib/module/plugins.mjs.map +7 -0
  63. package/lib/module/react.mjs +3851 -0
  64. package/lib/module/react.mjs.map +7 -0
  65. package/lib/module/release-profiler.mjs +137 -0
  66. package/lib/module/release-profiler.mjs.map +7 -0
  67. package/lib/module/sentry.mjs +165 -0
  68. package/lib/module/sentry.mjs.map +7 -0
  69. package/lib/typescript/client.d.ts +4 -0
  70. package/lib/typescript/expo.d.ts +2 -0
  71. package/lib/typescript/performance.d.ts +2 -0
  72. package/lib/typescript/plugins.d.ts +12 -0
  73. package/lib/typescript/react.d.ts +5 -0
  74. package/lib/typescript/release-profiler.d.ts +2 -0
  75. package/lib/typescript/sentry.d.ts +2 -0
  76. package/lib/typescript/src/client/TracingSink.d.ts +10 -0
  77. package/lib/typescript/src/client/createTraceClient.d.ts +82 -0
  78. package/lib/typescript/src/client/playground.d.ts +12 -0
  79. package/lib/typescript/src/expo/ExpoAdapter.d.ts +15 -0
  80. package/lib/typescript/src/expo/index.d.ts +2 -0
  81. package/lib/typescript/src/index.d.ts +6 -0
  82. package/lib/typescript/src/plugins/TracePlugin.d.ts +22 -0
  83. package/lib/typescript/src/plugins/errors.d.ts +15 -0
  84. package/lib/typescript/src/plugins/nativeMetrics.d.ts +13 -0
  85. package/lib/typescript/src/plugins/navigation.d.ts +29 -0
  86. package/lib/typescript/src/plugins/network.d.ts +23 -0
  87. package/lib/typescript/src/plugins/orderSpans.d.ts +3 -0
  88. package/lib/typescript/src/plugins/performance.d.ts +13 -0
  89. package/lib/typescript/src/plugins/releaseProfiler.d.ts +25 -0
  90. package/lib/typescript/src/plugins/runtimeMetrics.d.ts +17 -0
  91. package/lib/typescript/src/plugins/sentry.d.ts +15 -0
  92. package/lib/typescript/src/plugins/startPlugins.d.ts +4 -0
  93. package/lib/typescript/src/react/DetailView.d.ts +11 -0
  94. package/lib/typescript/src/react/ExplorerFilters.d.ts +9 -0
  95. package/lib/typescript/src/react/ExplorerView.d.ts +9 -0
  96. package/lib/typescript/src/react/InspectorControls.d.ts +229 -0
  97. package/lib/typescript/src/react/InspectorHeader.d.ts +8 -0
  98. package/lib/typescript/src/react/InspectorSheet.d.ts +16 -0
  99. package/lib/typescript/src/react/MetricsView.d.ts +7 -0
  100. package/lib/typescript/src/react/SummaryView.d.ts +11 -0
  101. package/lib/typescript/src/react/TimelineView.d.ts +8 -0
  102. package/lib/typescript/src/react/TraceInspector.d.ts +11 -0
  103. package/lib/typescript/src/react/TraceOverlay.d.ts +17 -0
  104. package/lib/typescript/src/react/explorerModel.d.ts +38 -0
  105. package/lib/typescript/src/react/labels.d.ts +203 -0
  106. package/lib/typescript/src/react/native.d.ts +42 -0
  107. package/lib/typescript/src/react/readSnapshot.d.ts +4 -0
  108. package/lib/typescript/src/react/store.d.ts +9 -0
  109. package/lib/typescript/src/react/topics.d.ts +80 -0
  110. package/lib/typescript/src/react/useAppReadyMetric.d.ts +3 -0
  111. package/lib/typescript/src/react/useLiveRecording.d.ts +4 -0
  112. package/lib/typescript/src/react/useTraceViewer.d.ts +140 -0
  113. package/lib/typescript/src/react/viewerModel.d.ts +59 -0
  114. package/lib/typescript/src/specs/Recording.nitro.d.ts +31 -0
  115. package/lib/typescript/src/specs/TraceSpan.nitro.d.ts +14 -0
  116. package/lib/typescript/src/specs/Tracing.nitro.d.ts +17 -0
  117. package/lib/typescript/src/types/CompletedSpanOptions.d.ts +15 -0
  118. package/lib/typescript/src/types/EventContext.d.ts +8 -0
  119. package/lib/typescript/src/types/MarkEvent.d.ts +4 -0
  120. package/lib/typescript/src/types/MarkOptions.d.ts +6 -0
  121. package/lib/typescript/src/types/MetricEvent.d.ts +8 -0
  122. package/lib/typescript/src/types/MetricOptions.d.ts +10 -0
  123. package/lib/typescript/src/types/NativeSamplingOptions.d.ts +7 -0
  124. package/lib/typescript/src/types/ReadOptions.d.ts +7 -0
  125. package/lib/typescript/src/types/RecordingOptions.d.ts +11 -0
  126. package/lib/typescript/src/types/RecordingStats.d.ts +25 -0
  127. package/lib/typescript/src/types/SpanEvent.d.ts +13 -0
  128. package/lib/typescript/src/types/SpanOptions.d.ts +6 -0
  129. package/lib/typescript/src/types/SpanOutcome.d.ts +2 -0
  130. package/lib/typescript/src/types/TraceAttribute.d.ts +7 -0
  131. package/lib/typescript/src/types/TraceAttributes.d.ts +3 -0
  132. package/lib/typescript/src/types/TraceContext.d.ts +10 -0
  133. package/lib/typescript/src/types/TracePage.d.ts +18 -0
  134. package/lib/typescript/src/types.d.ts +17 -0
  135. package/nitro.json +20 -0
  136. package/nitrogen/generated/.gitattributes +1 -0
  137. package/nitrogen/generated/android/NitroTracing+autolinking.cmake +83 -0
  138. package/nitrogen/generated/android/NitroTracing+autolinking.gradle +27 -0
  139. package/nitrogen/generated/android/NitroTracingOnLoad.cpp +49 -0
  140. package/nitrogen/generated/android/NitroTracingOnLoad.hpp +34 -0
  141. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrotracing/NitroTracingOnLoad.kt +35 -0
  142. package/nitrogen/generated/ios/NitroTracing+autolinking.rb +62 -0
  143. package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Bridge.cpp +17 -0
  144. package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Bridge.hpp +27 -0
  145. package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Umbrella.hpp +38 -0
  146. package/nitrogen/generated/ios/NitroTracingAutolinking.mm +35 -0
  147. package/nitrogen/generated/ios/NitroTracingAutolinking.swift +16 -0
  148. package/nitrogen/generated/shared/c++/CompletedSpanOptions.hpp +122 -0
  149. package/nitrogen/generated/shared/c++/HybridRecordingSpec.cpp +31 -0
  150. package/nitrogen/generated/shared/c++/HybridRecordingSpec.hpp +100 -0
  151. package/nitrogen/generated/shared/c++/HybridTraceSpanSpec.cpp +23 -0
  152. package/nitrogen/generated/shared/c++/HybridTraceSpanSpec.hpp +65 -0
  153. package/nitrogen/generated/shared/c++/HybridTracingSpec.cpp +22 -0
  154. package/nitrogen/generated/shared/c++/HybridTracingSpec.hpp +68 -0
  155. package/nitrogen/generated/shared/c++/MarkEvent.hpp +102 -0
  156. package/nitrogen/generated/shared/c++/MarkOptions.hpp +99 -0
  157. package/nitrogen/generated/shared/c++/MetricEvent.hpp +110 -0
  158. package/nitrogen/generated/shared/c++/MetricOptions.hpp +107 -0
  159. package/nitrogen/generated/shared/c++/NativeSamplingOptions.hpp +87 -0
  160. package/nitrogen/generated/shared/c++/ReadOptions.hpp +87 -0
  161. package/nitrogen/generated/shared/c++/RecordingOptions.hpp +95 -0
  162. package/nitrogen/generated/shared/c++/RecordingStats.hpp +123 -0
  163. package/nitrogen/generated/shared/c++/SpanEvent.hpp +121 -0
  164. package/nitrogen/generated/shared/c++/SpanOptions.hpp +99 -0
  165. package/nitrogen/generated/shared/c++/SpanOutcome.hpp +84 -0
  166. package/nitrogen/generated/shared/c++/TraceAttribute.hpp +87 -0
  167. package/nitrogen/generated/shared/c++/TracePage.hpp +111 -0
  168. package/package.json +236 -0
  169. package/performance.ts +2 -0
  170. package/plugins.ts +24 -0
  171. package/react-native.config.js +16 -0
  172. package/react.ts +10 -0
  173. package/release-profiler.ts +6 -0
  174. package/sentry.ts +2 -0
  175. package/src/client/TracingSink.ts +25 -0
  176. package/src/client/createTraceClient.ts +439 -0
  177. package/src/client/playground.ts +143 -0
  178. package/src/expo/ExpoAdapter.ts +71 -0
  179. package/src/expo/index.ts +2 -0
  180. package/src/index.ts +8 -0
  181. package/src/plugins/TracePlugin.ts +22 -0
  182. package/src/plugins/errors.ts +69 -0
  183. package/src/plugins/nativeMetrics.ts +26 -0
  184. package/src/plugins/navigation.ts +111 -0
  185. package/src/plugins/network.ts +178 -0
  186. package/src/plugins/orderSpans.ts +22 -0
  187. package/src/plugins/performance.ts +120 -0
  188. package/src/plugins/releaseProfiler.ts +123 -0
  189. package/src/plugins/runtimeMetrics.ts +131 -0
  190. package/src/plugins/sentry.ts +176 -0
  191. package/src/plugins/startPlugins.ts +58 -0
  192. package/src/react/DetailView.tsx +514 -0
  193. package/src/react/ExplorerFilters.tsx +151 -0
  194. package/src/react/ExplorerView.tsx +243 -0
  195. package/src/react/InspectorControls.tsx +651 -0
  196. package/src/react/InspectorHeader.tsx +171 -0
  197. package/src/react/InspectorSheet.tsx +89 -0
  198. package/src/react/MetricsView.tsx +182 -0
  199. package/src/react/SummaryView.tsx +121 -0
  200. package/src/react/TimelineView.tsx +87 -0
  201. package/src/react/TraceInspector.tsx +196 -0
  202. package/src/react/TraceOverlay.tsx +585 -0
  203. package/src/react/explorerModel.ts +285 -0
  204. package/src/react/labels.ts +234 -0
  205. package/src/react/native.tsx +159 -0
  206. package/src/react/readSnapshot.ts +58 -0
  207. package/src/react/store.ts +31 -0
  208. package/src/react/topics.ts +427 -0
  209. package/src/react/useAppReadyMetric.ts +10 -0
  210. package/src/react/useLiveRecording.ts +43 -0
  211. package/src/react/useTraceViewer.ts +333 -0
  212. package/src/react/viewerModel.ts +172 -0
  213. package/src/specs/Recording.nitro.ts +40 -0
  214. package/src/specs/TraceSpan.nitro.ts +14 -0
  215. package/src/specs/Tracing.nitro.ts +14 -0
  216. package/src/types/CompletedSpanOptions.ts +15 -0
  217. package/src/types/EventContext.ts +8 -0
  218. package/src/types/MarkEvent.ts +3 -0
  219. package/src/types/MarkOptions.ts +6 -0
  220. package/src/types/MetricEvent.ts +8 -0
  221. package/src/types/MetricOptions.ts +10 -0
  222. package/src/types/NativeSamplingOptions.ts +7 -0
  223. package/src/types/ReadOptions.ts +7 -0
  224. package/src/types/RecordingOptions.ts +11 -0
  225. package/src/types/RecordingStats.ts +25 -0
  226. package/src/types/SpanEvent.ts +13 -0
  227. package/src/types/SpanOptions.ts +6 -0
  228. package/src/types/SpanOutcome.ts +2 -0
  229. package/src/types/TraceAttribute.ts +7 -0
  230. package/src/types/TraceAttributes.ts +4 -0
  231. package/src/types/TraceContext.ts +10 -0
  232. package/src/types/TracePage.ts +18 -0
  233. package/src/types.ts +17 -0
@@ -0,0 +1,13 @@
1
+ import type { TracingEntry } from '../client/TracingSink';
2
+ import type performance from 'react-native-performance';
3
+ import type { PerformanceObserver } from 'react-native-performance';
4
+ import type { TracePlugin } from './TracePlugin';
5
+ /** Default measurement-source dependencies; supports the installed RN performance API. */
6
+ export interface PerformancePluginOptions {
7
+ /** Same clock used by the supplied observer's entries. */
8
+ performance: typeof performance;
9
+ /** PerformanceObserver from react-native-performance. */
10
+ PerformanceObserver: typeof PerformanceObserver;
11
+ }
12
+ /** Observe user timing without patching globals, clearing shared buffers or timing network bodies. */
13
+ export declare function createPerformancePlugin(api: PerformancePluginOptions, onEntry?: (entry: TracingEntry) => void): TracePlugin;
@@ -0,0 +1,25 @@
1
+ import type { TracePlugin } from './TracePlugin';
2
+ /** Injected optional react-native-release-profiler module; never imported by core. */
3
+ export interface ReleaseProfilerApi {
4
+ /** Start the process-wide Hermes sampler; false means unavailable. */
5
+ startProfiling(): boolean | void;
6
+ /** Stop and save a local profile artifact. */
7
+ stopProfiling(saveToDownloads?: boolean): Promise<string>;
8
+ }
9
+ /** Manually controlled profiler integration. Sampling never starts on plugin setup. */
10
+ export interface ReleaseProfilerPlugin extends TracePlugin {
11
+ /** Start one session owned by this plugin. */
12
+ startProfiling(): void;
13
+ /** Finish profiling and return the artifact's local path. */
14
+ stopProfiling(): Promise<string>;
15
+ /** Whether this plugin owns an active or stopping profile. */
16
+ isProfiling(): boolean;
17
+ /** Last successful artifact; not sent to remote exporters. */
18
+ getProfilePath(): string | undefined;
19
+ }
20
+ export interface ReleaseProfilerOptions {
21
+ /** Runs after every stop. Defaults to Tracing.disableHermesSampling(). */
22
+ stopSampler?: () => void;
23
+ }
24
+ /** Attach manual Hermes profile controls to a recording. */
25
+ export declare function createReleaseProfilerPlugin(api: ReleaseProfilerApi, options?: ReleaseProfilerOptions): ReleaseProfilerPlugin;
@@ -0,0 +1,17 @@
1
+ import type { TracePlugin } from './TracePlugin';
2
+ export interface RuntimeMetricsOptions {
3
+ /** Reporting interval in ms, minimum 250; default 1000. */
4
+ intervalMs?: number;
5
+ /** Observe JS requestAnimationFrame callbacks (not native UI frames). Default true. */
6
+ frames?: boolean;
7
+ }
8
+ /** Injectable clock/lifecycle surface for deterministic tests and alternate hosts. */
9
+ export interface RuntimeMetricsHost {
10
+ now(): number;
11
+ isActive(): boolean;
12
+ subscribe(listener: (active: boolean) => void): () => void;
13
+ requestFrame(callback: () => void): number;
14
+ cancelFrame(id: number): void;
15
+ }
16
+ /** Low-volume foreground JS health samples. No per-frame native calls or UI FPS claims. */
17
+ export declare function createRuntimeMetricsPlugin(options?: RuntimeMetricsOptions, host?: RuntimeMetricsHost): TracePlugin;
@@ -0,0 +1,15 @@
1
+ import type * as Sentry from '@sentry/react-native';
2
+ import type { TracePlugin } from './TracePlugin';
3
+ /** Optional Sentry capabilities; SDK initialization and consent remain app-owned. */
4
+ export interface SentryPluginOptions {
5
+ /** Inject an installed SDK. This module has no runtime SDK dependency. */
6
+ sentry: Pick<typeof Sentry, 'getClient' | 'spanToJSON' | 'startInactiveSpan'>;
7
+ /** Capture observable SDK spans locally. Defaults to false; sampling applies. */
8
+ captureSpans?: boolean;
9
+ /** Explicitly opt into sending retained span names/timing/status to Sentry on stop. Defaults to false. */
10
+ exportSpans?: boolean;
11
+ /** Only these sanitized custom attribute keys may leave the device. Defaults to none. */
12
+ exportedAttributeKeys?: readonly string[];
13
+ }
14
+ /** Optional SDK measurements and opt-in export; neither direction is enabled implicitly. */
15
+ export declare function createSentryPlugin(options: SentryPluginOptions): TracePlugin;
@@ -0,0 +1,4 @@
1
+ import type { Recording } from '../specs/Recording.nitro';
2
+ import type { PluginHandle, TracePlugin } from './TracePlugin';
3
+ /** Start optional integrations. Failures are isolated; stop waits for all cleanup. */
4
+ export declare function startPlugins(recording: Recording, plugins: readonly TracePlugin[], onError: (error: unknown) => void): PluginHandle;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { Metric, Viewer } from './useTraceViewer';
3
+ import type { InspectorTranslator } from './labels';
4
+ export declare function MetricDetail({ series, t, }: {
5
+ series: Metric;
6
+ t: InspectorTranslator;
7
+ }): React.JSX.Element;
8
+ export declare function DetailView({ v, t }: {
9
+ v: Viewer;
10
+ t: InspectorTranslator;
11
+ }): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { Viewer } from './useTraceViewer';
3
+ import type { InspectorTranslator } from './labels';
4
+ /** Draft filters: Apply commits them, Cancel discards them. Sorting lives in its own menu. */
5
+ export declare function ExplorerFilters({ v, t, close, }: {
6
+ v: Viewer;
7
+ t: InspectorTranslator;
8
+ close: () => void;
9
+ }): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { InspectorTranslator } from './labels';
3
+ import type { Viewer } from './useTraceViewer';
4
+ import { type Sort } from './explorerModel';
5
+ export declare const sortsFor: (mode: Viewer["mode"]) => Sort[];
6
+ export declare function ExplorerView({ v, t }: {
7
+ v: Viewer;
8
+ t: InspectorTranslator;
9
+ }): React.JSX.Element;
@@ -0,0 +1,229 @@
1
+ import React from 'react';
2
+ export declare const palette: {
3
+ bg: string;
4
+ panel: string;
5
+ line: string;
6
+ text: string;
7
+ muted: string;
8
+ accent: string;
9
+ selected: string;
10
+ error: string;
11
+ scrim: string;
12
+ };
13
+ export declare const ui: {
14
+ bottomNav: {
15
+ borderTopWidth: number;
16
+ borderColor: string;
17
+ paddingHorizontal: number;
18
+ paddingVertical: number;
19
+ alignItems: "center";
20
+ };
21
+ root: {
22
+ flex: number;
23
+ backgroundColor: string;
24
+ };
25
+ header: {
26
+ padding: number;
27
+ gap: number;
28
+ borderBottomWidth: number;
29
+ borderColor: string;
30
+ };
31
+ row: {
32
+ flexDirection: "row";
33
+ alignItems: "center";
34
+ gap: number;
35
+ flexWrap: "wrap";
36
+ };
37
+ spread: {
38
+ flexDirection: "row";
39
+ alignItems: "center";
40
+ justifyContent: "space-between";
41
+ gap: number;
42
+ };
43
+ content: {
44
+ padding: number;
45
+ gap: number;
46
+ };
47
+ title: {
48
+ fontSize: number;
49
+ fontWeight: "700";
50
+ color: string;
51
+ flexShrink: number;
52
+ };
53
+ heading: {
54
+ fontSize: number;
55
+ fontWeight: "600";
56
+ color: string;
57
+ };
58
+ text: {
59
+ fontSize: number;
60
+ color: string;
61
+ };
62
+ muted: {
63
+ fontSize: number;
64
+ lineHeight: number;
65
+ color: string;
66
+ };
67
+ error: {
68
+ color: string;
69
+ fontSize: number;
70
+ };
71
+ card: {
72
+ padding: number;
73
+ borderRadius: number;
74
+ backgroundColor: string;
75
+ gap: number;
76
+ };
77
+ item: {
78
+ padding: number;
79
+ borderBottomWidth: number;
80
+ borderColor: string;
81
+ gap: number;
82
+ };
83
+ input: {
84
+ borderWidth: number;
85
+ borderColor: string;
86
+ borderRadius: number;
87
+ paddingHorizontal: number;
88
+ paddingVertical: number;
89
+ color: string;
90
+ fontSize: number;
91
+ };
92
+ button: {
93
+ paddingHorizontal: number;
94
+ paddingVertical: number;
95
+ borderRadius: number;
96
+ backgroundColor: string;
97
+ borderWidth: number;
98
+ borderColor: string;
99
+ };
100
+ selected: {
101
+ backgroundColor: string;
102
+ borderColor: string;
103
+ };
104
+ buttonText: {
105
+ color: string;
106
+ fontSize: number;
107
+ fontWeight: "500";
108
+ };
109
+ selectedText: {
110
+ color: string;
111
+ };
112
+ link: {
113
+ color: string;
114
+ fontSize: number;
115
+ };
116
+ chart: {
117
+ height: number;
118
+ flexDirection: "row";
119
+ gap: number;
120
+ alignItems: "flex-end";
121
+ };
122
+ bar: {
123
+ flex: number;
124
+ backgroundColor: string;
125
+ minHeight: number;
126
+ };
127
+ track: {
128
+ height: number;
129
+ backgroundColor: string;
130
+ borderRadius: number;
131
+ overflow: "hidden";
132
+ };
133
+ };
134
+ export declare function Button({ label, onPress, selected, disabled, testID, }: {
135
+ label: string;
136
+ onPress: () => void;
137
+ selected?: boolean;
138
+ disabled?: boolean;
139
+ testID?: string;
140
+ }): React.JSX.Element;
141
+ export declare function Field({ label, value, onChange, numeric, }: {
142
+ label: string;
143
+ value: string;
144
+ onChange: (value: string) => void;
145
+ numeric?: boolean;
146
+ }): React.JSX.Element;
147
+ export declare const apple: {
148
+ grouped: string;
149
+ card: string;
150
+ separator: string;
151
+ secondary: string;
152
+ fill: string;
153
+ };
154
+ export declare function NavBar({ left, title, right, }: {
155
+ left?: React.ReactNode;
156
+ title: string;
157
+ right?: React.ReactNode;
158
+ }): React.JSX.Element;
159
+ /** Blue text or glyph button, as in iOS navigation bars and toolbars. */
160
+ export declare function TextButton({ label, icon, onPress, disabled, bold, accessibilityLabel, }: {
161
+ label?: string;
162
+ icon?: string;
163
+ onPress: () => void;
164
+ disabled?: boolean;
165
+ bold?: boolean;
166
+ accessibilityLabel?: string;
167
+ }): React.JSX.Element;
168
+ export declare function Section({ header, footer, children, }: {
169
+ header?: string;
170
+ footer?: string;
171
+ children: React.ReactNode;
172
+ }): React.JSX.Element;
173
+ export interface RowProps {
174
+ title: string;
175
+ subtitle?: string;
176
+ value?: string;
177
+ icon?: string;
178
+ iconColor?: string;
179
+ /** Tints title and value, e.g. errors. */
180
+ tint?: string;
181
+ onPress?: () => void;
182
+ /** Hide the separator on the last row of a section. */
183
+ last?: boolean;
184
+ /** Toggle row: shows a checkmark instead of a disclosure chevron. */
185
+ checked?: boolean;
186
+ }
187
+ /** Memoized: unchanged rows skip re-rendering when live data ticks. */
188
+ export declare const Row: React.MemoExoticComponent<({ title, subtitle, value, icon, iconColor, tint, onPress, last, checked, }: RowProps) => React.JSX.Element>;
189
+ export declare function SearchField({ value, onChange, placeholder, }: {
190
+ value: string;
191
+ onChange: (value: string) => void;
192
+ placeholder: string;
193
+ }): React.JSX.Element;
194
+ export declare function Segmented<T extends string>({ options, value, onChange, }: {
195
+ options: readonly {
196
+ value: T;
197
+ label: string;
198
+ }[];
199
+ value: T;
200
+ onChange: (value: T) => void;
201
+ }): React.JSX.Element;
202
+ export declare function TabBar<T extends string>({ items, value, onChange, }: {
203
+ items: readonly {
204
+ value: T;
205
+ label: string;
206
+ icon: string;
207
+ iconSize?: number;
208
+ }[];
209
+ value: T;
210
+ onChange: (value: T) => void;
211
+ }): React.JSX.Element;
212
+ export declare function Banner({ label, onPress, }: {
213
+ label: string;
214
+ onPress: () => void;
215
+ }): React.JSX.Element;
216
+ export interface SheetOption {
217
+ label: string;
218
+ onPress: () => void;
219
+ selected?: boolean;
220
+ destructive?: boolean;
221
+ disabled?: boolean;
222
+ }
223
+ /** iOS-style action sheet fallback (Android, or without @expo/ui). Mount only while open. */
224
+ export declare function ActionSheet({ title, options, cancelLabel, close, }: {
225
+ title?: string;
226
+ options: SheetOption[];
227
+ cancelLabel: string;
228
+ close: () => void;
229
+ }): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { Viewer } from './useTraceViewer';
3
+ import type { InspectorTranslator } from './labels';
4
+ /** Navigation bar, status line and live-update banner. Only this subscribes to the 1 s telemetry tick. */
5
+ export declare function InspectorHeader({ v: viewer, t, }: {
6
+ v: Viewer;
7
+ t: InspectorTranslator;
8
+ }): React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React, { type ReactNode } from 'react';
2
+ /**
3
+ * iOS page sheet: nav bar with Cancel and an optional primary action, grouped body.
4
+ * Mount only while open; a pre-mounted Modal inside the inspector's Modal presents unreliably.
5
+ */
6
+ export declare function InspectorSheet({ title, close, closeLabel, primary, children, }: {
7
+ title: string;
8
+ close: () => void;
9
+ closeLabel: string;
10
+ primary?: {
11
+ label: string;
12
+ onPress: () => void;
13
+ disabled?: boolean;
14
+ };
15
+ children: ReactNode;
16
+ }): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { Viewer } from './useTraceViewer';
3
+ import type { InspectorTranslator } from './labels';
4
+ export declare function MetricsView({ v, t }: {
5
+ v: Viewer;
6
+ t: InspectorTranslator;
7
+ }): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { InspectorTranslator } from './labels';
3
+ import type { Viewer } from './useTraceViewer';
4
+ import { type AnyEvent } from './topics';
5
+ /** Opens the matching detail; metric samples open their series. */
6
+ export declare const openEvent: (v: Viewer, event: AnyEvent) => void;
7
+ export declare function SummaryView({ v, t, budgetMs, }: {
8
+ v: Viewer;
9
+ t: InspectorTranslator;
10
+ budgetMs?: number;
11
+ }): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { InspectorTranslator } from './labels';
3
+ import type { Viewer } from './useTraceViewer';
4
+ /** Newest screen visit first; section headers are the screens the events happened on. */
5
+ export declare function TimelineView({ v, t }: {
6
+ v: Viewer;
7
+ t: InspectorTranslator;
8
+ }): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { TraceClient } from '../client/createTraceClient';
3
+ import { type Budgets } from './topics';
4
+ import { type InspectorLabels, type InspectorTranslator } from './labels';
5
+ export declare function TraceInspector({ client, labels, translate, budgets, }: {
6
+ client: TraceClient;
7
+ labels?: Partial<InspectorLabels>;
8
+ translate?: InspectorTranslator;
9
+ /** Local issue thresholds for the Summary and Timeline. */
10
+ budgets?: Partial<Budgets>;
11
+ }): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { TraceClient } from '../client/createTraceClient';
3
+ import { type InspectorLabels, type InspectorTranslator } from './labels';
4
+ import { type Budgets } from './topics';
5
+ /**
6
+ * Floating entry point and live, non-modal sheet for the current screen. The app stays
7
+ * usable above the sheet; mount it last at the app root. It sits below the app's own
8
+ * native modals. Rendering it is the app's decision (e.g. internal or UAT builds only).
9
+ */
10
+ export declare function TraceOverlay({ client, labels, translate, budgets, bottomOffset, }: {
11
+ client: TraceClient;
12
+ labels?: Partial<InspectorLabels>;
13
+ translate?: InspectorTranslator;
14
+ budgets?: Partial<Budgets>;
15
+ /** Dock the sheet this far above the bottom edge, e.g. the app's tab bar height, so it stays usable. */
16
+ bottomOffset?: number;
17
+ }): React.JSX.Element;
@@ -0,0 +1,38 @@
1
+ import type { MarkEvent, SpanEvent, TracePage } from '../types';
2
+ export type ExplorerMode = 'traces' | 'spans' | 'marks';
3
+ export type Sort = 'newest' | 'oldest' | 'longest' | 'shortest' | 'errors' | 'count' | 'name';
4
+ export interface Query {
5
+ search: string;
6
+ outcomes: string[];
7
+ sources: string[];
8
+ minDuration: string;
9
+ from: string;
10
+ to: string;
11
+ correlation: string;
12
+ sort: Sort;
13
+ }
14
+ export declare const defaultQuery: () => Query;
15
+ export type Event = SpanEvent | MarkEvent;
16
+ export interface Trace {
17
+ id: string;
18
+ name: string;
19
+ start: number;
20
+ duration: number;
21
+ errors: number;
22
+ spans: SpanEvent[];
23
+ marks: MarkEvent[];
24
+ sources: string[];
25
+ }
26
+ export declare const sourceOf: (event: Event) => string;
27
+ export declare const matchesSearch: (event: Event, search: string) => boolean;
28
+ export declare const buildTraces: (page: TracePage) => Trace[];
29
+ export declare const queryEvents: (events: Event[], query: Query) => Event[];
30
+ export declare const queryTraces: (traces: Trace[], query: Query) => Trace[];
31
+ export declare const hierarchyRows: (spans: SpanEvent[], collapsed: Set<string>) => {
32
+ span: SpanEvent;
33
+ depth: number;
34
+ children: number;
35
+ offset: number;
36
+ width: number;
37
+ }[];
38
+ export declare const traceForSpan: (traces: Trace[], span: SpanEvent) => Trace | undefined;