@qontinui/ui-bridge 0.1.1 → 0.3.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 (112) hide show
  1. package/dist/ai/index.d.mts +893 -0
  2. package/dist/ai/index.d.ts +893 -0
  3. package/dist/ai/index.js +3897 -0
  4. package/dist/ai/index.js.map +1 -0
  5. package/dist/ai/index.mjs +3839 -0
  6. package/dist/ai/index.mjs.map +1 -0
  7. package/dist/babel-plugin/index.js +515 -0
  8. package/dist/babel-plugin/index.js.map +1 -0
  9. package/dist/babel-plugin/index.mjs +499 -0
  10. package/dist/babel-plugin/index.mjs.map +1 -0
  11. package/dist/control/index.d.mts +5 -4
  12. package/dist/control/index.d.ts +5 -4
  13. package/dist/core/index.d.mts +115 -42
  14. package/dist/core/index.d.ts +115 -42
  15. package/dist/core/index.js +0 -983
  16. package/dist/core/index.js.map +1 -1
  17. package/dist/core/index.mjs +1 -972
  18. package/dist/core/index.mjs.map +1 -1
  19. package/dist/debug/index.d.mts +3 -3
  20. package/dist/debug/index.d.ts +3 -3
  21. package/dist/index.d.mts +8 -7
  22. package/dist/index.d.ts +8 -7
  23. package/dist/index.js +8249 -4163
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +8193 -4152
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{metrics-QCnK0EFw.d.ts → metrics-BfiT_rhZ.d.ts} +2 -2
  28. package/dist/{metrics-BCG7z7Aq.d.mts → metrics-DTA2bwG7.d.mts} +2 -2
  29. package/dist/native/control/index.js +453 -0
  30. package/dist/native/control/index.js.map +1 -0
  31. package/dist/native/control/index.mjs +450 -0
  32. package/dist/native/control/index.mjs.map +1 -0
  33. package/dist/native/core/index.js +486 -0
  34. package/dist/native/core/index.js.map +1 -0
  35. package/dist/native/core/index.mjs +475 -0
  36. package/dist/native/core/index.mjs.map +1 -0
  37. package/dist/native/debug/index.js +451 -0
  38. package/dist/native/debug/index.js.map +1 -0
  39. package/dist/native/debug/index.mjs +449 -0
  40. package/dist/native/debug/index.mjs.map +1 -0
  41. package/dist/native/index.js +2274 -0
  42. package/dist/native/index.js.map +1 -0
  43. package/dist/native/index.mjs +2246 -0
  44. package/dist/native/index.mjs.map +1 -0
  45. package/dist/native/react/index.js +1401 -0
  46. package/dist/native/react/index.js.map +1 -0
  47. package/dist/native/react/index.mjs +1389 -0
  48. package/dist/native/react/index.mjs.map +1 -0
  49. package/dist/native/server/index.js +415 -0
  50. package/dist/native/server/index.js.map +1 -0
  51. package/dist/native/server/index.mjs +410 -0
  52. package/dist/native/server/index.mjs.map +1 -0
  53. package/dist/react/index.d.mts +20 -6
  54. package/dist/react/index.d.ts +20 -6
  55. package/dist/react/index.js +629 -14
  56. package/dist/react/index.js.map +1 -1
  57. package/dist/react/index.mjs +629 -14
  58. package/dist/react/index.mjs.map +1 -1
  59. package/dist/{registry-CT6BVVKr.d.mts → registry-BKLEm-yk.d.ts} +29 -14
  60. package/dist/{registry-D4mQ01B3.d.ts → registry-BmZgyCz8.d.mts} +29 -14
  61. package/dist/render-log/index.d.mts +1 -1
  62. package/dist/render-log/index.d.ts +1 -1
  63. package/dist/server/express.d.mts +36 -0
  64. package/dist/server/express.d.ts +36 -0
  65. package/dist/server/express.js +196 -0
  66. package/dist/server/express.js.map +1 -0
  67. package/dist/server/express.mjs +192 -0
  68. package/dist/server/express.mjs.map +1 -0
  69. package/dist/server/handlers.d.mts +93 -0
  70. package/dist/server/handlers.d.ts +93 -0
  71. package/dist/server/handlers.js +4278 -0
  72. package/dist/server/handlers.js.map +1 -0
  73. package/dist/server/handlers.mjs +4275 -0
  74. package/dist/server/handlers.mjs.map +1 -0
  75. package/dist/server/index.d.mts +10 -0
  76. package/dist/server/index.d.ts +10 -0
  77. package/dist/server/index.js +5352 -0
  78. package/dist/server/index.js.map +1 -0
  79. package/dist/server/index.mjs +5337 -0
  80. package/dist/server/index.mjs.map +1 -0
  81. package/dist/server/nextjs.d.mts +126 -0
  82. package/dist/server/nextjs.d.ts +126 -0
  83. package/dist/server/nextjs.js +287 -0
  84. package/dist/server/nextjs.js.map +1 -0
  85. package/dist/server/nextjs.mjs +282 -0
  86. package/dist/server/nextjs.mjs.map +1 -0
  87. package/dist/server/standalone.d.mts +6 -0
  88. package/dist/server/standalone.d.ts +6 -0
  89. package/dist/server/standalone.js +719 -0
  90. package/dist/server/standalone.js.map +1 -0
  91. package/dist/server/standalone.mjs +715 -0
  92. package/dist/server/standalone.mjs.map +1 -0
  93. package/dist/standalone-BURj8J3G.d.ts +212 -0
  94. package/dist/standalone-Dwmel29d.d.mts +212 -0
  95. package/dist/swc-plugin/index.d.mts +79 -0
  96. package/dist/swc-plugin/index.d.ts +79 -0
  97. package/dist/swc-plugin/index.js +15 -0
  98. package/dist/swc-plugin/index.js.map +1 -0
  99. package/dist/swc-plugin/index.mjs +9 -0
  100. package/dist/swc-plugin/index.mjs.map +1 -0
  101. package/dist/types-B5Q0GVo0.d.mts +646 -0
  102. package/dist/{types-DdJD9yw5.d.mts → types-B7J7noLK.d.mts} +1 -1
  103. package/dist/{types-BDkXy5si.d.ts → types-BkNRILUa.d.ts} +1 -1
  104. package/dist/types-CEQLnFMv.d.mts +156 -0
  105. package/dist/types-CHnlwiTK.d.ts +156 -0
  106. package/dist/types-DfPqwU-i.d.ts +646 -0
  107. package/dist/{types-BpvpStn3.d.mts → types-jKVgTI6_.d.mts} +364 -160
  108. package/dist/{types-BpvpStn3.d.ts → types-jKVgTI6_.d.ts} +364 -160
  109. package/package.json +111 -3
  110. package/swc-plugin-wasm/ui_bridge_swc_plugin.wasm +0 -0
  111. package/dist/websocket-client-B2LC9CYc.d.mts +0 -124
  112. package/dist/websocket-client-DupH0X7B.d.ts +0 -124
