@qontinui/ui-bridge-native 0.3.1 → 0.4.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 (108) hide show
  1. package/dist/control/{index.d.mts → action-executor.d.ts} +6 -10
  2. package/dist/control/action-executor.d.ts.map +1 -0
  3. package/dist/control/index.d.ts +5 -95
  4. package/dist/control/index.d.ts.map +1 -0
  5. package/dist/{types-CjEKTDYT.d.ts → control/types.d.ts} +17 -20
  6. package/dist/control/types.d.ts.map +1 -0
  7. package/dist/core/element-identifier.d.ts +41 -0
  8. package/dist/core/element-identifier.d.ts.map +1 -0
  9. package/dist/core/index.d.ts +6 -43
  10. package/dist/core/index.d.ts.map +1 -0
  11. package/dist/{registry-pAUpQq2O.d.ts → core/registry.d.ts} +10 -13
  12. package/dist/core/registry.d.ts.map +1 -0
  13. package/dist/{types-CGVut7mc.d.mts → core/types.d.ts} +41 -41
  14. package/dist/core/types.d.ts.map +1 -0
  15. package/dist/debug/index.d.ts +4 -44
  16. package/dist/debug/index.d.ts.map +1 -0
  17. package/dist/debug/index.js +1 -1
  18. package/dist/debug/index.js.map +1 -1
  19. package/dist/debug/index.mjs +2 -2
  20. package/dist/debug/index.mjs.map +1 -1
  21. package/dist/debug/{index.d.mts → inspector.d.ts} +3 -6
  22. package/dist/debug/inspector.d.ts.map +1 -0
  23. package/dist/design/{index.d.mts → design-inspector-native.d.ts} +7 -11
  24. package/dist/design/design-inspector-native.d.ts.map +1 -0
  25. package/dist/{design-types-BHr6Q1FX.d.mts → design/design-types.d.ts} +10 -11
  26. package/dist/design/design-types.d.ts.map +1 -0
  27. package/dist/design/index.d.ts +5 -60
  28. package/dist/design/index.d.ts.map +1 -0
  29. package/dist/index.d.ts +37 -86
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +3 -3
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +4 -4
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/modal/index.d.ts +2 -0
  36. package/dist/modal/index.d.ts.map +1 -0
  37. package/dist/modal/modal-detector.d.ts +29 -0
  38. package/dist/modal/modal-detector.d.ts.map +1 -0
  39. package/dist/react/StateAnnotation.d.ts +30 -0
  40. package/dist/react/StateAnnotation.d.ts.map +1 -0
  41. package/dist/react/UIBridgeNativeProvider.d.ts +156 -0
  42. package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
  43. package/dist/react/index.d.ts +14 -69
  44. package/dist/react/index.d.ts.map +1 -0
  45. package/dist/react/index.js +3 -3
  46. package/dist/react/index.js.map +1 -1
  47. package/dist/react/index.mjs +4 -4
  48. package/dist/react/index.mjs.map +1 -1
  49. package/dist/react/{index.d.mts → useAutoRegister.d.ts} +7 -15
  50. package/dist/react/useAutoRegister.d.ts.map +1 -0
  51. package/dist/react/useUIBridge.d.ts +103 -0
  52. package/dist/react/useUIBridge.d.ts.map +1 -0
  53. package/dist/react/useUIBridgeModal.d.ts +14 -0
  54. package/dist/react/useUIBridgeModal.d.ts.map +1 -0
  55. package/dist/react/useUIBridgeToast.d.ts +25 -0
  56. package/dist/react/useUIBridgeToast.d.ts.map +1 -0
  57. package/dist/react/useUIComponent.d.ts +112 -0
  58. package/dist/react/useUIComponent.d.ts.map +1 -0
  59. package/dist/react/useUIElement.d.ts +162 -0
  60. package/dist/react/useUIElement.d.ts.map +1 -0
  61. package/dist/server/design-handlers.d.ts +47 -0
  62. package/dist/server/design-handlers.d.ts.map +1 -0
  63. package/dist/server/handlers.d.ts +25 -0
  64. package/dist/server/handlers.d.ts.map +1 -0
  65. package/dist/server/http-server.d.ts +262 -0
  66. package/dist/server/http-server.d.ts.map +1 -0
  67. package/dist/server/index.d.ts +14 -176
  68. package/dist/server/index.d.ts.map +1 -0
  69. package/dist/server/observability.d.ts +55 -0
  70. package/dist/server/observability.d.ts.map +1 -0
  71. package/dist/server/types.d.ts +368 -0
  72. package/dist/server/types.d.ts.map +1 -0
  73. package/dist/server/ws-connection.d.ts +48 -0
  74. package/dist/server/ws-connection.d.ts.map +1 -0
  75. package/dist/server/ws-event-bridge.d.ts +113 -0
  76. package/dist/server/ws-event-bridge.d.ts.map +1 -0
  77. package/dist/server/ws-protocol.d.ts +48 -0
  78. package/dist/server/ws-protocol.d.ts.map +1 -0
  79. package/dist/server/ws-types.d.ts +65 -0
  80. package/dist/server/ws-types.d.ts.map +1 -0
  81. package/dist/toast/index.d.ts +2 -0
  82. package/dist/toast/index.d.ts.map +1 -0
  83. package/dist/toast/toast-capture.d.ts +27 -0
  84. package/dist/toast/toast-capture.d.ts.map +1 -0
  85. package/dist/transport/CloudRelayClient.d.ts +51 -0
  86. package/dist/transport/CloudRelayClient.d.ts.map +1 -0
  87. package/dist/transport/DeviceAnnouncer.d.ts +75 -0
  88. package/dist/transport/DeviceAnnouncer.d.ts.map +1 -0
  89. package/dist/transport/index.d.ts +3 -0
  90. package/dist/transport/index.d.ts.map +1 -0
  91. package/dist/transport/logger.d.ts +23 -0
  92. package/dist/transport/logger.d.ts.map +1 -0
  93. package/dist/undo/index.d.ts +3 -0
  94. package/dist/undo/index.d.ts.map +1 -0
  95. package/dist/undo/undo-tracker.d.ts +59 -0
  96. package/dist/undo/undo-tracker.d.ts.map +1 -0
  97. package/package.json +3 -3
  98. package/dist/StateAnnotation--zm0Jfqj.d.ts +0 -755
  99. package/dist/StateAnnotation-BgFoVWFy.d.mts +0 -755
  100. package/dist/core/index.d.mts +0 -46
  101. package/dist/design-types-BHr6Q1FX.d.ts +0 -205
  102. package/dist/http-server--550eD1F.d.mts +0 -805
  103. package/dist/http-server-C9NaNBEP.d.ts +0 -805
  104. package/dist/index.d.mts +0 -89
  105. package/dist/registry-B5JadBN9.d.mts +0 -300
  106. package/dist/server/index.d.mts +0 -178
  107. package/dist/types-B0XA4vOF.d.mts +0 -197
  108. package/dist/types-CGVut7mc.d.ts +0 -567
