@qontinui/ui-bridge-native 0.1.6 → 0.2.1

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 (98) hide show
  1. package/dist/control/{action-executor.d.ts → index.d.mts} +14 -6
  2. package/dist/control/index.d.ts +95 -5
  3. package/dist/control/index.js +74 -11
  4. package/dist/control/index.js.map +1 -1
  5. package/dist/control/index.mjs +74 -11
  6. package/dist/control/index.mjs.map +1 -1
  7. package/dist/core/index.d.mts +46 -0
  8. package/dist/core/index.d.ts +43 -6
  9. package/dist/core/index.js +108 -2
  10. package/dist/core/index.js.map +1 -1
  11. package/dist/core/index.mjs +108 -2
  12. package/dist/core/index.mjs.map +1 -1
  13. package/dist/debug/{inspector.d.ts → index.d.mts} +6 -3
  14. package/dist/debug/index.d.ts +44 -4
  15. package/dist/debug/index.js +2 -2
  16. package/dist/debug/index.js.map +1 -1
  17. package/dist/debug/index.mjs +2 -2
  18. package/dist/debug/index.mjs.map +1 -1
  19. package/dist/design/{design-inspector-native.d.ts → index.d.mts} +11 -7
  20. package/dist/design/index.d.ts +60 -5
  21. package/dist/{design/design-types.d.ts → design-types-BHr6Q1FX.d.mts} +11 -10
  22. package/dist/design-types-BHr6Q1FX.d.ts +205 -0
  23. package/dist/http-server-D2U1k48d.d.mts +703 -0
  24. package/dist/http-server-ck8clUsZ.d.ts +703 -0
  25. package/dist/index.d.mts +89 -0
  26. package/dist/index.d.ts +86 -28
  27. package/dist/index.js +754 -50
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +749 -51
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/react/{useAutoRegister.d.ts → index.d.mts} +15 -7
  32. package/dist/react/index.d.ts +69 -8
  33. package/dist/react/index.js +733 -50
  34. package/dist/react/index.js.map +1 -1
  35. package/dist/react/index.mjs +731 -51
  36. package/dist/react/index.mjs.map +1 -1
  37. package/dist/{core/registry.d.ts → registry-BxXaxmsT.d.ts} +51 -10
  38. package/dist/registry-KdUW_koV.d.mts +253 -0
  39. package/dist/server/index.d.mts +119 -0
  40. package/dist/server/index.d.ts +117 -13
  41. package/dist/server/index.js +272 -16
  42. package/dist/server/index.js.map +1 -1
  43. package/dist/server/index.mjs +272 -16
  44. package/dist/server/index.mjs.map +1 -1
  45. package/dist/{core/types.d.ts → types-BwdPNpII.d.mts} +172 -30
  46. package/dist/types-BwdPNpII.d.ts +525 -0
  47. package/dist/{control/types.d.ts → types-DCEv5qb6.d.ts} +36 -15
  48. package/dist/types-DjB0zJJH.d.mts +197 -0
  49. package/dist/useUIBridgeToast-BPIEbsEc.d.mts +726 -0
  50. package/dist/useUIBridgeToast-DD13oF3k.d.ts +726 -0
  51. package/package.json +2 -2
  52. package/dist/control/action-executor.d.ts.map +0 -1
  53. package/dist/control/index.d.ts.map +0 -1
  54. package/dist/control/types.d.ts.map +0 -1
  55. package/dist/core/element-identifier.d.ts +0 -41
  56. package/dist/core/element-identifier.d.ts.map +0 -1
  57. package/dist/core/index.d.ts.map +0 -1
  58. package/dist/core/registry.d.ts.map +0 -1
  59. package/dist/core/types.d.ts.map +0 -1
  60. package/dist/debug/index.d.ts.map +0 -1
  61. package/dist/debug/inspector.d.ts.map +0 -1
  62. package/dist/design/design-inspector-native.d.ts.map +0 -1
  63. package/dist/design/design-types.d.ts.map +0 -1
  64. package/dist/design/index.d.ts.map +0 -1
  65. package/dist/index.d.ts.map +0 -1
  66. package/dist/react/UIBridgeNativeProvider.d.ts +0 -147
  67. package/dist/react/UIBridgeNativeProvider.d.ts.map +0 -1
  68. package/dist/react/index.d.ts.map +0 -1
  69. package/dist/react/useAutoRegister.d.ts.map +0 -1
  70. package/dist/react/useUIBridge.d.ts +0 -103
  71. package/dist/react/useUIBridge.d.ts.map +0 -1
  72. package/dist/react/useUIComponent.d.ts +0 -112
  73. package/dist/react/useUIComponent.d.ts.map +0 -1
  74. package/dist/react/useUIElement.d.ts +0 -162
  75. package/dist/react/useUIElement.d.ts.map +0 -1
  76. package/dist/server/design-handlers.d.ts +0 -47
  77. package/dist/server/design-handlers.d.ts.map +0 -1
  78. package/dist/server/handlers.d.ts +0 -20
  79. package/dist/server/handlers.d.ts.map +0 -1
  80. package/dist/server/http-server.d.ts +0 -247
  81. package/dist/server/http-server.d.ts.map +0 -1
  82. package/dist/server/index.d.ts.map +0 -1
  83. package/dist/server/types.d.ts +0 -200
  84. package/dist/server/types.d.ts.map +0 -1
  85. package/dist/server/ws-connection.d.ts +0 -48
  86. package/dist/server/ws-connection.d.ts.map +0 -1
  87. package/dist/server/ws-event-bridge.d.ts +0 -113
  88. package/dist/server/ws-event-bridge.d.ts.map +0 -1
  89. package/dist/server/ws-protocol.d.ts +0 -48
  90. package/dist/server/ws-protocol.d.ts.map +0 -1
  91. package/dist/server/ws-types.d.ts +0 -65
  92. package/dist/server/ws-types.d.ts.map +0 -1
  93. package/dist/transport/CloudRelayClient.d.ts +0 -51
  94. package/dist/transport/CloudRelayClient.d.ts.map +0 -1
  95. package/dist/transport/DeviceAnnouncer.d.ts +0 -75
  96. package/dist/transport/DeviceAnnouncer.d.ts.map +0 -1
  97. package/dist/transport/index.d.ts +0 -3
  98. package/dist/transport/index.d.ts.map +0 -1