@@ -1,52 +1,125 @@
1
- import { E as ElementIdentifier } from '../types-BpvpStn3.mjs';
2
- export { A as ActionHandler, a as ActionRequest, b as ActionResponse, B as BranchCondition, c as BridgeEvent, d as BridgeEventListener, e as BridgeEventType, f as BridgeSnapshot, C as ComponentAction, g as CustomAction, h as ElementState, i as ElementType, j as ExtractConfig, L as LogConfig, k as LoopConfig, N as NavigationResult, P as PathResult, R as RegisteredComponent, l as RegisteredElement, S as StandardAction, m as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, n as UIBridgeFeatures, o as UIState, p as UIStateGroup, q as UITransition, W as WSClientConfig, r as WSClientMessage, s as WSClientMessageType, t as WSConnectionState, u as WSDiscoverMessage, v as WSErrorMessage, w as WSEventMessage, x as WSExecuteActionMessage, y as WSExecuteComponentActionMessage, z as WSExecuteWorkflowMessage, D as WSFindMessage, F as WSGetElementMessage, G as WSGetSnapshotMessage, H as WSMessageBase, I as WSPingMessage, J as WSPongMessage, K as WSResponseMessage, M as WSServerMessage, O as WSServerMessageType, Q as WSSubscribeMessage, V as WSSubscribedMessage, X as WSSubscriptionOptions, Y as WSUnsubscribeMessage, Z as WSUnsubscribedMessage, _ as WSWelcomeMessage, $ as WSWorkflowProgressMessage, a0 as WaitOptions, a1 as Workflow, a2 as WorkflowStep, a3 as WorkflowStepType } from '../types-BpvpStn3.mjs';
3
- export { R as RegistryOptions, U as UIBridgeRegistry, g as getGlobalRegistry, r as resetGlobalRegistry, s as setGlobalRegistry } from '../registry-CT6BVVKr.mjs';
4
- export { U as UIBridgeWSClient, c as createWSClient } from '../websocket-client-B2LC9CYc.mjs';
1
+ import { I as WSClientConfig, M as WSConnectionState, a9 as WSSubscriptionOptions, k as BridgeEventType, l as BridgeSnapshot, f as ActionRequest, g as ActionResponse, i as BridgeEvent } from '../types-jKVgTI6_.mjs';
2
+ export { A as AccessibilityIssue, a as AccessibilityReport, b as AccessibilitySeverity, c as ActionErrorCode, d as ActionFailureDetails, e as ActionHandler, h as AriaCheckedState, B as BranchCondition, j as BridgeEventListener, C as ComponentAction, m as ComponentStateResponse, n as ComputedProperty, o as CustomAction, E as ElementAccessibility, p as ElementIdentifier, q as ElementState, r as ElementType, s as ExtendedWorkflowStep, t as ExtractConfig, L as LogConfig, u as LoopConfig, N as NavigationResult, P as PartialMatch, v as PathResult, R as RecoveryAction, w as RegisteredComponent, x as RegisteredElement, S as StandardAction, y as StateGetter, z as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, D as UIBridgeFeatures, F as UIState, G as UIStateGroup, H as UITransition, W as WCAGLevel, J as WSClientMessage, K as WSClientMessageType, O as WSDiscoverMessage, Q as WSErrorMessage, V as WSEventMessage, X as WSExecuteActionMessage, Y as WSExecuteComponentActionMessage, Z as WSExecuteWorkflowMessage, _ as WSFindMessage, $ as WSGetElementMessage, a0 as WSGetSnapshotMessage, a1 as WSMessageBase, a2 as WSPingMessage, a3 as WSPongMessage, a4 as WSResponseMessage, a5 as WSServerMessage, a6 as WSServerMessageType, a7 as WSSubscribeMessage, a8 as WSSubscribedMessage, aa as WSUnsubscribeMessage, ab as WSUnsubscribedMessage, ac as WSWelcomeMessage, ad as WSWorkflowProgressMessage, ae as WaitOptions, af as Workflow, ag as WorkflowStep, ah as WorkflowStepType } from '../types-jKVgTI6_.mjs';
5
3
 
