@qontinui/ui-bridge-native 0.1.6 → 0.2.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.
- package/dist/control/{action-executor.d.ts → index.d.mts} +14 -6
- package/dist/control/index.d.ts +95 -5
- package/dist/control/index.js +74 -11
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +74 -11
- package/dist/control/index.mjs.map +1 -1
- package/dist/core/index.d.mts +46 -0
- package/dist/core/index.d.ts +43 -6
- package/dist/core/index.js +69 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +69 -1
- package/dist/core/index.mjs.map +1 -1
- package/dist/debug/{inspector.d.ts → index.d.mts} +6 -3
- package/dist/debug/index.d.ts +44 -4
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs.map +1 -1
- package/dist/design/{design-inspector-native.d.ts → index.d.mts} +11 -7
- package/dist/design/index.d.ts +60 -5
- package/dist/{design/design-types.d.ts → design-types-BHr6Q1FX.d.mts} +11 -10
- package/dist/design-types-BHr6Q1FX.d.ts +205 -0
- package/dist/http-server-DCdR8WlL.d.mts +622 -0
- package/dist/http-server-Dj3grQW4.d.ts +622 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.d.ts +86 -28
- package/dist/index.js +391 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +386 -13
- package/dist/index.mjs.map +1 -1
- package/dist/react/{useAutoRegister.d.ts → index.d.mts} +15 -7
- package/dist/react/index.d.ts +69 -8
- package/dist/react/index.js +388 -12
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +386 -13
- package/dist/react/index.mjs.map +1 -1
- package/dist/registry-Cahd8Gn2.d.mts +230 -0
- package/dist/{core/registry.d.ts → registry-z-3WJsxp.d.ts} +28 -10
- package/dist/server/index.d.mts +119 -0
- package/dist/server/index.d.ts +117 -13
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/types-DAfCeWXc.d.mts +197 -0
- package/dist/{core/types.d.ts → types-Oz13YLZq.d.mts} +124 -30
- package/dist/types-Oz13YLZq.d.ts +477 -0
- package/dist/{control/types.d.ts → types-ajakyp-l.d.ts} +36 -15
- package/dist/useUIBridgeToast-D32KXyL1.d.ts +720 -0
- package/dist/useUIBridgeToast-GmT1TzUe.d.mts +720 -0
- package/package.json +1 -1
- package/dist/control/action-executor.d.ts.map +0 -1
- package/dist/control/index.d.ts.map +0 -1
- package/dist/control/types.d.ts.map +0 -1
- package/dist/core/element-identifier.d.ts +0 -41
- package/dist/core/element-identifier.d.ts.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/registry.d.ts.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/debug/index.d.ts.map +0 -1
- package/dist/debug/inspector.d.ts.map +0 -1
- package/dist/design/design-inspector-native.d.ts.map +0 -1
- package/dist/design/design-types.d.ts.map +0 -1
- package/dist/design/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/react/UIBridgeNativeProvider.d.ts +0 -147
- package/dist/react/UIBridgeNativeProvider.d.ts.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/useAutoRegister.d.ts.map +0 -1
- package/dist/react/useUIBridge.d.ts +0 -103
- package/dist/react/useUIBridge.d.ts.map +0 -1
- package/dist/react/useUIComponent.d.ts +0 -112
- package/dist/react/useUIComponent.d.ts.map +0 -1
- package/dist/react/useUIElement.d.ts +0 -162
- package/dist/react/useUIElement.d.ts.map +0 -1
- package/dist/server/design-handlers.d.ts +0 -47
- package/dist/server/design-handlers.d.ts.map +0 -1
- package/dist/server/handlers.d.ts +0 -20
- package/dist/server/handlers.d.ts.map +0 -1
- package/dist/server/http-server.d.ts +0 -247
- package/dist/server/http-server.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/types.d.ts +0 -200
- package/dist/server/types.d.ts.map +0 -1
- package/dist/server/ws-connection.d.ts +0 -48
- package/dist/server/ws-connection.d.ts.map +0 -1
- package/dist/server/ws-event-bridge.d.ts +0 -113
- package/dist/server/ws-event-bridge.d.ts.map +0 -1
- package/dist/server/ws-protocol.d.ts +0 -48
- package/dist/server/ws-protocol.d.ts.map +0 -1
- package/dist/server/ws-types.d.ts +0 -65
- package/dist/server/ws-types.d.ts.map +0 -1
- package/dist/transport/CloudRelayClient.d.ts +0 -51
- package/dist/transport/CloudRelayClient.d.ts.map +0 -1
- package/dist/transport/DeviceAnnouncer.d.ts +0 -75
- package/dist/transport/DeviceAnnouncer.d.ts.map +0 -1
- package/dist/transport/index.d.ts +0 -3
- package/dist/transport/index.d.ts.map +0 -1
|
@@ -0,0 +1,477 @@
|
|
|
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
|
+
* Snapshot of the entire native UI bridge state
|
|
272
|
+
*/
|
|
273
|
+
interface NativeBridgeSnapshot {
|
|
274
|
+
/** Timestamp of the snapshot */
|
|
275
|
+
timestamp: number;
|
|
276
|
+
/** All registered elements */
|
|
277
|
+
elements: Array<{
|
|
278
|
+
id: string;
|
|
279
|
+
type: NativeElementType;
|
|
280
|
+
label?: string;
|
|
281
|
+
identifier: NativeElementIdentifier;
|
|
282
|
+
state: NativeElementState;
|
|
283
|
+
actions: NativeStandardAction[];
|
|
284
|
+
customActions?: string[];
|
|
285
|
+
/** Handler names actually registered via updateElementProps (e.g. ['onPress', 'onChangeText']) */
|
|
286
|
+
registeredHandlers?: string[];
|
|
287
|
+
/** Route path where this element was registered (for page-scoped filtering) */
|
|
288
|
+
registrationRoute?: string | null;
|
|
289
|
+
}>;
|
|
290
|
+
/** All registered components */
|
|
291
|
+
components: Array<{
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
description?: string;
|
|
295
|
+
actions: string[];
|
|
296
|
+
elementIds?: string[];
|
|
297
|
+
}>;
|
|
298
|
+
/** Available workflows */
|
|
299
|
+
workflows: Array<{
|
|
300
|
+
id: string;
|
|
301
|
+
name: string;
|
|
302
|
+
description?: string;
|
|
303
|
+
stepCount: number;
|
|
304
|
+
}>;
|
|
305
|
+
/** Current navigation route path (if a RouteProvider is configured) */
|
|
306
|
+
currentRoute?: string | null;
|
|
307
|
+
/** Current route segments (if a RouteProvider is configured) */
|
|
308
|
+
segments?: string[];
|
|
309
|
+
/** Modal/sheet/drawer context (populated when a modalDetector enricher is registered) */
|
|
310
|
+
modalStack?: NativeSnapshotModalContext;
|
|
311
|
+
/** Toast/snackbar context (populated when a toastCapture enricher is registered) */
|
|
312
|
+
toasts?: NativeSnapshotToastContext;
|
|
313
|
+
/** Undo/redo context (populated when an undoTracker enricher is registered) */
|
|
314
|
+
undoRedo?: NativeSnapshotUndoContext;
|
|
315
|
+
}
|
|
316
|
+
/** A single detected modal-like surface (modal, sheet, drawer, popover, alert) */
|
|
317
|
+
interface NativeModalInfo {
|
|
318
|
+
id: string;
|
|
319
|
+
title?: string;
|
|
320
|
+
type: 'modal' | 'sheet' | 'drawer' | 'popover' | 'alertdialog' | 'dialog';
|
|
321
|
+
/** Whether the modal blocks interaction with the underlying UI */
|
|
322
|
+
blocking: boolean;
|
|
323
|
+
/** Whether it can be dismissed by the user (backdrop tap, swipe, esc, etc.) */
|
|
324
|
+
dismissible: boolean;
|
|
325
|
+
detectedAt: number;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Modal context attached to a snapshot. Field names match the web SDK's
|
|
329
|
+
* `SnapshotModalContext` so external agents can write transport-agnostic checks
|
|
330
|
+
* like `snapshot.modalStack?.hasBlockingModal`.
|
|
331
|
+
*/
|
|
332
|
+
interface NativeSnapshotModalContext {
|
|
333
|
+
modals: NativeModalInfo[];
|
|
334
|
+
topModal?: NativeModalInfo;
|
|
335
|
+
hasBlockingModal: boolean;
|
|
336
|
+
count: number;
|
|
337
|
+
}
|
|
338
|
+
/** A captured toast/snackbar */
|
|
339
|
+
interface NativeCapturedToast {
|
|
340
|
+
id: string;
|
|
341
|
+
message: string;
|
|
342
|
+
level: 'info' | 'success' | 'warning' | 'error' | 'loading' | 'unknown';
|
|
343
|
+
appearedAt: number;
|
|
344
|
+
dismissedAt?: number;
|
|
345
|
+
visible: boolean;
|
|
346
|
+
/** Total duration in ms (lifetime so far if still visible, total if dismissed) */
|
|
347
|
+
durationMs: number;
|
|
348
|
+
}
|
|
349
|
+
/** Toast context attached to a snapshot */
|
|
350
|
+
interface NativeSnapshotToastContext {
|
|
351
|
+
/** Toasts currently on screen */
|
|
352
|
+
active: NativeCapturedToast[];
|
|
353
|
+
/** Recently-dismissed toasts retained by the capture buffer (most recent first) */
|
|
354
|
+
recent: NativeCapturedToast[];
|
|
355
|
+
/** Total number of toasts ever captured by this tracker */
|
|
356
|
+
totalCaptured: number;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Undo/redo context attached to a snapshot. Mirrors the web SDK's
|
|
360
|
+
* `SnapshotUndoContext` minus DOM-only fields — RN has no `document.execCommand`
|
|
361
|
+
* or selectors, so the native variant relies entirely on developer declaration.
|
|
362
|
+
*/
|
|
363
|
+
interface NativeSnapshotUndoContext {
|
|
364
|
+
/** Whether undo appears to be available */
|
|
365
|
+
canUndo: boolean;
|
|
366
|
+
/** Whether redo appears to be available */
|
|
367
|
+
canRedo: boolean;
|
|
368
|
+
/** Description of what undo would reverse */
|
|
369
|
+
undoDescription?: string;
|
|
370
|
+
/** Description of what redo would restore */
|
|
371
|
+
redoDescription?: string;
|
|
372
|
+
/** Undo stack depth (if known) */
|
|
373
|
+
undoDepth?: number;
|
|
374
|
+
/** Redo stack depth (if known) */
|
|
375
|
+
redoDepth?: number;
|
|
376
|
+
/** Human-readable summary for AI */
|
|
377
|
+
summary: string;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Canonical enricher slot. Each tracker exposes a `getSnapshot*Context()` method
|
|
381
|
+
* that the registry calls during `createSnapshot`. NavigationTracker is intentionally
|
|
382
|
+
* NOT here — route info already flows through `currentRoute` / `segments`.
|
|
383
|
+
*/
|
|
384
|
+
interface NativeSnapshotEnrichers {
|
|
385
|
+
modalDetector?: {
|
|
386
|
+
getSnapshotModalContext(): NativeSnapshotModalContext;
|
|
387
|
+
};
|
|
388
|
+
toastCapture?: {
|
|
389
|
+
getSnapshotToastContext(): NativeSnapshotToastContext;
|
|
390
|
+
};
|
|
391
|
+
undoTracker?: {
|
|
392
|
+
getSnapshotUndoContext(): NativeSnapshotUndoContext;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Pluggable snapshot enricher: receives base context and returns extra fields
|
|
397
|
+
* that get `Object.assign`ed onto the snapshot. Used for ad-hoc/custom trackers
|
|
398
|
+
* (e.g. runner sidebar tabs) without growing the canonical enricher set.
|
|
399
|
+
*/
|
|
400
|
+
type NativeSnapshotEnricher = (ctx: {
|
|
401
|
+
elements: RegisteredNativeElement[];
|
|
402
|
+
currentRoute: string | null;
|
|
403
|
+
}) => Record<string, unknown>;
|
|
404
|
+
/**
|
|
405
|
+
* UI Bridge Native feature flags
|
|
406
|
+
*/
|
|
407
|
+
interface NativeUIBridgeFeatures {
|
|
408
|
+
/** Enable HTTP control server */
|
|
409
|
+
server?: boolean;
|
|
410
|
+
/** Enable debug tools (inspector overlay) */
|
|
411
|
+
debug?: boolean;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* UI Bridge Native configuration
|
|
415
|
+
*/
|
|
416
|
+
interface NativeUIBridgeConfig {
|
|
417
|
+
/** Port for HTTP server */
|
|
418
|
+
serverPort?: number;
|
|
419
|
+
/** Enable verbose logging */
|
|
420
|
+
verbose?: boolean;
|
|
421
|
+
/** Path prefix for parent components (for treePath generation) */
|
|
422
|
+
parentPath?: string;
|
|
423
|
+
/** Application info for discovery */
|
|
424
|
+
appInfo?: {
|
|
425
|
+
appId: string;
|
|
426
|
+
appName: string;
|
|
427
|
+
appType: 'web' | 'desktop' | 'mobile' | 'other';
|
|
428
|
+
framework?: string;
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Find request for discovering native elements
|
|
433
|
+
*/
|
|
434
|
+
interface NativeFindRequest {
|
|
435
|
+
/** Filter by element type */
|
|
436
|
+
types?: NativeElementType[];
|
|
437
|
+
/** Filter by testID pattern (supports wildcards) */
|
|
438
|
+
testIdPattern?: string;
|
|
439
|
+
/** Filter by accessibility label pattern */
|
|
440
|
+
accessibilityLabelPattern?: string;
|
|
441
|
+
/** Include only visible elements */
|
|
442
|
+
visibleOnly?: boolean;
|
|
443
|
+
/** Maximum number of results */
|
|
444
|
+
limit?: number;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Discovered native element
|
|
448
|
+
*/
|
|
449
|
+
interface DiscoveredNativeElement {
|
|
450
|
+
/** Element ID */
|
|
451
|
+
id: string;
|
|
452
|
+
/** Element type */
|
|
453
|
+
type: NativeElementType;
|
|
454
|
+
/** Element identifier */
|
|
455
|
+
identifier: NativeElementIdentifier;
|
|
456
|
+
/** Current state */
|
|
457
|
+
state: NativeElementState;
|
|
458
|
+
/** Available actions */
|
|
459
|
+
actions: NativeStandardAction[];
|
|
460
|
+
/** Label */
|
|
461
|
+
label?: string;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Find response
|
|
465
|
+
*/
|
|
466
|
+
interface NativeFindResponse {
|
|
467
|
+
/** Discovered elements */
|
|
468
|
+
elements: DiscoveredNativeElement[];
|
|
469
|
+
/** Total count */
|
|
470
|
+
total: number;
|
|
471
|
+
/** Duration in milliseconds */
|
|
472
|
+
durationMs: number;
|
|
473
|
+
/** Timestamp */
|
|
474
|
+
timestamp: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export type { ActionHandler as A, BridgeEvent as B, ComponentAction as C, DiscoveredNativeElement as D, WorkflowStep as E, WorkflowStepType as F, 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, NativeSnapshotEnricher as q, NativeSnapshotEnrichers as r, NativeSnapshotModalContext as s, NativeSnapshotToastContext as t, NativeSnapshotUndoContext as u, NativeStandardAction as v, NativeUIBridgeConfig as w, NativeUIBridgeFeatures as x, RegisteredNativeElement as y, Workflow 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-Oz13YLZq.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
|
-
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Extended action request with control-specific options
|
|
9
11
|
*/
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|