@@ -0,0 +1,525 @@
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
+ * Snapshot of the entire native UI bridge state
290
+ */
291
+ interface NativeBridgeSnapshot {
292
+ /** Timestamp of the snapshot */
293
+ timestamp: number;
294
+ /** All registered elements */
295
+ elements: Array<{
296
+ id: string;
297
+ type: NativeElementType;
298
+ label?: string;
299
+ identifier: NativeElementIdentifier;
300
+ state: NativeElementState;
301
+ actions: NativeStandardAction[];
302
+ customActions?: string[];
303
+ /** Handler names actually registered via updateElementProps (e.g. ['onPress', 'onChangeText']) */
304
+ registeredHandlers?: string[];
305
+ /** Route path where this element was registered (for page-scoped filtering) */
306
+ registrationRoute?: string | null;
307
+ }>;
308
+ /** All registered components */
309
+ components: Array<{
310
+ id: string;
311
+ name: string;
312
+ description?: string;
313
+ actions: string[];
314
+ elementIds?: string[];
315
+ }>;
316
+ /** Available workflows */
317
+ workflows: Array<{
318
+ id: string;
319
+ name: string;
320
+ description?: string;
321
+ stepCount: number;
322
+ }>;
323
+ /** Current navigation route path (if a RouteProvider is configured) */
324
+ currentRoute?: string | null;
325
+ /** Current route segments (if a RouteProvider is configured) */
326
+ segments?: string[];
327
+ /** Modal/sheet/drawer context (populated when a modalDetector enricher is registered) */
328
+ modalStack?: NativeSnapshotModalContext;
329
+ /** Toast/snackbar context (populated when a toastCapture enricher is registered) */
330
+ toasts?: NativeSnapshotToastContext;
331
+ /** Undo/redo context (populated when an undoTracker enricher is registered) */
332
+ undoRedo?: NativeSnapshotUndoContext;
333
+ /**
334
+ * Registration coverage metadata so agents can detect routes that have
335
+ * interactive controls but did not register them with the bridge.
336
+ */
337
+ registration?: NativeRegistrationCoverage;
338
+ }
339
+ /** A single detected modal-like surface (modal, sheet, drawer, popover, alert) */
340
+ interface NativeModalInfo {
341
+ id: string;
342
+ title?: string;
343
+ type: 'modal' | 'sheet' | 'drawer' | 'popover' | 'alertdialog' | 'dialog';
344
+ /** Whether the modal blocks interaction with the underlying UI */
345
+ blocking: boolean;
346
+ /** Whether it can be dismissed by the user (backdrop tap, swipe, esc, etc.) */
347
+ dismissible: boolean;
348
+ detectedAt: number;
349
+ }
350
+ /**
351
+ * Modal context attached to a snapshot. Field names match the web SDK's
352
+ * `SnapshotModalContext` so external agents can write transport-agnostic checks
353
+ * like `snapshot.modalStack?.hasBlockingModal`.
354
+ */
355
+ interface NativeSnapshotModalContext {
356
+ modals: NativeModalInfo[];
357
+ topModal?: NativeModalInfo;
358
+ hasBlockingModal: boolean;
359
+ count: number;
360
+ }
361
+ /** A captured toast/snackbar */
362
+ interface NativeCapturedToast {
363
+ id: string;
364
+ message: string;
365
+ level: 'info' | 'success' | 'warning' | 'error' | 'loading' | 'unknown';
366
+ appearedAt: number;
367
+ dismissedAt?: number;
368
+ visible: boolean;
369
+ /** Total duration in ms (lifetime so far if still visible, total if dismissed) */
370
+ durationMs: number;
371
+ }
372
+ /** Toast context attached to a snapshot */
373
+ interface NativeSnapshotToastContext {
374
+ /** Toasts currently on screen */
375
+ active: NativeCapturedToast[];
376
+ /** Recently-dismissed toasts retained by the capture buffer (most recent first) */
377
+ recent: NativeCapturedToast[];
378
+ /** Total number of toasts ever captured by this tracker */
379
+ totalCaptured: number;
380
+ }
381
+ /**
382
+ * Undo/redo context attached to a snapshot. Mirrors the web SDK's
383
+ * `SnapshotUndoContext` minus DOM-only fields — RN has no `document.execCommand`
384
+ * or selectors, so the native variant relies entirely on developer declaration.
385
+ */
386
+ interface NativeSnapshotUndoContext {
387
+ /** Whether undo appears to be available */
388
+ canUndo: boolean;
389
+ /** Whether redo appears to be available */
390
+ canRedo: boolean;
391
+ /** Description of what undo would reverse */
392
+ undoDescription?: string;
393
+ /** Description of what redo would restore */
394
+ redoDescription?: string;
395
+ /** Undo stack depth (if known) */
396
+ undoDepth?: number;
397
+ /** Redo stack depth (if known) */
398
+ redoDepth?: number;
399
+ /** Human-readable summary for AI */
400
+ summary: string;
401
+ }
402
+ /**
403
+ * Modal-stack tracker contract. Surfaced in NativeSnapshotEnrichers so the
404
+ * test-hook HTTP endpoints (`control/modal/push`, `control/modal/dismiss/:id`)
405
+ * can drive the same instance the snapshot reads from. Any duck-typed
406
+ * implementation that satisfies this shape can fill the slot — production
407
+ * uses the `ModalDetector` class.
408
+ */
409
+ interface NativeModalDetectorLike {
410
+ getSnapshotModalContext(): NativeSnapshotModalContext;
411
+ pushModal(modal: {
412
+ id: string;
413
+ title?: string;
414
+ type?: NativeModalInfo['type'];
415
+ blocking?: boolean;
416
+ dismissible?: boolean;
417
+ }): void;
418
+ dismissModal(id: string): boolean | void;
419
+ getActive(): NativeModalInfo[];
420
+ }
421
+ /**
422
+ * Canonical enricher slot. Each tracker exposes a `getSnapshot*Context()` method
423
+ * that the registry calls during `createSnapshot`. NavigationTracker is intentionally
424
+ * NOT here — route info already flows through `currentRoute` / `segments`.
425
+ */
426
+ interface NativeSnapshotEnrichers {
427
+ modalDetector?: NativeModalDetectorLike;
428
+ toastCapture?: {
429
+ getSnapshotToastContext(): NativeSnapshotToastContext;
430
+ };
431
+ undoTracker?: {
432
+ getSnapshotUndoContext(): NativeSnapshotUndoContext;
433
+ };
434
+ }
435
+ /**
436
+ * Pluggable snapshot enricher: receives base context and returns extra fields
437
+ * that get `Object.assign`ed onto the snapshot. Used for ad-hoc/custom trackers
438
+ * (e.g. runner sidebar tabs) without growing the canonical enricher set.
439
+ */
440
+ type NativeSnapshotEnricher = (ctx: {
441
+ elements: RegisteredNativeElement[];
442
+ currentRoute: string | null;
443
+ }) => Record<string, unknown>;
444
+ /**
445
+ * UI Bridge Native feature flags
446
+ */
447
+ interface NativeUIBridgeFeatures {
448
+ /** Enable HTTP control server */
449
+ server?: boolean;
450
+ /** Enable debug tools (inspector overlay) */
451
+ debug?: boolean;
452
+ /**
453
+ * Enable test-only HTTP endpoints that let external runners drive
454
+ * registry-internal state (currently `control/modal/push` and
455
+ * `control/modal/dismiss/:id`). Default `false` so production builds
456
+ * cannot have their modal stack manipulated remotely; set to `true`
457
+ * (typically gated on `__DEV__`) when running automated tests.
458
+ */
459
+ testHooks?: boolean;
460
+ }
461
+ /**
462
+ * UI Bridge Native configuration
463
+ */
464
+ interface NativeUIBridgeConfig {
465
+ /** Port for HTTP server */
466
+ serverPort?: number;
467
+ /** Enable verbose logging */
468
+ verbose?: boolean;
469
+ /** Path prefix for parent components (for treePath generation) */
470
+ parentPath?: string;
471
+ /** Application info for discovery */
472
+ appInfo?: {
473
+ appId: string;
474
+ appName: string;
475
+ appType: 'web' | 'desktop' | 'mobile' | 'other';
476
+ framework?: string;
477
+ };
478
+ }
479
+ /**
480
+ * Find request for discovering native elements
481
+ */
482
+ interface NativeFindRequest {
483
+ /** Filter by element type */
484
+ types?: NativeElementType[];
485
+ /** Filter by testID pattern (supports wildcards) */
486
+ testIdPattern?: string;
487
+ /** Filter by accessibility label pattern */
488
+ accessibilityLabelPattern?: string;
489
+ /** Include only visible elements */
490
+ visibleOnly?: boolean;
491
+ /** Maximum number of results */
492
+ limit?: number;
493
+ }
494
+ /**
495
+ * Discovered native element
496
+ */
497
+ interface DiscoveredNativeElement {
498
+ /** Element ID */
499
+ id: string;
500
+ /** Element type */
501
+ type: NativeElementType;
502
+ /** Element identifier */
503
+ identifier: NativeElementIdentifier;
504
+ /** Current state */
505
+ state: NativeElementState;
506
+ /** Available actions */
507
+ actions: NativeStandardAction[];
508
+ /** Label */
509
+ label?: string;
510
+ }
511
+ /**
512
+ * Find response
513
+ */
514
+ interface NativeFindResponse {
515
+ /** Discovered elements */
516
+ elements: DiscoveredNativeElement[];
517
+ /** Total count */
518
+ total: number;
519
+ /** Duration in milliseconds */
520
+ durationMs: number;
521
+ /** Timestamp */
522
+ timestamp: number;
523
+ }
524
+
525
+ export type { ActionHandler as A, BridgeEvent as B, ComponentAction as C, DiscoveredNativeElement as D, Workflow as E, WorkflowStep as F, WorkflowStepType as G, NativeModalDetectorLike as H, 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 };
@@ -1,13 +1,15 @@
1
+ import { W as WaitOptions, N as NativeActionRequest, d as NativeActionResponse, m as NativeFindRequest, n as NativeFindResponse, k as NativeElementState } from './types-BwdPNpII.js';
2
+
1
3
  /**
2
4
  * UI Bridge Native Control Types
3
5
  *
4
6
  * Types for action execution and control operations.
5
7
  */