6
4
  /**
7
- * Element Identification Module
5
+ * WebSocket Client for UI Bridge
8
6
  *
9
- * Provides utilities for identifying DOM elements using multiple strategies:
10
- * 1. data-ui-id (explicit UI Bridge identifier - preferred)
11
- * 2. data-testid (testing library convention)
12
- * 3. data-awas-element (legacy support)
13
- * 4. id (HTML id attribute)
14
- * 5. Generated XPath/CSS selector (fallback)
7
+ * Provides real-time communication with UI Bridge server.
15
8
  */
16
9
 
17
10
  /**
18
- * Data attributes used for element identification (in priority order)
11
+ * WebSocket client for UI Bridge
19
12
  */
20
- declare const ID_ATTRIBUTES: readonly ["data-ui-id", "data-testid", "data-awas-element", "id"];
13
+ declare class UIBridgeWSClient {
14
+ private ws;
15
+ private config;
16
+ private state;
17
+ private clientId;
18
+ private reconnectAttempts;
19
+ private reconnectTimer;
20
+ private pingTimer;
21
+ private pendingRequests;
22
+ private connectionListeners;
23
+ private eventListeners;
24
+ private errorListeners;
25
+ private subscriptions;
26
+ constructor(config: WSClientConfig);
27
+ /**
28
+ * Get current connection state
29
+ */
30
+ get connectionState(): WSConnectionState;
31
+ /**
32
+ * Get assigned client ID
33
+ */
34
+ get id(): string | null;
35
+ /**
36
+ * Connect to the WebSocket server
37
+ */
38
+ connect(): Promise<void>;
39
+ /**
40
+ * Disconnect from the server
41
+ */
42
+ disconnect(): void;
43
+ /**
44
+ * Subscribe to events
45
+ */
46
+ subscribe(options: WSSubscriptionOptions): Promise<BridgeEventType[]>;
47
+ /**
48
+ * Unsubscribe from events
49
+ */
50
+ unsubscribe(events?: BridgeEventType[]): Promise<BridgeEventType[]>;
51
+ /**
52
+ * Find elements
53
+ */
54
+ find(options?: {
55
+ interactiveOnly?: boolean;
56
+ includeState?: boolean;
57
+ selector?: string;
58
+ }): Promise<BridgeSnapshot['elements']>;
59
+ /**
60
+ * Discover elements
61
+ * @deprecated Use find() instead
62
+ */
63
+ discover(options?: {
64
+ interactiveOnly?: boolean;
65
+ includeState?: boolean;
66
+ selector?: string;
67
+ }): Promise<BridgeSnapshot['elements']>;
68
+ /**
69
+ * Get element details
70
+ */
71
+ getElement(elementId: string, includeState?: boolean): Promise<BridgeSnapshot['elements'][0] | null>;
72
+ /**
73
+ * Get full snapshot
74
+ */
75
+ getSnapshot(): Promise<BridgeSnapshot>;
76
+ /**
77
+ * Execute action on an element
78
+ */
79
+ executeAction(elementId: string, action: ActionRequest): Promise<ActionResponse>;
80
+ /**
81
+ * Execute component action
82
+ */
83
+ executeComponentAction(componentId: string, action: string, params?: Record<string, unknown>): Promise<ActionResponse>;
84
+ /**
85
+ * Execute workflow with optional progress streaming
86
+ */
87
+ executeWorkflow(workflowId: string, params?: Record<string, unknown>, onProgress?: (progress: {
88
+ currentStep: number;
89
+ totalSteps: number;
90
+ step: {
91
+ id: string;
92
+ status: string;
93
+ };
94
+ }) => void): Promise<{
95
+ success: boolean;
96
+ results: unknown[];
97
+ }>;
98
+ /**
99
+ * Add connection state listener
100
+ */
101
+ onConnectionChange(listener: (state: WSConnectionState) => void): () => void;
102
+ /**
103
+ * Add event listener
104
+ */
105
+ onEvent(eventType: BridgeEventType | '*', listener: (event: BridgeEvent) => void): () => void;
106
+ /**
107
+ * Add error listener
108
+ */
109
+ onError(listener: (error: Error) => void): () => void;
110
+ private setState;
111
+ private handleMessage;
112
+ private handleResponse;
113
+ private notifyEvent;
114
+ private notifyError;
115
+ private sendRequest;
116
+ private scheduleReconnect;
117
+ private startPingInterval;
118
+ private stopPingInterval;
119
+ }
21
120
  /**
22
- * Generate a unique XPath for an element
121
+ * Create a WebSocket client instance
23
122
  */