@@ -1,567 +0,0 @@
1
- /**
2
- * UI Bridge Native Core Types
3
- *
4
- * Defines the fundamental types used throughout the UI Bridge Native framework.
5
- * Adapted from ui-bridge for React Native environments.
6
- */
7
- type AnyNativeElement = any;
8
- interface WaitOptions {
9
- /** Wait for element to be visible */
10
- visible?: boolean;
11
- /** Wait for element to be enabled */
12
- enabled?: boolean;
13
- /** Wait for element to have focus */
14
- focused?: boolean;
15
- /** Wait for element state to match */
16
- state?: Record<string, unknown>;
17
- /** Timeout in milliseconds */
18
- timeout?: number;
19
- /** Polling interval in milliseconds */
20
- interval?: number;
21
- }
22
- type ActionHandler<TParams = unknown, TResult = unknown> = (params?: TParams) => TResult | Promise<TResult>;
23
- interface CustomAction<TParams = unknown, TResult = unknown> {
24
- id: string;
25
- label?: string;
26
- description?: string;
27
- handler: ActionHandler<TParams, TResult>;
28
- }
29
- interface ComponentAction<TParams = unknown, TResult = unknown> {
30
- id: string;
31
- label?: string;
32
- description?: string;
33
- paramSchema?: Record<string, unknown>;
34
- handler: ActionHandler<TParams, TResult>;
35
- }
36
- type WorkflowStepType = 'element-action' | 'component-action' | 'wait' | 'assert' | 'navigate' | 'branch' | 'loop' | 'extract' | 'log' | 'custom';
37
- interface WorkflowStep {
38
- id: string;
39
- type: WorkflowStepType;
40
- target?: string;
41
- action?: string;
42
- params?: Record<string, unknown>;
43
- waitOptions?: WaitOptions;
44
- handler?: () => unknown | Promise<unknown>;
45
- }
46
- interface Workflow {
47
- id: string;
48
- name: string;
49
- description?: string;
50
- steps: WorkflowStep[];
51
- defaultParams?: Record<string, unknown>;
52
- }
53
- type BridgeEventType = 'element:registered' | 'element:unregistered' | 'element:stateChanged' | 'component:registered' | 'component:unregistered' | 'action:started' | 'action:completed' | 'action:failed' | 'workflow:started' | 'workflow:stepCompleted' | 'workflow:completed' | 'workflow:failed' | 'render:snapshot' | 'error';
54
- interface BridgeEvent<T = unknown> {
55
- type: BridgeEventType;
56
- timestamp: number;
57
- data: T;
58
- }
59
- type BridgeEventListener<T = unknown> = (event: BridgeEvent<T>) => void;
60
- /**
61
- * React Native element reference type.
62
- * Uses a generic type to avoid conflicts between different react-native versions.
63
- */
64
- type NativeElementRef = AnyNativeElement | null;
65
- /**
66
- * Element identification for React Native (replaces XPath/CSS selectors)
67
- */
68
- interface NativeElementIdentifier {
69
- /** Explicit UI Bridge identifier */
70
- uiId?: string;
71
- /** React Native testID prop */
72
- testId?: string;
73
- /** Accessibility label */
74
- accessibilityLabel?: string;
75
- /** Accessibility hint */
76
- accessibilityHint?: string;
77
- /** Tree path for element (e.g., "App/HomeScreen/Button[0]") */
78
- treePath: string;
79
- /** Native handle (platform-specific) */
80
- nativeHandle?: number;
81
- }
82
- /**
83
- * Layout information from onLayout callback
84
- */
85
- interface NativeLayout {
86
- /** X position relative to parent */
87
- x: number;
88
- /** Y position relative to parent */
89
- y: number;
90
- /** Element width */
91
- width: number;
92
- /** Element height */
93
- height: number;
94
- /** Absolute X position on screen (from measureInWindow) */
95
- pageX: number;
96
- /** Absolute Y position on screen (from measureInWindow) */
97
- pageY: number;
98
- }
99
- /**
100
- * Current state of a native UI element
101
- */
102
- interface NativeElementState {
103
- /** Whether the element is mounted in the tree */
104
- mounted: boolean;
105
- /** Whether the element is visible on screen */
106
- visible: boolean;
107
- /** Whether the element is enabled (not disabled) */
108
- enabled: boolean;
109
- /** Whether the element has focus */
110
- focused: boolean;
111
- /** Layout information */
112
- layout: NativeLayout | null;
113
- /** Current value for text inputs */
114
- value?: string;
115
- /** Selected state for toggles/checkboxes */
116
- selected?: boolean;
117
- /** Checked state for checkboxes/radios */
118
- checked?: boolean;
119
- /** Text content of the element */
120
- textContent?: string;
121
- /** Additional accessibility state */
122
- accessibilityState?: {
123
- disabled?: boolean;
124
- selected?: boolean;
125
- checked?: boolean | 'mixed';
126
- busy?: boolean;
127
- expanded?: boolean;
128
- };
129
- }
130
- /**
131
- * Types of native UI elements that can be registered
132
- */
133
- type NativeElementType = 'button' | 'input' | 'text' | 'view' | 'scroll' | 'list' | 'listItem' | 'switch' | 'checkbox' | 'radio' | 'image' | 'touchable' | 'pressable' | 'modal' | 'custom';
134
- /**
135
- * Standard actions available on native elements
136
- */
137
- type NativeStandardAction = 'press' | 'click' | 'longPress' | 'doubleTap' | 'type' | 'clear' | 'focus' | 'blur' | 'scroll' | 'swipe' | 'toggle';
138
- /**
139
- * Custom action definition for native elements
140
- */
141
- interface NativeCustomAction<TParams = unknown, TResult = unknown> {
142
- /** Action identifier */
143
- id: string;
144
- /** Human-readable label */
145
- label?: string;
146
- /** Description of what the action does */
147
- description?: string;
148
- /** Action handler function */
149
- handler: (params?: TParams) => TResult | Promise<TResult>;
150
- }
151
- /**
152
- * A native UI element registered with the bridge
153
- */
154
- interface RegisteredNativeElement {
155
- /** Unique identifier for this element */
156
- id: string;
157
- /** Reference to the native element */
158
- ref: React.RefObject<NativeElementRef>;
159
- /** Type of UI element */
160
- type: NativeElementType;
161
- /** Human-readable label */
162
- label?: string;
163
- /** Available standard actions for this element */
164
- actions: NativeStandardAction[];
165
- /** Custom actions specific to this element */
166
- customActions?: Record<string, NativeCustomAction>;
167
- /** Props passed to the element (for action execution) */
168
- props?: Record<string, unknown>;
169
- /** Function to get the current state */
170
- getState: () => NativeElementState;
171
- /** Function to get the element identifier */
172
- getIdentifier: () => NativeElementIdentifier;
173
- /** Timestamp when the element was registered */
174
- registeredAt: number;
175
- /** Whether this element is currently mounted */
176
- mounted: boolean;
177
- /** Route path where this element was registered (for page-scoped filtering) */
178
- registrationRoute?: string | null;
179
- /** Flattened RN style for design review */
180
- flatStyle?: Record<string, unknown>;
181
- /** State-specific style overrides (pressed, focused, disabled) */
182
- stateStyles?: {
183
- pressed?: Record<string, unknown>;
184
- focused?: Record<string, unknown>;
185
- disabled?: Record<string, unknown>;
186
- };
187
- }
188
- /**
189
- * Component action definition for native components
190
- */
191
- interface NativeComponentAction<TParams = unknown, TResult = unknown> {
192
- /** Action identifier */
193
- id: string;
194
- /** Human-readable label */
195
- label?: string;
196
- /** Description of what the action does */
197
- description?: string;
198
- /** Parameter schema (for documentation/validation) */
199
- paramSchema?: Record<string, unknown>;
200
- /** Action handler function */
201
- handler: (params?: TParams) => TResult | Promise<TResult>;
202
- }
203
- /**
204
- * A native component registered with the bridge (higher-level than elements)
205
- */
206
- interface RegisteredNativeComponent {
207
- /** Unique identifier for this component */
208
- id: string;
209
- /** Human-readable name */
210
- name: string;
211
- /** Description of the component's purpose */
212
- description?: string;
213
- /** Available actions on this component */
214
- actions: NativeComponentAction[];
215
- /** Child element IDs owned by this component */
216
- elementIds?: string[];
217
- /** Timestamp when the component was registered */
218
- registeredAt: number;
219
- /** Whether this component is currently mounted */
220
- mounted: boolean;
221
- }
222
- /**
223
- * Action request for native elements
224
- */
225
- interface NativeActionRequest {
226
- /** Action to execute */
227
- action: NativeStandardAction | string;
228
- /** Action parameters */
229
- params?: {
230
- /** Text to type */
231
- text?: string;
232
- /** Scroll offset */
233
- offset?: {
234
- x: number;
235
- y: number;
236
- };
237
- /** Swipe direction */
238
- direction?: 'up' | 'down' | 'left' | 'right';
239
- /** Duration in milliseconds */
240
- duration?: number;
241
- /** Additional custom parameters */
242
- [key: string]: unknown;
243
- };
244
- /** Wait options before executing */
245
- waitOptions?: WaitOptions;
246
- }
247
- /**
248
- * Response from a native action execution
249
- */
250
- interface NativeActionResponse {
251
- /** Whether the action succeeded */
252
- success: boolean;
253
- /** Element state after the action */
254
- elementState?: NativeElementState;
255
- /** Result of the action (for custom actions) */
256
- result?: unknown;
257
- /** Error message if failed */
258
- error?: string;
259
- /** Stack trace if failed */
260
- stack?: string;
261
- /** Duration of the action in milliseconds */
262
- durationMs: number;
263
- /** Timestamp when the action completed */
264
- timestamp: number;
265
- /** Request ID for correlation */
266
- requestId?: string;
267
- /** Time spent waiting for conditions */
268
- waitDurationMs?: number;
269
- }
270
- /**
271
- * Registration coverage metadata. Lets automation agents detect routes that
272
- * have interactive controls but never registered any of them with the bridge,
273
- * without having to read source code.
274
- *
275
- * - `totalRegistered`: number of elements currently in the registry.
276
- * - `everHadRegistrations`: sticks `true` once any element is registered, even
277
- * after every element has been unregistered. A route that registered then
278
- * unmounted should NOT be reported as "never wired".
279
- * - `byRoute`: count of currently-registered elements grouped by
280
- * `registrationRoute`. Elements registered without a route are bucketed
281
- * under `'?'`, which is itself a useful diagnostic signal.
282
- */
283
- interface NativeRegistrationCoverage {
284
- totalRegistered: number;
285
- everHadRegistrations: boolean;
286
- byRoute: Record<string, number>;
287
- }
288
- /**
289
- * Application info reported alongside snapshots/health responses.
290
- *
291
- * Re-export of the `appInfo` shape used in `NativeUIBridgeConfig` so
292
- * snapshot consumers can type-narrow without importing the config.
293
- */
294
- interface NativeAppInfo {
295
- appId: string;
296
- appName: string;
297
- appType: 'web' | 'desktop' | 'mobile' | 'other';
298
- framework?: string;
299
- }
300
- /**
301
- * Snapshot of the entire native UI bridge state
302
- */
303
- interface NativeBridgeSnapshot {
304
- /** Timestamp of the snapshot */
305
- timestamp: number;
306
- /** All registered elements */
307
- elements: Array<{
308
- id: string;
309
- type: NativeElementType;
310
- label?: string;
311
- identifier: NativeElementIdentifier;
312
- state: NativeElementState;
313
- actions: NativeStandardAction[];
314
- customActions?: string[];
315
- /** Handler names actually registered via updateElementProps (e.g. ['onPress', 'onChangeText']) */
316
- registeredHandlers?: string[];
317
- /** Route path where this element was registered (for page-scoped filtering) */
318
- registrationRoute?: string | null;
319
- }>;
320
- /** All registered components */
321
- components: Array<{
322
- id: string;
323
- name: string;
324
- description?: string;
325
- actions: string[];
326
- elementIds?: string[];
327
- }>;
328
- /** Available workflows */
329
- workflows: Array<{
330
- id: string;
331
- name: string;
332
- description?: string;
333
- stepCount: number;
334
- }>;
335
- /** Current navigation route path (if a RouteProvider is configured) */
336
- currentRoute?: string | null;
337
- /** Current route segments (if a RouteProvider is configured) */
338
- segments?: string[];
339
- /** Modal/sheet/drawer context (populated when a modalDetector enricher is registered) */
340
- modalStack?: NativeSnapshotModalContext;
341
- /** Toast/snackbar context (populated when a toastCapture enricher is registered) */
342
- toasts?: NativeSnapshotToastContext;
343
- /** Undo/redo context (populated when an undoTracker enricher is registered) */
344
- undoRedo?: NativeSnapshotUndoContext;
345
- /**
346
- * Registration coverage metadata so agents can detect routes that have
347
- * interactive controls but did not register them with the bridge.
348
- */
349
- registration?: NativeRegistrationCoverage;
350
- /**
351
- * Application info — appId, appName, appType, framework.
352
- *
353
- * Populated when the host wired `config.appInfo` on the server (e.g. via
354
- * `UIBridgeNativeProvider`'s `config.appInfo` prop). Mirrors the `uiBridge`
355
- * block returned by the `health` endpoint so agents can identify the app
356
- * from a snapshot alone — useful for the cloud relay path where the
357
- * bridge URL is opaque.
358
- *
359
- * Empty (undefined) when the host did not configure appInfo.
360
- */
361
- appInfo?: NativeAppInfo;
362
- }
363
- /** A single detected modal-like surface (modal, sheet, drawer, popover, alert) */
364
- interface NativeModalInfo {
365
- id: string;
366
- title?: string;
367
- type: 'modal' | 'sheet' | 'drawer' | 'popover' | 'alertdialog' | 'dialog';
368
- /** Whether the modal blocks interaction with the underlying UI */
369
- blocking: boolean;
370
- /** Whether it can be dismissed by the user (backdrop tap, swipe, esc, etc.) */
371
- dismissible: boolean;
372
- detectedAt: number;
373
- }
374
- /**
375
- * Modal context attached to a snapshot. Field names match the web SDK's
376
- * `SnapshotModalContext` so external agents can write transport-agnostic checks
377
- * like `snapshot.modalStack?.hasBlockingModal`.
378
- */
379
- interface NativeSnapshotModalContext {
380
- modals: NativeModalInfo[];
381
- topModal?: NativeModalInfo;
382
- hasBlockingModal: boolean;
383
- count: number;
384
- }
385
- /** A captured toast/snackbar */
386
- interface NativeCapturedToast {
387
- id: string;
388
- message: string;
389
- level: 'info' | 'success' | 'warning' | 'error' | 'loading' | 'unknown';
390
- appearedAt: number;
391
- dismissedAt?: number;
392
- visible: boolean;
393
- /** Total duration in ms (lifetime so far if still visible, total if dismissed) */
394
- durationMs: number;
395
- }
396
- /** Toast context attached to a snapshot */
397
- interface NativeSnapshotToastContext {
398
- /** Toasts currently on screen */
399
- active: NativeCapturedToast[];
400
- /** Recently-dismissed toasts retained by the capture buffer (most recent first) */
401
- recent: NativeCapturedToast[];
402
- /** Total number of toasts ever captured by this tracker */
403
- totalCaptured: number;
404
- }
405
- /**
406
- * Undo/redo context attached to a snapshot. Mirrors the web SDK's
407
- * `SnapshotUndoContext` minus DOM-only fields — RN has no `document.execCommand`
408
- * or selectors, so the native variant relies entirely on developer declaration.
409
- */
410
- interface NativeSnapshotUndoContext {
411
- /** Whether undo appears to be available */
412
- canUndo: boolean;
413
- /** Whether redo appears to be available */
414
- canRedo: boolean;
415
- /** Description of what undo would reverse */
416
- undoDescription?: string;
417
- /** Description of what redo would restore */
418
- redoDescription?: string;
419
- /** Undo stack depth (if known) */
420
- undoDepth?: number;
421
- /** Redo stack depth (if known) */
422
- redoDepth?: number;
423
- /** Human-readable summary for AI */
424
- summary: string;
425
- }
426
- /**
427
- * Modal-stack tracker contract. Surfaced in NativeSnapshotEnrichers so the
428
- * test-hook HTTP endpoints (`control/modal/push`, `control/modal/dismiss/:id`)
429
- * can drive the same instance the snapshot reads from. Any duck-typed
430
- * implementation that satisfies this shape can fill the slot — production
431
- * uses the `ModalDetector` class.
432
- */
433
- interface NativeModalDetectorLike {
434
- getSnapshotModalContext(): NativeSnapshotModalContext;
435
- pushModal(modal: {
436
- id: string;
437
- title?: string;
438
- type?: NativeModalInfo['type'];
439
- blocking?: boolean;
440
- dismissible?: boolean;
441
- }): void;
442
- dismissModal(id: string): boolean | void;
443
- getActive(): NativeModalInfo[];
444
- }
445
- /**
446
- * Canonical enricher slot. Each tracker exposes a `getSnapshot*Context()` method
447
- * that the registry calls during `createSnapshot`. NavigationTracker is intentionally
448
- * NOT here — route info already flows through `currentRoute` / `segments`.
449
- */
450
- interface NativeSnapshotEnrichers {
451
- modalDetector?: NativeModalDetectorLike;
452
- toastCapture?: {
453
- getSnapshotToastContext(): NativeSnapshotToastContext;
454
- };
455
- undoTracker?: {
456
- getSnapshotUndoContext(): NativeSnapshotUndoContext;
457
- };
458
- }
459
- /**
460
- * Pluggable snapshot enricher: receives base context and returns extra fields
461
- * that get `Object.assign`ed onto the snapshot. Used for ad-hoc/custom trackers
462
- * (e.g. runner sidebar tabs) without growing the canonical enricher set.
463
- */
464
- type NativeSnapshotEnricher = (ctx: {
465
- elements: RegisteredNativeElement[];
466
- currentRoute: string | null;
467
- }) => Record<string, unknown>;
468
- /**
469
- * Minimal route-provider shape consumed by `NativeUIBridgeRegistry.createSnapshot`.
470
- *
471
- * Intentionally a structural subset of `RouteProvider` (defined in `server/types`)
472
- * so `core/registry` stays free of server-layer imports. The full `RouteProvider`
473
- * (which adds `subscribe`) widens this interface; both can be passed to
474
- * `registry.setRouteProvider(...)` interchangeably.
475
- *
476
- * The registry uses this fallback when `createSnapshot` is called WITHOUT an
477
- * explicit `routeInfo` argument — the canonical case is the default
478
- * `getSnapshot` HTTP handler, which has no direct reference to the
479
- * `NativeUIBridgeServer` instance and therefore couldn't read the route
480
- * before this hook existed.
481
- */
482
- interface NativeRouteProviderLike {
483
- getCurrentRoute: () => string | null;
484
- getSegments?: () => string[];
485
- }
486
- /**
487
- * UI Bridge Native feature flags
488
- */
489
- interface NativeUIBridgeFeatures {
490
- /** Enable HTTP control server */
491
- server?: boolean;
492
- /** Enable debug tools (inspector overlay) */
493
- debug?: boolean;
494
- /**
495
- * Enable test-only HTTP endpoints that let external runners drive
496
- * registry-internal state (currently `control/modal/push` and
497
- * `control/modal/dismiss/:id`). Default `false` so production builds
498
- * cannot have their modal stack manipulated remotely; set to `true`
499
- * (typically gated on `__DEV__`) when running automated tests.
500
- */
501
- testHooks?: boolean;
502
- }
503
- /**
504
- * UI Bridge Native configuration
505
- */
506
- interface NativeUIBridgeConfig {
507
- /** Port for HTTP server */
508
- serverPort?: number;
509
- /** Enable verbose logging */
510
- verbose?: boolean;
511
- /** Path prefix for parent components (for treePath generation) */
512
- parentPath?: string;
513
- /** Application info for discovery */
514
- appInfo?: {
515
- appId: string;
516
- appName: string;
517
- appType: 'web' | 'desktop' | 'mobile' | 'other';
518
- framework?: string;
519
- };
520
- }
521
- /**
522
- * Find request for discovering native elements
523
- */
524
- interface NativeFindRequest {
525
- /** Filter by element type */
526
- types?: NativeElementType[];
527
- /** Filter by testID pattern (supports wildcards) */
528
- testIdPattern?: string;
529
- /** Filter by accessibility label pattern */
530
- accessibilityLabelPattern?: string;
531
- /** Include only visible elements */
532
- visibleOnly?: boolean;
533
- /** Maximum number of results */
534
- limit?: number;
535
- }
536
- /**
537
- * Discovered native element
538
- */
539
- interface DiscoveredNativeElement {
540
- /** Element ID */
541
- id: string;
542
- /** Element type */
543
- type: NativeElementType;
544
- /** Element identifier */
545
- identifier: NativeElementIdentifier;
546
- /** Current state */
547
- state: NativeElementState;
548
- /** Available actions */
549
- actions: NativeStandardAction[];
550
- /** Label */
551
- label?: string;
552
- }
553
- /**
554
- * Find response
555
- */
556
- interface NativeFindResponse {
557
- /** Discovered elements */
558
- elements: DiscoveredNativeElement[];
559
- /** Total count */
560
- total: number;
561
- /** Duration in milliseconds */
562
- durationMs: number;
563
- /** Timestamp */
564
- timestamp: number;
565
- }
566
-
567
- export type { ActionHandler as A, BridgeEvent as B, ComponentAction as C, DiscoveredNativeElement as D, Workflow as E, WorkflowStep as F, WorkflowStepType as G, NativeAppInfo as H, NativeRouteProviderLike as I, NativeModalDetectorLike as J, NativeActionRequest as N, RegisteredNativeComponent as R, WaitOptions as W, BridgeEventListener as a, BridgeEventType as b, CustomAction as c, NativeActionResponse as d, NativeBridgeSnapshot as e, NativeCapturedToast as f, NativeComponentAction as g, NativeCustomAction as h, NativeElementIdentifier as i, NativeElementRef as j, NativeElementState as k, NativeElementType as l, NativeFindRequest as m, NativeFindResponse as n, NativeLayout as o, NativeModalInfo as p, NativeRegistrationCoverage as q, NativeSnapshotEnricher as r, NativeSnapshotEnrichers as s, NativeSnapshotModalContext as t, NativeSnapshotToastContext as u, NativeSnapshotUndoContext as v, NativeStandardAction as w, NativeUIBridgeConfig as x, NativeUIBridgeFeatures as y, RegisteredNativeElement as z };