@qontinui/ui-bridge-native 0.1.4 → 0.1.6

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 (92) 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 -91
  4. package/dist/control/index.d.ts.map +1 -0
  5. package/dist/control/index.js +1 -1
  6. package/dist/control/index.js.map +1 -1
  7. package/dist/control/index.mjs +1 -1
  8. package/dist/control/index.mjs.map +1 -1
  9. package/dist/{types-BCYWwyVy.d.ts → control/types.d.ts} +17 -18
  10. package/dist/control/types.d.ts.map +1 -0
  11. package/dist/core/element-identifier.d.ts +41 -0
  12. package/dist/core/element-identifier.d.ts.map +1 -0
  13. package/dist/core/index.d.ts +6 -43
  14. package/dist/core/index.d.ts.map +1 -0
  15. package/dist/{registry-B8A_EoxS.d.ts → core/registry.d.ts} +10 -13
  16. package/dist/core/registry.d.ts.map +1 -0
  17. package/dist/{types-BPNuYxDx.d.ts → core/types.d.ts} +30 -30
  18. package/dist/core/types.d.ts.map +1 -0
  19. package/dist/debug/index.d.ts +4 -44
  20. package/dist/debug/index.d.ts.map +1 -0
  21. package/dist/debug/index.js.map +1 -1
  22. package/dist/debug/index.mjs.map +1 -1
  23. package/dist/debug/{index.d.mts → inspector.d.ts} +3 -6
  24. package/dist/debug/inspector.d.ts.map +1 -0
  25. package/dist/design/{index.d.mts → design-inspector-native.d.ts} +7 -11
  26. package/dist/design/design-inspector-native.d.ts.map +1 -0
  27. package/dist/{design-types-BHr6Q1FX.d.ts → design/design-types.d.ts} +10 -11
  28. package/dist/design/design-types.d.ts.map +1 -0
  29. package/dist/design/index.d.ts +5 -60
  30. package/dist/design/index.d.ts.map +1 -0
  31. package/dist/index.d.ts +28 -73
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +129 -23
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +129 -23
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/react/UIBridgeNativeProvider.d.ts +147 -0
  38. package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
  39. package/dist/react/index.d.ts +8 -69
  40. package/dist/react/index.d.ts.map +1 -0
  41. package/dist/react/index.js +138 -23
  42. package/dist/react/index.js.map +1 -1
  43. package/dist/react/index.mjs +138 -23
  44. package/dist/react/index.mjs.map +1 -1
  45. package/dist/react/{index.d.mts → useAutoRegister.d.ts} +7 -15
  46. package/dist/react/useAutoRegister.d.ts.map +1 -0
  47. package/dist/react/useUIBridge.d.ts +103 -0
  48. package/dist/react/useUIBridge.d.ts.map +1 -0
  49. package/dist/react/useUIComponent.d.ts +112 -0
  50. package/dist/react/useUIComponent.d.ts.map +1 -0
  51. package/dist/react/useUIElement.d.ts +162 -0
  52. package/dist/react/useUIElement.d.ts.map +1 -0
  53. package/dist/server/design-handlers.d.ts +47 -0
  54. package/dist/server/design-handlers.d.ts.map +1 -0
  55. package/dist/server/handlers.d.ts +20 -0
  56. package/dist/server/handlers.d.ts.map +1 -0
  57. package/dist/server/http-server.d.ts +247 -0
  58. package/dist/server/http-server.d.ts.map +1 -0
  59. package/dist/server/index.d.ts +13 -117
  60. package/dist/server/index.d.ts.map +1 -0
  61. package/dist/server/index.js +102 -1
  62. package/dist/server/index.js.map +1 -1
  63. package/dist/server/index.mjs +102 -1
  64. package/dist/server/index.mjs.map +1 -1
  65. package/dist/server/types.d.ts +200 -0
  66. package/dist/server/types.d.ts.map +1 -0
  67. package/dist/server/ws-connection.d.ts +48 -0
  68. package/dist/server/ws-connection.d.ts.map +1 -0
  69. package/dist/server/ws-event-bridge.d.ts +113 -0
  70. package/dist/server/ws-event-bridge.d.ts.map +1 -0
  71. package/dist/server/ws-protocol.d.ts +48 -0
  72. package/dist/server/ws-protocol.d.ts.map +1 -0
  73. package/dist/server/ws-types.d.ts +65 -0
  74. package/dist/server/ws-types.d.ts.map +1 -0
  75. package/dist/transport/CloudRelayClient.d.ts +51 -0
  76. package/dist/transport/CloudRelayClient.d.ts.map +1 -0
  77. package/dist/transport/DeviceAnnouncer.d.ts +75 -0
  78. package/dist/transport/DeviceAnnouncer.d.ts.map +1 -0
  79. package/dist/transport/index.d.ts +3 -0
  80. package/dist/transport/index.d.ts.map +1 -0
  81. package/package.json +1 -1
  82. package/dist/core/index.d.mts +0 -46
  83. package/dist/design-types-BHr6Q1FX.d.mts +0 -205
  84. package/dist/http-server-B7KudcYJ.d.ts +0 -622
  85. package/dist/http-server-D7uVANBU.d.mts +0 -622
  86. package/dist/index.d.mts +0 -76
  87. package/dist/registry-DhbGbl9c.d.mts +0 -215
  88. package/dist/server/index.d.mts +0 -119
  89. package/dist/types-BPNuYxDx.d.mts +0 -383
  90. package/dist/types-Bcj7ji97.d.mts +0 -177
  91. package/dist/useUIBridge-CDZbWxII.d.ts +0 -571
  92. package/dist/useUIBridge-DfIEq9EQ.d.mts +0 -571