24
- declare function generateXPath(element: HTMLElement): string;
25
- /**
26
- * Generate a unique CSS selector for an element
27
- */
28
- declare function generateCSSSelector(element: HTMLElement): string;
29
- /**
30
- * Get the best identifier for an element based on available attributes
31
- */
32
- declare function getBestIdentifier(element: HTMLElement): string;
33
- /**
34
- * Create a full ElementIdentifier object for an element
35
- */
36
- declare function createElementIdentifier(element: HTMLElement): ElementIdentifier;
37
- /**
38
- * Find an element by its identifier
39
- *
40
- * Tries each identification method in priority order
41
- */
42
- declare function findElementByIdentifier(identifier: string | ElementIdentifier, root?: ParentNode): HTMLElement | null;
43
- /**
44
- * Find all elements matching an identifier pattern
45
- */
46
- declare function findAllElementsByIdentifier(pattern: string, root?: ParentNode): HTMLElement[];
47
- /**
48
- * Check if an element matches an identifier
49
- */
50
- declare function elementMatchesIdentifier(element: HTMLElement, identifier: string | ElementIdentifier): boolean;
123
+ declare function createWSClient(config: WSClientConfig): UIBridgeWSClient;
51
124
 
52
- export { ElementIdentifier, ID_ATTRIBUTES, createElementIdentifier, elementMatchesIdentifier, findAllElementsByIdentifier, findElementByIdentifier, generateCSSSelector, generateXPath, getBestIdentifier };
125
+ export { ActionRequest, ActionResponse, BridgeEvent, BridgeEventType, BridgeSnapshot, UIBridgeWSClient, WSClientConfig, WSConnectionState, WSSubscriptionOptions, createWSClient };
@@ -1,52 +1,125 @@
1
- import { E as ElementIdentifier } from '../types-BpvpStn3.js';
2
- export { A as ActionHandler, a as ActionRequest, b as ActionResponse, B as BranchCondition, c as BridgeEvent, d as BridgeEventListener, e as BridgeEventType, f as BridgeSnapshot, C as ComponentAction, g as CustomAction, h as ElementState, i as ElementType, j as ExtractConfig, L as LogConfig, k as LoopConfig, N as NavigationResult, P as PathResult, R as RegisteredComponent, l as RegisteredElement, S as StandardAction, m as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, n as UIBridgeFeatures, o as UIState, p as UIStateGroup, q as UITransition, W as WSClientConfig, r as WSClientMessage, s as WSClientMessageType, t as WSConnectionState, u as WSDiscoverMessage, v as WSErrorMessage, w as WSEventMessage, x as WSExecuteActionMessage, y as WSExecuteComponentActionMessage, z as WSExecuteWorkflowMessage, D as WSFindMessage, F as WSGetElementMessage, G as WSGetSnapshotMessage, H as WSMessageBase, I as WSPingMessage, J as WSPongMessage, K as WSResponseMessage, M as WSServerMessage, O as WSServerMessageType, Q as WSSubscribeMessage, V as WSSubscribedMessage, X as WSSubscriptionOptions, Y as WSUnsubscribeMessage, Z as WSUnsubscribedMessage, _ as WSWelcomeMessage, $ as WSWorkflowProgressMessage, a0 as WaitOptions, a1 as Workflow, a2 as WorkflowStep, a3 as WorkflowStepType } from '../types-BpvpStn3.js';
3
- export { R as RegistryOptions, U as UIBridgeRegistry, g as getGlobalRegistry, r as resetGlobalRegistry, s as setGlobalRegistry } from '../registry-D4mQ01B3.js';
4
- export { U as UIBridgeWSClient, c as createWSClient } from '../websocket-client-DupH0X7B.js';
1
+ import { I as WSClientConfig, M as WSConnectionState, a9 as WSSubscriptionOptions, k as BridgeEventType, l as BridgeSnapshot, f as ActionRequest, g as ActionResponse, i as BridgeEvent } from '../types-jKVgTI6_.js';
2
+ export { A as AccessibilityIssue, a as AccessibilityReport, b as AccessibilitySeverity, c as ActionErrorCode, d as ActionFailureDetails, e as ActionHandler, h as AriaCheckedState, B as BranchCondition, j as BridgeEventListener, C as ComponentAction, m as ComponentStateResponse, n as ComputedProperty, o as CustomAction, E as ElementAccessibility, p as ElementIdentifier, q as ElementState, r as ElementType, s as ExtendedWorkflowStep, t as ExtractConfig, L as LogConfig, u as LoopConfig, N as NavigationResult, P as PartialMatch, v as PathResult, R as RecoveryAction, w as RegisteredComponent, x as RegisteredElement, S as StandardAction, y as StateGetter, z as StateSnapshot, T as TransitionResult, U as UIBridgeConfig, D as UIBridgeFeatures, F as UIState, G as UIStateGroup, H as UITransition, W as WCAGLevel, J as WSClientMessage, K as WSClientMessageType, O as WSDiscoverMessage, Q as WSErrorMessage, V as WSEventMessage, X as WSExecuteActionMessage, Y as WSExecuteComponentActionMessage, Z as WSExecuteWorkflowMessage, _ as WSFindMessage, $ as WSGetElementMessage, a0 as WSGetSnapshotMessage, a1 as WSMessageBase, a2 as WSPingMessage, a3 as WSPongMessage, a4 as WSResponseMessage, a5 as WSServerMessage, a6 as WSServerMessageType, a7 as WSSubscribeMessage, a8 as WSSubscribedMessage, aa as WSUnsubscribeMessage, ab as WSUnsubscribedMessage, ac as WSWelcomeMessage, ad as WSWorkflowProgressMessage, ae as WaitOptions, af as Workflow, ag as WorkflowStep, ah as WorkflowStepType } from '../types-jKVgTI6_.js';
5
3
 