6
- import type { NativeActionRequest, NativeActionResponse, NativeFindRequest, NativeFindResponse, NativeElementState, WaitOptions } from '../core/types';
8
+
7
9
  /**
8
10
  * Extended action request with control-specific options
9
11
  */
10
- export interface ControlActionRequest extends NativeActionRequest {
12
+ interface ControlActionRequest extends NativeActionRequest {
11
13
  /** Request ID for correlation */
12
14
  requestId?: string;
13
15
  /** Capture snapshot after action */
@@ -21,7 +23,7 @@ export interface ControlActionRequest extends NativeActionRequest {
21
23
  /**
22
24
  * Extended action response with control-specific data
23
25
  */
24
- export interface ControlActionResponse extends NativeActionResponse {
26
+ interface ControlActionResponse extends NativeActionResponse {
25
27
  /** Request ID for correlation */
26
28
  requestId?: string;
27
29
  /** Retry count */
@@ -30,7 +32,7 @@ export interface ControlActionResponse extends NativeActionResponse {
30
32
  /**
31
33
  * Component action request
32
34
  */
33
- export interface ComponentActionRequest {
35
+ interface ComponentActionRequest {
34
36
  /** Action to execute */
35
37
  action: string;
36
38
  /** Action parameters */
@@ -41,7 +43,7 @@ export interface ComponentActionRequest {
41
43
  /**
42
44
  * Component action response
43
45
  */
44
- export interface ComponentActionResponse {
46
+ interface ComponentActionResponse {
45
47
  /** Whether the action succeeded */
46
48
  success: boolean;
47
49
  /** Result of the action */
@@ -60,7 +62,7 @@ export interface ComponentActionResponse {
60
62
  /**
61
63
  * Wait result
62
64
  */
63
- export interface WaitResult {
65
+ interface WaitResult {
64
66
  /** Whether conditions were met */
65
67
  met: boolean;
66
68
  /** Time spent waiting in milliseconds */
@@ -70,10 +72,26 @@ export interface WaitResult {
70
72
  /** Error message if failed */
71
73
  error?: string;
72
74
  }
75
+ /**
76
+ * Action event emitted after executeAction completes (success or failure).
77
+ */
78
+ interface NativeActionEvent {
79
+ elementId: string;
80
+ action: string;
81
+ params?: unknown;
82
+ success: boolean;
83
+ error?: string;
84
+ /** ms since epoch when the executor finished the action */
85
+ timestamp: number;
86
+ /** request id propagated from ControlActionRequest, if any */
87
+ requestId?: string;
88
+ durationMs: number;
89
+ }
90
+ type NativeActionListener = (event: NativeActionEvent) => void;
73
91
  /**
74
92
  * Native action executor interface
75
93
  */
76
- export interface NativeActionExecutor {
94
+ interface NativeActionExecutor {
77
95
  /**
78
96
  * Execute an action on an element
79
97
  */
@@ -90,18 +108,20 @@ export interface NativeActionExecutor {
90
108
  * Wait for element conditions
91
109
  */
92
110
  waitForElement(elementId: string, options: WaitOptions): Promise<WaitResult>;
111
+ /** Subscribe to action events. Returns an unsubscribe function. */
112
+ onActionExecuted(listener: NativeActionListener): () => void;
93
113
  }
94
114
  /**
95
115
  * Page navigation request
96
116
  */
97
- export interface PageNavigateRequest {
117
+ interface PageNavigateRequest {
98
118
  /** URL to navigate to */
99
119
  url: string;
100
120
  }
101
121
  /**
102
122
  * Page navigation response
103
123
  */
104
- export interface PageNavigationResponse {
124
+ interface PageNavigationResponse {
105
125
  /** Whether the navigation succeeded */
106
126
  success: boolean;
107
127
  /** Current URL after navigation */
@@ -112,7 +132,7 @@ export interface PageNavigationResponse {
112
132
  /**
113
133
  * Action execution options
114
134
  */
115
- export interface ActionExecutionOptions {
135
+ interface ActionExecutionOptions {
116
136
  /** Timeout in milliseconds */
117
137
  timeout?: number;
118
138
  /** Whether to wait for element to be ready */
@@ -123,7 +143,7 @@ export interface ActionExecutionOptions {
123
143
  /**
124
144
  * Type action params
125
145
  */
126
- export interface TypeActionParams {
146
+ interface TypeActionParams {
127
147
  /** Text to type */
128
148
  text: string;
129
149
  /** Typing delay between characters (ms) */
@@ -136,7 +156,7 @@ export interface TypeActionParams {
136
156
  /**
137
157
  * Scroll action params
138
158
  */
139
- export interface ScrollActionParams {
159
+ interface ScrollActionParams {
140
160
  /** Scroll offset */
141
161
  offset?: {
142
162
  x: number;
@@ -153,7 +173,7 @@ export interface ScrollActionParams {
153
173
  /**
154
174
  * Swipe action params
155
175
  */
156
- export interface SwipeActionParams {
176
+ interface SwipeActionParams {
157
177
  /** Swipe direction */
158
178
  direction: 'up' | 'down' | 'left' | 'right';
159
179
  /** Swipe distance (in points) */
@@ -164,7 +184,7 @@ export interface SwipeActionParams {
164
184
  /**
165
185
  * Press action params
166
186
  */
167
- export interface PressActionParams {
187
+ interface PressActionParams {
168
188
  /** Position relative to element */
169
189
  position?: {
170
190
  x: number;
@@ -173,4 +193,5 @@ export interface PressActionParams {
173
193
  /** Press duration (ms) for long press */
174
194
  duration?: number;
175
195
  }
176
- //# sourceMappingURL=types.d.ts.map
196
+
197
+ export type { ActionExecutionOptions as A, ControlActionRequest as C, NativeActionExecutor as N, PressActionParams as P, ScrollActionParams as S, TypeActionParams as T, WaitResult as W, ControlActionResponse as a, ComponentActionRequest as b, ComponentActionResponse as c, SwipeActionParams as d, PageNavigationResponse as e, NativeActionListener as f, NativeActionEvent as g, PageNavigateRequest as h };