@@ -1,571 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React$1 from 'react';
3
- import { q as NativeUIBridgeFeatures, p as NativeUIBridgeConfig, r as RegisteredNativeElement, R as RegisteredNativeComponent, e as NativeBridgeSnapshot, b as BridgeEventType, a as BridgeEventListener, k as NativeElementType, o as NativeStandardAction, g as NativeCustomAction, j as NativeElementState, i as NativeElementRef, h as NativeElementIdentifier, s as Workflow, N as NativeActionRequest, d as NativeActionResponse, l as NativeFindRequest, m as NativeFindResponse } from './types-BPNuYxDx.mjs';
4
- import { a as NativeUIBridgeRegistry } from './registry-DhbGbl9c.mjs';
5
- import { N as NativeActionExecutor } from './types-Bcj7ji97.mjs';
6
- import { i as NativeUIBridgeServer, m as ServerAdapter, l as RouteProvider } from './http-server-D7uVANBU.mjs';
7
-
8
- /**
9
- * Cloud Relay Client — WebSocket tunnel from mobile device to backend
10
- *
11
- * Maintains a persistent WebSocket connection to the qontinui.io backend.
12
- * Receives tunneled HTTP requests from runners, calls the local NativeUIBridgeServer,
13
- * and sends responses back through the tunnel.
14
- */
15
-
16
- interface CloudRelayConfig {
17
- /** WebSocket URL for the device bridge endpoint */
18
- relayUrl: string;
19
- /** Stable device identifier */
20
- deviceId: string;
21
- /** Authentication token */
22
- authToken: string;
23
- /** Reference to the local UI Bridge server for processing requests */
24
- uiBridgeServer: NativeUIBridgeServer;
25
- }
26
- /**
27
- * Manages a WebSocket tunnel from the mobile device to the qontinui.io backend.
28
- *
29
- * When a runner sends an HTTP request to a cloud device it is serialised as a
30
- * `TunnelRequest` JSON frame by the backend and forwarded here. This client
31
- * deserializes it, calls `NativeUIBridgeServer.handleRequest()` directly
32
- * (avoiding loopback TCP overhead), and sends the `TunnelResponse` back.
33
- */
34
- declare class CloudRelayClient {
35
- private ws;
36
- private config;
37
- private reconnectDelay;
38
- private maxReconnectDelay;
39
- private stopped;
40
- private _isConnected;
41
- private reconnectTimer;
42
- constructor(config: CloudRelayConfig);
43
- /** Whether the relay WebSocket is currently connected */
44
- get isConnected(): boolean;
45
- /** Connect to the relay and start processing tunneled requests. */
46
- start(): void;
47
- /** Disconnect and stop reconnecting. */
48
- stop(): void;
49
- private connect;
50
- private onMessage;
51
- /**
52
- * Process a tunneled HTTP request by calling the local NativeUIBridgeServer
53
- * directly (no loopback TCP involved).
54
- */
55
- private handleTunneledRequest;
56
- private scheduleReconnect;
57
- }
58
-
59
- /**
60
- * UI Bridge Native context value
61
- */
62
- interface UIBridgeNativeContextValue {
63
- /** Feature flags */
64
- features: NativeUIBridgeFeatures;
65
- /** Configuration */
66
- config: NativeUIBridgeConfig;
67
- /** Element registry */
68
- registry: NativeUIBridgeRegistry;
69
- /** Action executor */
70
- executor: NativeActionExecutor;
71
- /** Get all registered elements */
72
- getElements: () => RegisteredNativeElement[];
73
- /** Get all registered components */
74
- getComponents: () => RegisteredNativeComponent[];
75
- /** Create a snapshot */
76
- createSnapshot: () => NativeBridgeSnapshot;
77
- /** Subscribe to events */
78
- on: <T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>) => () => void;
79
- /** Unsubscribe from events */
80
- off: <T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>) => void;
81
- /** Whether the provider is initialized */
82
- initialized: boolean;
83
- /** Server running status */
84
- serverRunning: boolean;
85
- /** Start the HTTP server */
86
- startServer: () => Promise<void>;
87
- /** Stop the HTTP server */
88
- stopServer: () => void;
89
- /** Get the current navigation route (if a RouteProvider is configured) */
90
- getCurrentRoute: () => string | null;
91
- }
92
- /**
93
- * UI Bridge Native provider props
94
- */
95
- interface UIBridgeNativeProviderProps {
96
- /** Child components */
97
- children: React$1.ReactNode;
98
- /** Feature flags */
99
- features?: NativeUIBridgeFeatures;
100
- /** Configuration */
101
- config?: NativeUIBridgeConfig;
102
- /** Event handler */
103
- onEvent?: BridgeEventListener;
104
- /**
105
- * A ServerAdapter instance for the HTTP server.
106
- * The app is responsible for creating this using its preferred native TCP/HTTP library.
107
- * @see ServerAdapter interface in server/http-server.ts
108
- */
109
- serverAdapter?: ServerAdapter;
110
- /**
111
- * Navigation provider for programmatic route navigation via UI Bridge.
112
- * Pass Expo Router's push/back functions to enable `control/page/navigate`.
113
- */
114
- navigationProvider?: {
115
- navigate: (url: string) => void;
116
- back?: () => void;
117
- };
118
- /**
119
- * Screenshot provider for native screen capture via UI Bridge.
120
- * Pass a function that captures the current screen as base64 PNG.
121
- */
122
- screenshotProvider?: {
123
- capture: () => Promise<{
124
- base64: string;
125
- width: number;
126
- height: number;
127
- }>;
128
- };
129
- /**
130
- * Route provider for exposing the current navigation route in snapshots.
131
- * Wire this to Expo Router's `usePathname()` / `useSegments()` via a module-level ref.
132
- */
133
- routeProvider?: RouteProvider;
134
- /**
135
- * Configuration for the cloud relay tunnel (enables remote device verification
136
- * when USB/LAN are not available). Omit `uiBridgeServer` — the provider wires
137
- * that automatically after the server starts.
138
- */
139
- cloudRelayConfig?: Omit<CloudRelayConfig, 'uiBridgeServer'>;
140
- /**
141
- * Enable mDNS advertisement so that runners on the same LAN can discover this
142
- * device automatically (requires react-native-zeroconf).
143
- */
144
- enableMdnsAnnounce?: boolean;
145
- /**
146
- * Stable device identifier used for mDNS TXT records and cloud relay
147
- * registration. Typically sourced from expo-device or a UUID stored in
148
- * AsyncStorage.
149
- */
150
- deviceId?: string;
151
- }
152
- /**
153
- * UI Bridge Native Provider
154
- *
155
- * Provides UI Bridge Native context to child components.
156
- *
157
- * @example
158
- * ```tsx
159
- * // app/_layout.tsx
160
- * import { UIBridgeNativeProvider } from 'ui-bridge-native';
161
- *
162
- * export default function RootLayout() {
163
- * return (
164
- * <UIBridgeNativeProvider
165
- * features={{ server: __DEV__, debug: __DEV__ }}
166
- * config={{ serverPort: 8087 }}
167
- * >
168
- * <Stack>{children}</Stack>
169
- * </UIBridgeNativeProvider>
170
- * );
171
- * }
172
- * ```
173
- */
174
- declare function UIBridgeNativeProvider({ children, features, config, onEvent, serverAdapter, navigationProvider, screenshotProvider, routeProvider, cloudRelayConfig, enableMdnsAnnounce, deviceId, }: UIBridgeNativeProviderProps): react_jsx_runtime.JSX.Element;
175
- /**
176
- * useUIBridgeNative hook
177
- *
178
- * Access the UI Bridge Native context. Throws if used outside provider.
179
- */
180
- declare function useUIBridgeNative(): UIBridgeNativeContextValue;
181
- /**
182
- * useUIBridgeNativeOptional hook
183
- *
184
- * Access the UI Bridge Native context, returning null if outside provider.
185
- */
186
- declare function useUIBridgeNativeOptional(): UIBridgeNativeContextValue | null;
187
- /**
188
- * useUIBridgeNativeRequired hook
189
- *
190
- * Alias for useUIBridgeNative (throws if outside provider).
191
- */
192
- declare const useUIBridgeNativeRequired: typeof useUIBridgeNative;
193
-
194
- /**
195
- * useUIElement Hook for React Native
196
- *
197
- * Register a native element with UI Bridge for control and observation.
198
- */
199
-
200
- /**
201
- * useUIElement options
202
- */
203
- interface UseUIElementOptions {
204
- /** Unique identifier for the element */
205
- id: string;
206
- /** Element type (defaults to 'custom') */
207
- type?: NativeElementType;
208
- /** Human-readable label */
209
- label?: string;
210
- /** Override available actions */
211
- actions?: NativeStandardAction[];
212
- /** Custom actions */
213
- customActions?: Record<string, NativeCustomAction>;
214
- /** Whether to automatically register on mount */
215
- autoRegister?: boolean;
216
- /** Callback when state changes */
217
- onStateChange?: (state: NativeElementState) => void;
218
- /** Parent component path for tree path generation */
219
- parentPath?: string;
220
- /** RN style prop — will be flattened for design review */
221
- style?: unknown;
222
- /** State-specific style overrides for design review (pressed, focused, disabled) */
223
- stateStyles?: {
224
- pressed?: unknown;
225
- focused?: unknown;
226
- disabled?: unknown;
227
- };
228
- /**
229
- * Handler props to auto-register with the bridge for action execution.
230
- * When provided, the bridge can invoke these handlers via press/type/toggle actions
231
- * without the component needing a separate useEffect + updateElementProps call.
232
- *
233
- * @example
234
- * ```tsx
235
- * const { ref, onLayout, bridgeProps } = useUIElement({
236
- * id: 'my-button',
237
- * type: 'pressable',
238
- * handlers: { onPress: handlePress },
239
- * });
240
- * ```
241
- */
242
- handlers?: Record<string, ((...args: any[]) => any) | undefined>;
243
- }
244
- /**
245
- * Bridge props to spread onto the component
246
- */
247
- interface UIBridgeProps {
248
- /** Test ID for automation */
249
- testID: string;
250
- /** Accessibility label */
251
- accessibilityLabel?: string;
252
- }
253
- /**
254
- * useUIElement return value
255
- */
256
- interface UseUIElementReturn {
257
- /** Ref to attach to the element */
258
- ref: React.RefObject<NativeElementRef>;
259
- /** onLayout handler to spread onto the element - uses generic type for RN version compatibility */
260
- onLayout: (event: {
261
- nativeEvent: {
262
- layout: {
263
- x: number;
264
- y: number;
265
- width: number;
266
- height: number;
267
- };
268
- };
269
- }) => void;
270
- /** Props to spread onto the element for identification */
271
- bridgeProps: UIBridgeProps;
272
- /** Whether the element is registered */
273
- registered: boolean;
274
- /** Get current state */
275
- getState: () => NativeElementState | null;
276
- /** Get element identifier */
277
- getIdentifier: () => NativeElementIdentifier | null;
278
- /** Trigger an action on this element */
279
- trigger: (action: NativeStandardAction | string, params?: Record<string, unknown>) => Promise<void>;
280
- /** Manually register the element */
281
- register: () => void;
282
- /** Manually unregister the element */
283
- unregister: () => void;
284
- /** The registered element info */
285
- registeredElement: RegisteredNativeElement | null;
286
- /** Update style for design review (flattens and stores in registry) */
287
- updateStyle: (style: unknown, stateStyles?: {
288
- pressed?: unknown;
289
- focused?: unknown;
290
- disabled?: unknown;
291
- }) => void;
292
- }
293
- /**
294
- * useUIElement hook for React Native
295
- *
296
- * Registers a native element with UI Bridge for programmatic control.
297
- *
298
- * @example
299
- * ```tsx
300
- * function SubmitButton() {
301
- * const { ref, onLayout, bridgeProps, trigger } = useUIElement({
302
- * id: 'submit-btn',
303
- * type: 'button',
304
- * label: 'Submit Form',
305
- * });
306
- *
307
- * return (
308
- * <Pressable
309
- * ref={ref}
310
- * onLayout={onLayout}
311
- * {...bridgeProps}
312
- * onPress={() => handleSubmit()}
313
- * >
314
- * <Text>Submit</Text>
315
- * </Pressable>
316
- * );
317
- * }
318
- * ```
319
- */
320
- declare function useUIElement(options: UseUIElementOptions): UseUIElementReturn;
321
- /**
322
- * useUIElementWithProps hook
323
- *
324
- * Extended version that also captures component props for action execution.
325
- * Useful when you need the bridge to be able to call onPress, onChangeText, etc.
326
- *
327
- * @example
328
- * ```tsx
329
- * function TextInputField({ onChangeText, value }) {
330
- * const { ref, onLayout, bridgeProps, captureProps } = useUIElementWithProps({
331
- * id: 'email-input',
332
- * type: 'input',
333
- * });
334
- *
335
- * // Capture props so bridge can call onChangeText
336
- * captureProps({ onChangeText, value });
337
- *
338
- * return (
339
- * <TextInput
340
- * ref={ref}
341
- * onLayout={onLayout}
342
- * {...bridgeProps}
343
- * value={value}
344
- * onChangeText={onChangeText}
345
- * />
346
- * );
347
- * }
348
- * ```
349
- */
350
- interface UseUIElementWithPropsReturn extends UseUIElementReturn {
351
- /** Capture props for action execution */
352
- captureProps: (props: Record<string, unknown>) => void;
353
- }
354
- declare function useUIElementWithProps(options: UseUIElementOptions): UseUIElementWithPropsReturn;
355
-
356
- /**
357
- * useUIComponent Hook for React Native
358
- *
359
- * Register a component with UI Bridge for component-level actions.
360
- */
361
-
362
- /**
363
- * Action definition for useUIComponent
364
- */
365
- interface ComponentActionDef<TParams = unknown, TResult = unknown> {
366
- /** Action identifier */
367
- id: string;
368
- /** Human-readable label */
369
- label?: string;
370
- /** Description */
371
- description?: string;
372
- /** Handler function */
373
- handler: (params?: TParams) => TResult | Promise<TResult>;
374
- }
375
- /**
376
- * useUIComponent options
377
- */
378
- interface UseUIComponentOptions {
379
- /** Unique identifier for the component */
380
- id: string;
381
- /** Human-readable name */
382
- name: string;
383
- /** Description */
384
- description?: string;
385
- /** Actions available on this component */
386
- actions?: ComponentActionDef[];
387
- /** Child element IDs owned by this component */
388
- elementIds?: string[];
389
- /** Whether to automatically register on mount */
390
- autoRegister?: boolean;
391
- }
392
- /**
393
- * useUIComponent return value
394
- */
395
- interface UseUIComponentReturn {
396
- /** Whether the component is registered */
397
- registered: boolean;
398
- /** Execute an action on this component */
399
- executeAction: <TParams = unknown, TResult = unknown>(actionId: string, params?: TParams) => Promise<TResult>;
400
- /** Manually register the component */
401
- register: () => void;
402
- /** Manually unregister the component */
403
- unregister: () => void;
404
- /** Update actions dynamically */
405
- updateActions: (actions: ComponentActionDef[]) => void;
406
- /** Add an element ID to this component */
407
- addElement: (elementId: string) => void;
408
- /** Remove an element ID from this component */
409
- removeElement: (elementId: string) => void;
410
- /** The registered component info */
411
- registeredComponent: RegisteredNativeComponent | null;
412
- }
413
- /**
414
- * useUIComponent hook for React Native
415
- *
416
- * Registers a component with UI Bridge for component-level control.
417
- * Components can expose high-level actions that may orchestrate multiple element interactions.
418
- *
419
- * @example
420
- * ```tsx
421
- * function LoginForm() {
422
- * const [email, setEmail] = useState('');
423
- * const [password, setPassword] = useState('');
424
- *
425
- * useUIComponent({
426
- * id: 'login-form',
427
- * name: 'Login Form',
428
- * actions: [
429
- * {
430
- * id: 'login',
431
- * label: 'Submit Login',
432
- * handler: async ({ email, password }) => {
433
- * setEmail(email);
434
- * setPassword(password);
435
- * await submitLogin();
436
- * },
437
- * },
438
- * {
439
- * id: 'clear',
440
- * label: 'Clear Form',
441
- * handler: () => {
442
- * setEmail('');
443
- * setPassword('');
444
- * },
445
- * },
446
- * ],
447
- * });
448
- *
449
- * return (
450
- * <View>
451
- * <TextInput value={email} onChangeText={setEmail} />
452
- * <TextInput value={password} onChangeText={setPassword} secureTextEntry />
453
- * <Button title="Login" onPress={handleSubmit} />
454
- * </View>
455
- * );
456
- * }
457
- * ```
458
- */
459
- declare function useUIComponent(options: UseUIComponentOptions): UseUIComponentReturn;
460
- /**
461
- * useUIComponentAction hook
462
- *
463
- * Create a stable action handler that can be used with useUIComponent.
464
- * Useful for memoizing action handlers.
465
- */
466
- declare function useUIComponentAction<TParams = unknown, TResult = unknown>(handler: (params?: TParams) => TResult | Promise<TResult>, deps: React.DependencyList): (params?: TParams) => TResult | Promise<TResult>;
467
-
468
- /**
469
- * useUIBridge Hook for React Native
470
- *
471
- * Provides a simplified interface for common UI Bridge operations.
472
- */
473
-
474
- /**
475
- * Component action request
476
- */
477
- interface ComponentActionRequest {
478
- /** Action ID */
479
- action: string;
480
- /** Action parameters */
481
- params?: Record<string, unknown>;
482
- }
483
- /**
484
- * Component action response
485
- */
486
- interface ComponentActionResponse {
487
- /** Whether the action succeeded */
488
- success: boolean;
489
- /** Result of the action */
490
- result?: unknown;
491
- /** Error message if failed */
492
- error?: string;
493
- /** Duration in milliseconds */
494
- durationMs: number;
495
- /** Timestamp */
496
- timestamp: number;
497
- }
498
- /**
499
- * useUIBridge return type
500
- */
501
- interface UseUIBridgeReturn {
502
- /** Whether UI Bridge is available */
503
- available: boolean;
504
- /** Whether UI Bridge is initialized */
505
- initialized: boolean;
506
- /** All registered elements */
507
- elements: RegisteredNativeElement[];
508
- /** All registered components */
509
- components: RegisteredNativeComponent[];
510
- /** All registered workflows */
511
- workflows: Workflow[];
512
- /** Create a snapshot of the current state */
513
- createSnapshot: () => NativeBridgeSnapshot;
514
- /** Execute an action on an element */
515
- executeAction: (elementId: string, request: NativeActionRequest) => Promise<NativeActionResponse>;
516
- /** Execute a component action */
517
- executeComponentAction: (componentId: string, request: ComponentActionRequest) => Promise<ComponentActionResponse>;
518
- /** Find elements */
519
- find: (request?: NativeFindRequest) => Promise<NativeFindResponse>;
520
- /** Get an element by ID */
521
- getElement: (id: string) => RegisteredNativeElement | undefined;
522
- /** Get a component by ID */
523
- getComponent: (id: string) => RegisteredNativeComponent | undefined;
524
- /** Get element state by ID */
525
- getElementState: (id: string) => ReturnType<RegisteredNativeElement['getState']> | null;
526
- /** Register a workflow */
527
- registerWorkflow: (workflow: Workflow) => void;
528
- /** Unregister a workflow */
529
- unregisterWorkflow: (id: string) => void;
530
- }
531
- /**
532
- * useUIBridge hook
533
- *
534
- * Provides a simplified interface for accessing UI Bridge functionality.
535
- *
536
- * @example
537
- * ```tsx
538
- * function MyComponent() {
539
- * const { available, elements, executeAction, find } = useUIBridge();
540
- *
541
- * if (!available) {
542
- * return <Text>UI Bridge not available</Text>;
543
- * }
544
- *
545
- * const handlePress = async () => {
546
- * // Find all buttons
547
- * const result = await find({ types: ['button'] });
548
- * console.log('Found buttons:', result.elements);
549
- *
550
- * // Execute action on specific element
551
- * await executeAction('submit-btn', { action: 'press' });
552
- * };
553
- *
554
- * return (
555
- * <View>
556
- * <Text>Elements: {elements.length}</Text>
557
- * <Button title="Press" onPress={handlePress} />
558
- * </View>
559
- * );
560
- * }
561
- * ```
562
- */
563
- declare function useUIBridge(): UseUIBridgeReturn;
564
- /**
565
- * useUIBridgeRequired hook
566
- *
567
- * Same as useUIBridge but throws if not available.
568
- */
569
- declare function useUIBridgeRequired(): UseUIBridgeReturn;
570
-
571
- export { CloudRelayClient as C, type UIBridgeNativeContextValue as U, type CloudRelayConfig as a, type ComponentActionDef as b, type ComponentActionRequest as c, type ComponentActionResponse as d, UIBridgeNativeProvider as e, type UIBridgeNativeProviderProps as f, type UIBridgeProps as g, type UseUIBridgeReturn as h, type UseUIComponentOptions as i, type UseUIComponentReturn as j, type UseUIElementOptions as k, type UseUIElementReturn as l, type UseUIElementWithPropsReturn as m, useUIBridgeNative as n, useUIBridgeNativeOptional as o, useUIBridgeNativeRequired as p, useUIBridgeRequired as q, useUIComponent as r, useUIComponentAction as s, useUIElement as t, useUIBridge as u, useUIElementWithProps as v };