6
4
  /**
7
- * Element Identification Module
5
+ * WebSocket Client for UI Bridge
8
6
  *
9
- * Provides utilities for identifying DOM elements using multiple strategies:
10
- * 1. data-ui-id (explicit UI Bridge identifier - preferred)
11
- * 2. data-testid (testing library convention)
12
- * 3. data-awas-element (legacy support)
13
- * 4. id (HTML id attribute)
14
- * 5. Generated XPath/CSS selector (fallback)
7
+ * Provides real-time communication with UI Bridge server.
15
8
  */
16
9
 
17
10
  /**
18
- * Data attributes used for element identification (in priority order)
11
+ * WebSocket client for UI Bridge
19
12
  */
20
- declare const ID_ATTRIBUTES: readonly ["data-ui-id", "data-testid", "data-awas-element", "id"];
13
+ declare class UIBridgeWSClient {
14
+ private ws;
15
+ private config;
16
+ private state;
17
+ private clientId;
18
+ private reconnectAttempts;
19
+ private reconnectTimer;
20
+ private pingTimer;
21
+ private pendingRequests;
22
+ private connectionListeners;
23
+ private eventListeners;
24
+ private errorListeners;
25
+ private subscriptions;
26
+ constructor(config: WSClientConfig);
27
+ /**
28
+ * Get current connection state
29
+ */
30
+ get connectionState(): WSConnectionState;
31
+ /**
32
+ * Get assigned client ID
33
+ */
34
+ get id(): string | null;
35
+ /**
36
+ * Connect to the WebSocket server
37
+ */
38
+ connect(): Promise<void>;
39
+ /**
40
+ * Disconnect from the server
41
+ */
42
+ disconnect(): void;
43
+ /**
44
+ * Subscribe to events
45
+ */
46
+ subscribe(options: WSSubscriptionOptions): Promise<BridgeEventType[]>;
47
+ /**
48
+ * Unsubscribe from events
49
+ */
50
+ unsubscribe(events?: BridgeEventType[]): Promise<BridgeEventType[]>;
51
+ /**
52
+ * Find elements
53
+ */
54
+ find(options?: {
55
+ interactiveOnly?: boolean;
56
+ includeState?: boolean;
57
+ selector?: string;
58
+ }): Promise<BridgeSnapshot['elements']>;
59
+ /**
60
+ * Discover elements
61
+ * @deprecated Use find() instead
62
+ */
63
+ discover(options?: {
64
+ interactiveOnly?: boolean;
65
+ includeState?: boolean;
66
+ selector?: string;
67
+ }): Promise<BridgeSnapshot['elements']>;
68
+ /**
69
+ * Get element details
70
+ */
71
+ getElement(elementId: string, includeState?: boolean): Promise<BridgeSnapshot['elements'][0] | null>;
72
+ /**
73
+ * Get full snapshot
74
+ */
75
+ getSnapshot(): Promise<BridgeSnapshot>;
76
+ /**
77
+ * Execute action on an element
78
+ */
79
+ executeAction(elementId: string, action: ActionRequest): Promise<ActionResponse>;
80
+ /**
81
+ * Execute component action
82
+ */
83
+ executeComponentAction(componentId: string, action: string, params?: Record<string, unknown>): Promise<ActionResponse>;
84
+ /**
85
+ * Execute workflow with optional progress streaming
86
+ */
87
+ executeWorkflow(workflowId: string, params?: Record<string, unknown>, onProgress?: (progress: {
88
+ currentStep: number;
89
+ totalSteps: number;
90
+ step: {
91
+ id: string;
92
+ status: string;
93
+ };
94
+ }) => void): Promise<{
95
+ success: boolean;
96
+ results: unknown[];
97
+ }>;
98
+ /**
99
+ * Add connection state listener
100
+ */
101
+ onConnectionChange(listener: (state: WSConnectionState) => void): () => void;
102
+ /**
103
+ * Add event listener
104
+ */
105
+ onEvent(eventType: BridgeEventType | '*', listener: (event: BridgeEvent) => void): () => void;
106
+ /**
107
+ * Add error listener
108
+ */
109
+ onError(listener: (error: Error) => void): () => void;
110
+ private setState;
111
+ private handleMessage;
112
+ private handleResponse;
113
+ private notifyEvent;
114
+ private notifyError;
115
+ private sendRequest;
116
+ private scheduleReconnect;
117
+ private startPingInterval;
118
+ private stopPingInterval;
119
+ }
21
120
  /**
22
- * Generate a unique XPath for an element
121
+ * Create a WebSocket client instance
23
122
  */
24
- declare function generateXPath(element: HTMLElement): string;
25
- /**
26
- * Generate a unique CSS selector for an element
27
- */
28
- declare function generateCSSSelector(element: HTMLElement): string;
29
- /**
30
- * Get the best identifier for an element based on available attributes
31
- */
32
- declare function getBestIdentifier(element: HTMLElement): string;
33
- /**
34
- * Create a full ElementIdentifier object for an element
35
- */
36
- declare function createElementIdentifier(element: HTMLElement): ElementIdentifier;
37
- /**
38
- * Find an element by its identifier
39
- *
40
- * Tries each identification method in priority order
41
- */
42
- declare function findElementByIdentifier(identifier: string | ElementIdentifier, root?: ParentNode): HTMLElement | null;
43
- /**
44
- * Find all elements matching an identifier pattern
45
- */
46
- declare function findAllElementsByIdentifier(pattern: string, root?: ParentNode): HTMLElement[];
47
- /**
48
- * Check if an element matches an identifier
49
- */
50
- declare function elementMatchesIdentifier(element: HTMLElement, identifier: string | ElementIdentifier): boolean;
123
+ declare function createWSClient(config: WSClientConfig): UIBridgeWSClient;
51
124
 
52
- export { ElementIdentifier, ID_ATTRIBUTES, createElementIdentifier, elementMatchesIdentifier, findAllElementsByIdentifier, findElementByIdentifier, generateCSSSelector, generateXPath, getBestIdentifier };
125
+ export { ActionRequest, ActionResponse, BridgeEvent, BridgeEventType, BridgeSnapshot, UIBridgeWSClient, WSClientConfig, WSConnectionState, WSSubscriptionOptions, createWSClient };