@qontinui/ui-bridge-native 0.1.5 → 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.
- package/dist/control/{index.d.mts → action-executor.d.ts} +6 -10
- package/dist/control/action-executor.d.ts.map +1 -0
- package/dist/control/index.d.ts +5 -91
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +1 -1
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +1 -1
- package/dist/control/index.mjs.map +1 -1
- package/dist/{types-BCYWwyVy.d.ts → control/types.d.ts} +17 -18
- package/dist/control/types.d.ts.map +1 -0
- package/dist/core/element-identifier.d.ts +41 -0
- package/dist/core/element-identifier.d.ts.map +1 -0
- package/dist/core/index.d.ts +6 -43
- package/dist/core/index.d.ts.map +1 -0
- package/dist/{registry-B8A_EoxS.d.ts → core/registry.d.ts} +10 -13
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/{types-BPNuYxDx.d.ts → core/types.d.ts} +30 -30
- package/dist/core/types.d.ts.map +1 -0
- package/dist/debug/index.d.ts +4 -44
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js.map +1 -1
- package/dist/debug/index.mjs.map +1 -1
- package/dist/debug/{index.d.mts → inspector.d.ts} +3 -6
- package/dist/debug/inspector.d.ts.map +1 -0
- package/dist/design/{index.d.mts → design-inspector-native.d.ts} +7 -11
- package/dist/design/design-inspector-native.d.ts.map +1 -0
- package/dist/{design-types-BHr6Q1FX.d.ts → design/design-types.d.ts} +10 -11
- package/dist/design/design-types.d.ts.map +1 -0
- package/dist/design/index.d.ts +5 -60
- package/dist/design/index.d.ts.map +1 -0
- package/dist/index.d.ts +28 -86
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react/UIBridgeNativeProvider.d.ts +147 -0
- package/dist/react/UIBridgeNativeProvider.d.ts.map +1 -0
- package/dist/react/index.d.ts +8 -69
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +116 -4
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +116 -4
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/{index.d.mts → useAutoRegister.d.ts} +7 -15
- package/dist/react/useAutoRegister.d.ts.map +1 -0
- package/dist/react/useUIBridge.d.ts +103 -0
- package/dist/react/useUIBridge.d.ts.map +1 -0
- package/dist/react/useUIComponent.d.ts +112 -0
- package/dist/react/useUIComponent.d.ts.map +1 -0
- package/dist/react/useUIElement.d.ts +162 -0
- package/dist/react/useUIElement.d.ts.map +1 -0
- package/dist/server/design-handlers.d.ts +47 -0
- package/dist/server/design-handlers.d.ts.map +1 -0
- package/dist/server/handlers.d.ts +20 -0
- package/dist/server/handlers.d.ts.map +1 -0
- package/dist/server/http-server.d.ts +247 -0
- package/dist/server/http-server.d.ts.map +1 -0
- package/dist/server/index.d.ts +13 -117
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +102 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +102 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/types.d.ts +200 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/ws-connection.d.ts +48 -0
- package/dist/server/ws-connection.d.ts.map +1 -0
- package/dist/server/ws-event-bridge.d.ts +113 -0
- package/dist/server/ws-event-bridge.d.ts.map +1 -0
- package/dist/server/ws-protocol.d.ts +48 -0
- package/dist/server/ws-protocol.d.ts.map +1 -0
- package/dist/server/ws-types.d.ts +65 -0
- package/dist/server/ws-types.d.ts.map +1 -0
- package/dist/transport/CloudRelayClient.d.ts +51 -0
- package/dist/transport/CloudRelayClient.d.ts.map +1 -0
- package/dist/transport/DeviceAnnouncer.d.ts +75 -0
- package/dist/transport/DeviceAnnouncer.d.ts.map +1 -0
- package/dist/transport/index.d.ts +3 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/core/index.d.mts +0 -46
- package/dist/design-types-BHr6Q1FX.d.mts +0 -205
- package/dist/http-server-B7KudcYJ.d.ts +0 -622
- package/dist/http-server-D7uVANBU.d.mts +0 -622
- package/dist/index.d.mts +0 -89
- package/dist/registry-DhbGbl9c.d.mts +0 -215
- package/dist/server/index.d.mts +0 -119
- package/dist/types-BPNuYxDx.d.mts +0 -383
- package/dist/types-Bcj7ji97.d.mts +0 -177
- package/dist/useUIBridge-CDZbWxII.d.ts +0 -571
- package/dist/useUIBridge-DfIEq9EQ.d.mts +0 -571
package/dist/index.d.mts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export { A as ActionHandler, B as BridgeEvent, a as BridgeEventListener, b as BridgeEventType, C as ComponentAction, c as CustomAction, D as DiscoveredNativeElement, N as NativeActionRequest, d as NativeActionResponse, e as NativeBridgeSnapshot, f as NativeComponentAction, g as NativeCustomAction, h as NativeElementIdentifier, i as NativeElementRef, j as NativeElementState, k as NativeElementType, l as NativeFindRequest, m as NativeFindResponse, n as NativeLayout, o as NativeStandardAction, p as NativeUIBridgeConfig, q as NativeUIBridgeFeatures, R as RegisteredNativeComponent, r as RegisteredNativeElement, W as WaitOptions, s as Workflow, t as WorkflowStep, u as WorkflowStepType } from './types-BPNuYxDx.mjs';
|
|
2
|
-
export { N as NativeRegistryConfig, a as NativeUIBridgeRegistry, R as RegisterComponentOptions, b as RegisterElementOptions, e as extractHandlerNames, g as getGlobalRegistry, r as resetGlobalRegistry, s as setGlobalRegistry } from './registry-DhbGbl9c.mjs';
|
|
3
|
-
export { buildTreePath, createNativeElementIdentifier, findAllByPattern, findElementByIdentifier, matchesIdentifier, parseTreePath } from './core/index.mjs';
|
|
4
|
-
export { C as CloudRelayClient, a as CloudRelayConfig, b as ComponentActionDef, c as ComponentActionRequest, d as ComponentActionResponse, U as UIBridgeNativeContextValue, e as UIBridgeNativeProvider, f as UIBridgeNativeProviderProps, g as UIBridgeProps, h as UseUIBridgeReturn, i as UseUIComponentOptions, j as UseUIComponentReturn, k as UseUIElementOptions, l as UseUIElementReturn, m as UseUIElementWithPropsReturn, u as useUIBridge, n as useUIBridgeNative, o as useUIBridgeNativeOptional, p as useUIBridgeNativeRequired, q as useUIBridgeRequired, r as useUIComponent, s as useUIComponentAction, t as useUIElement, v as useUIElementWithProps } from './useUIBridge-DfIEq9EQ.mjs';
|
|
5
|
-
export { A as ActionExecutionOptions, C as ControlActionRequest, a as ControlActionResponse, b as ControlComponentActionRequest, c as ControlComponentActionResponse, N as NativeActionExecutor, P as PressActionParams, S as ScrollActionParams, d as SwipeActionParams, T as TypeActionParams, W as WaitResult } from './types-Bcj7ji97.mjs';
|
|
6
|
-
export { DefaultNativeActionExecutor, createNativeActionExecutor } from './control/index.mjs';
|
|
7
|
-
export { A as APIResponse, H as HTTPRequest, a as HTTPResponse, b as HandlerContext, c as HandlerFunction, J as JsonRpcBatchRequest, d as JsonRpcBatchResponse, e as JsonRpcEvent, f as JsonRpcRequest, g as JsonRpcResponse, N as NativeServerConfig, h as NativeServerHandlers, i as NativeUIBridgeServer, j as NavigationProvider, R as RequestHandler, k as RouteDefinition, l as RouteProvider, S as ScreenshotProvider, m as ServerAdapter, U as UI_BRIDGE_NATIVE_ROUTES, W as WebSocketConnection, n as WebSocketEventBridge, o as WebSocketMessageHandler, p as WebSocketServerAdapter, q as createNativeServer } from './http-server-D7uVANBU.mjs';
|
|
8
|
-
export { NativeDesignHandlers, buildUpgradeResponse, computeAcceptKey, createDesignHandlers, createServerHandlers } from './server/index.mjs';
|
|
9
|
-
export { E as ElementDesignData, a as ExtendedComputedStyles, F as FlattenedNativeStyle, N as NativeInteractionStateName, b as NativeStateStyles, P as PseudoElementStyles, R as ResponsiveSnapshot, S as StateStyles, c as StyleDiff } from './design-types-BHr6Q1FX.mjs';
|
|
10
|
-
export { captureNativeResponsiveSnapshot, captureNativeStateVariations, getNativeElementDesignData, mapNativeStyleToExtended } from './design/index.mjs';
|
|
11
|
-
export { UIBridgeInspector, UIBridgeInspectorProps } from './debug/index.mjs';
|
|
12
|
-
import 'react/jsx-runtime';
|
|
13
|
-
import 'react';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Device Announcer — mDNS + Cloud registration for physical device discovery
|
|
17
|
-
*
|
|
18
|
-
* Announces the UI Bridge service on the local network via mDNS (when
|
|
19
|
-
* react-native-zeroconf is available) and optionally registers with the
|
|
20
|
-
* cloud relay backend.
|
|
21
|
-
*/
|
|
22
|
-
interface AnnouncerConfig {
|
|
23
|
-
/** Stable device identifier */
|
|
24
|
-
deviceId: string;
|
|
25
|
-
/** App bundle/package ID */
|
|
26
|
-
appId: string;
|
|
27
|
-
/** UI Bridge server port (default 8087) */
|
|
28
|
-
port?: number;
|
|
29
|
-
/** Cloud relay WebSocket URL for registration */
|
|
30
|
-
cloudRelayUrl?: string;
|
|
31
|
-
/** Auth token for cloud relay */
|
|
32
|
-
cloudToken?: string;
|
|
33
|
-
/** UI Bridge SDK version */
|
|
34
|
-
version?: string;
|
|
35
|
-
}
|
|
36
|
-
interface DeviceAnnouncerState {
|
|
37
|
-
mdnsActive: boolean;
|
|
38
|
-
cloudConnected: boolean;
|
|
39
|
-
}
|
|
40
|
-
/** Minimal interface for the react-native-zeroconf Zeroconf instance */
|
|
41
|
-
interface ZeroconfService {
|
|
42
|
-
publishService(type: string, protocol: string, domain: string, name: string, port: number, txtRecord: Record<string, string>): void;
|
|
43
|
-
unpublishService(name: string): void;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Announces the UI Bridge server on the local network (mDNS) and optionally
|
|
47
|
-
* registers with the qontinui.io cloud relay for remote discovery.
|
|
48
|
-
*/
|
|
49
|
-
declare class DeviceAnnouncer {
|
|
50
|
-
private config;
|
|
51
|
-
private state;
|
|
52
|
-
private cloudWs;
|
|
53
|
-
private reconnectTimer;
|
|
54
|
-
private reconnectDelay;
|
|
55
|
-
private stopped;
|
|
56
|
-
/** Zeroconf instance, set when mDNS is successfully started */
|
|
57
|
-
private zeroconf;
|
|
58
|
-
/** Rotated pairing token for mDNS TXT records */
|
|
59
|
-
private pairingToken;
|
|
60
|
-
constructor(config: AnnouncerConfig);
|
|
61
|
-
/**
|
|
62
|
-
* Start mDNS advertisement.
|
|
63
|
-
*
|
|
64
|
-
* The consumer must pass the `Zeroconf` constructor (from `react-native-zeroconf`)
|
|
65
|
-
* explicitly; otherwise this is a no-op.
|
|
66
|
-
*
|
|
67
|
-
* Rationale: Metro's `require()` throws an uncatchable module-load error if the
|
|
68
|
-
* bundle doesn't include the named package. That error escapes async try/catch
|
|
69
|
-
* boundaries and crashes the app. We avoid it by never calling `require()`
|
|
70
|
-
* ourselves — the consumer imports the package when they know it's installed.
|
|
71
|
-
*
|
|
72
|
-
* @param ZeroconfCtor - constructor from `import Zeroconf from 'react-native-zeroconf'`
|
|
73
|
-
*/
|
|
74
|
-
startMdnsAdvertise(ZeroconfCtor?: new () => ZeroconfService): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Connect to the cloud relay WebSocket and send a device_register message.
|
|
77
|
-
*
|
|
78
|
-
* Reconnects automatically with exponential backoff (2 s → 60 s) if the
|
|
79
|
-
* connection drops.
|
|
80
|
-
*/
|
|
81
|
-
connectCloudRelay(): Promise<void>;
|
|
82
|
-
/** Stop all advertising and registration. */
|
|
83
|
-
stop(): Promise<void>;
|
|
84
|
-
/** Return a copy of the current announcer state. */
|
|
85
|
-
getState(): DeviceAnnouncerState;
|
|
86
|
-
private scheduleReconnect;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export { type AnnouncerConfig, DeviceAnnouncer, type DeviceAnnouncerState };
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { a as BridgeEventListener, i as NativeElementRef, k as NativeElementType, o as NativeStandardAction, g as NativeCustomAction, r as RegisteredNativeElement, j as NativeElementState, R as RegisteredNativeComponent, s as Workflow, b as BridgeEventType, e as NativeBridgeSnapshot } from './types-BPNuYxDx.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Native Element and Component Registry
|
|
5
|
-
*
|
|
6
|
-
* Central registry for all UI elements and components registered with UI Bridge Native.
|
|
7
|
-
* Adapted from ui-bridge for React Native environments.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Options for registering an element
|
|
12
|
-
*/
|
|
13
|
-
interface RegisterElementOptions {
|
|
14
|
-
type?: NativeElementType;
|
|
15
|
-
label?: string;
|
|
16
|
-
actions?: NativeStandardAction[];
|
|
17
|
-
customActions?: Record<string, NativeCustomAction>;
|
|
18
|
-
props?: Record<string, unknown>;
|
|
19
|
-
treePath?: string;
|
|
20
|
-
testId?: string;
|
|
21
|
-
accessibilityLabel?: string;
|
|
22
|
-
/** Route path where the element was registered (for page-scoped filtering) */
|
|
23
|
-
registrationRoute?: string | null;
|
|
24
|
-
/** Flattened RN style (from StyleSheet.flatten) for design review */
|
|
25
|
-
flatStyle?: Record<string, unknown>;
|
|
26
|
-
/** State-specific style overrides for design review */
|
|
27
|
-
stateStyles?: {
|
|
28
|
-
pressed?: Record<string, unknown>;
|
|
29
|
-
focused?: Record<string, unknown>;
|
|
30
|
-
disabled?: Record<string, unknown>;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Options for registering a component
|
|
35
|
-
*/
|
|
36
|
-
interface RegisterComponentOptions {
|
|
37
|
-
name: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
actions?: Array<{
|
|
40
|
-
id: string;
|
|
41
|
-
label?: string;
|
|
42
|
-
description?: string;
|
|
43
|
-
handler: (params?: unknown) => unknown | Promise<unknown>;
|
|
44
|
-
}>;
|
|
45
|
-
elementIds?: string[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Registry configuration
|
|
49
|
-
*/
|
|
50
|
-
interface NativeRegistryConfig {
|
|
51
|
-
verbose?: boolean;
|
|
52
|
-
onEvent?: BridgeEventListener;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Extract handler function names from an element's props.
|
|
56
|
-
* Returns names of props whose values are functions (e.g. ['onPress', 'onChangeText']).
|
|
57
|
-
*/
|
|
58
|
-
declare function extractHandlerNames(props?: Record<string, unknown>): string[];
|
|
59
|
-
/**
|
|
60
|
-
* Native UI Bridge Registry
|
|
61
|
-
*
|
|
62
|
-
* Manages registration and lookup of native UI elements and components.
|
|
63
|
-
*/
|
|
64
|
-
declare class NativeUIBridgeRegistry {
|
|
65
|
-
private elements;
|
|
66
|
-
private components;
|
|
67
|
-
private workflows;
|
|
68
|
-
private eventListeners;
|
|
69
|
-
private config;
|
|
70
|
-
constructor(config?: NativeRegistryConfig);
|
|
71
|
-
/**
|
|
72
|
-
* Register a native element
|
|
73
|
-
*/
|
|
74
|
-
registerElement(id: string, ref: React.RefObject<NativeElementRef>, options?: RegisterElementOptions): RegisteredNativeElement;
|
|
75
|
-
/**
|
|
76
|
-
* Unregister an element
|
|
77
|
-
*/
|
|
78
|
-
unregisterElement(id: string): void;
|
|
79
|
-
/**
|
|
80
|
-
* Get a registered element
|
|
81
|
-
*/
|
|
82
|
-
getElement(id: string): RegisteredNativeElement | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* Get all registered elements
|
|
85
|
-
*/
|
|
86
|
-
getAllElements(): RegisteredNativeElement[];
|
|
87
|
-
/**
|
|
88
|
-
* Get all registered elements that are visible and have a layout
|
|
89
|
-
*/
|
|
90
|
-
getVisibleElements(): RegisteredNativeElement[];
|
|
91
|
-
/**
|
|
92
|
-
* Get elements registered on a specific route (for page-scoped filtering)
|
|
93
|
-
*/
|
|
94
|
-
getElementsForRoute(route: string): RegisteredNativeElement[];
|
|
95
|
-
/**
|
|
96
|
-
* Mark elements registered on a route as off-screen (visible: false, layout: null).
|
|
97
|
-
*
|
|
98
|
-
* Use this when a screen loses focus but stays mounted — common in React Navigation
|
|
99
|
-
* tab navigators where inactive tabs remain in the tree. Without this call, stale
|
|
100
|
-
* `layout` data lingers in snapshots and makes off-screen elements look rendered.
|
|
101
|
-
*
|
|
102
|
-
* Does NOT unregister the elements — they stay registered so the user's next visit
|
|
103
|
-
* re-measures them via `onLayout` without re-mount cost. Elements without a
|
|
104
|
-
* `registrationRoute` (app-wide registrations) are untouched.
|
|
105
|
-
*/
|
|
106
|
-
markRouteOffscreen(route: string): void;
|
|
107
|
-
/**
|
|
108
|
-
* Update element state
|
|
109
|
-
*/
|
|
110
|
-
updateElementState(id: string, state: Partial<NativeElementState>): void;
|
|
111
|
-
/**
|
|
112
|
-
* Update element props (for action execution)
|
|
113
|
-
*/
|
|
114
|
-
updateElementProps(id: string, props: Record<string, unknown>): void;
|
|
115
|
-
/**
|
|
116
|
-
* Update element style for design review
|
|
117
|
-
*/
|
|
118
|
-
updateElementStyle(id: string, flatStyle: Record<string, unknown>, stateStyles?: {
|
|
119
|
-
pressed?: Record<string, unknown>;
|
|
120
|
-
focused?: Record<string, unknown>;
|
|
121
|
-
disabled?: Record<string, unknown>;
|
|
122
|
-
}): void;
|
|
123
|
-
/**
|
|
124
|
-
* Get element style for design review
|
|
125
|
-
*/
|
|
126
|
-
getElementStyle(id: string): Record<string, unknown> | null;
|
|
127
|
-
/**
|
|
128
|
-
* Find element by testID
|
|
129
|
-
*/
|
|
130
|
-
findByTestId(testId: string): RegisteredNativeElement | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* Find elements by type
|
|
133
|
-
*/
|
|
134
|
-
findByType(type: NativeElementType): RegisteredNativeElement[];
|
|
135
|
-
/**
|
|
136
|
-
* Register a component
|
|
137
|
-
*/
|
|
138
|
-
registerComponent(id: string, options: RegisterComponentOptions): RegisteredNativeComponent;
|
|
139
|
-
/**
|
|
140
|
-
* Unregister a component
|
|
141
|
-
*/
|
|
142
|
-
unregisterComponent(id: string): void;
|
|
143
|
-
/**
|
|
144
|
-
* Get a registered component
|
|
145
|
-
*/
|
|
146
|
-
getComponent(id: string): RegisteredNativeComponent | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* Get all registered components
|
|
149
|
-
*/
|
|
150
|
-
getAllComponents(): RegisteredNativeComponent[];
|
|
151
|
-
/**
|
|
152
|
-
* Register a workflow
|
|
153
|
-
*/
|
|
154
|
-
registerWorkflow(workflow: Workflow): void;
|
|
155
|
-
/**
|
|
156
|
-
* Unregister a workflow
|
|
157
|
-
*/
|
|
158
|
-
unregisterWorkflow(id: string): void;
|
|
159
|
-
/**
|
|
160
|
-
* Get a workflow
|
|
161
|
-
*/
|
|
162
|
-
getWorkflow(id: string): Workflow | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* Get all workflows
|
|
165
|
-
*/
|
|
166
|
-
getAllWorkflows(): Workflow[];
|
|
167
|
-
/**
|
|
168
|
-
* Subscribe to events
|
|
169
|
-
*/
|
|
170
|
-
on<T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>): () => void;
|
|
171
|
-
/**
|
|
172
|
-
* Unsubscribe from events
|
|
173
|
-
*/
|
|
174
|
-
off<T = unknown>(type: BridgeEventType, listener: BridgeEventListener<T>): void;
|
|
175
|
-
/**
|
|
176
|
-
* Emit an event
|
|
177
|
-
*/
|
|
178
|
-
emit(type: BridgeEventType, data: unknown): void;
|
|
179
|
-
/**
|
|
180
|
-
* Create a snapshot of the current state
|
|
181
|
-
*/
|
|
182
|
-
createSnapshot(routeInfo?: {
|
|
183
|
-
currentRoute?: string | null;
|
|
184
|
-
segments?: string[];
|
|
185
|
-
}, options?: {
|
|
186
|
-
visibleOnly?: boolean;
|
|
187
|
-
currentRouteOnly?: boolean;
|
|
188
|
-
}): NativeBridgeSnapshot;
|
|
189
|
-
/**
|
|
190
|
-
* Get registry statistics
|
|
191
|
-
*/
|
|
192
|
-
getStats(): {
|
|
193
|
-
elements: number;
|
|
194
|
-
components: number;
|
|
195
|
-
workflows: number;
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* Clear all registrations
|
|
199
|
-
*/
|
|
200
|
-
clear(): void;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Set the global registry
|
|
204
|
-
*/
|
|
205
|
-
declare function setGlobalRegistry(registry: NativeUIBridgeRegistry): void;
|
|
206
|
-
/**
|
|
207
|
-
* Get the global registry
|
|
208
|
-
*/
|
|
209
|
-
declare function getGlobalRegistry(): NativeUIBridgeRegistry | null;
|
|
210
|
-
/**
|
|
211
|
-
* Reset the global registry
|
|
212
|
-
*/
|
|
213
|
-
declare function resetGlobalRegistry(): void;
|
|
214
|
-
|
|
215
|
-
export { type NativeRegistryConfig as N, type RegisterComponentOptions as R, NativeUIBridgeRegistry as a, type RegisterElementOptions as b, extractHandlerNames as e, getGlobalRegistry as g, resetGlobalRegistry as r, setGlobalRegistry as s };
|
package/dist/server/index.d.mts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { h as NativeServerHandlers, b as HandlerContext, A as APIResponse } from '../http-server-D7uVANBU.mjs';
|
|
2
|
-
export { H as HTTPRequest, a as HTTPResponse, c as HandlerFunction, J as JsonRpcBatchRequest, d as JsonRpcBatchResponse, r as JsonRpcClientMessage, e as JsonRpcEvent, f as JsonRpcRequest, g as JsonRpcResponse, s as JsonRpcServerMessage, t as JsonRpcSubscribe, u as JsonRpcUnsubscribe, N as NativeServerConfig, i as NativeUIBridgeServer, j as NavigationProvider, R as RequestHandler, k as RouteDefinition, l as RouteProvider, S as ScreenshotProvider, m as ServerAdapter, U as UI_BRIDGE_NATIVE_ROUTES, W as WebSocketConnection, n as WebSocketEventBridge, o as WebSocketMessageHandler, p as WebSocketServerAdapter, q as createNativeServer, v as isBatchRequest, w as isSubscribe, x as isUnsubscribe } from '../http-server-D7uVANBU.mjs';
|
|
3
|
-
import { a as NativeUIBridgeRegistry } from '../registry-DhbGbl9c.mjs';
|
|
4
|
-
import { N as NativeActionExecutor } from '../types-Bcj7ji97.mjs';
|
|
5
|
-
import { E as ElementDesignData, S as StateStyles, R as ResponsiveSnapshot } from '../design-types-BHr6Q1FX.mjs';
|
|
6
|
-
import '../types-BPNuYxDx.mjs';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* UI Bridge Native Server Handlers
|
|
10
|
-
*
|
|
11
|
-
* Request handlers for the HTTP API endpoints.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create server handlers
|
|
16
|
-
*/
|
|
17
|
-
declare function createServerHandlers(registry: NativeUIBridgeRegistry, executor: NativeActionExecutor, config?: {
|
|
18
|
-
appInfo?: {
|
|
19
|
-
appId: string;
|
|
20
|
-
appName: string;
|
|
21
|
-
appType: string;
|
|
22
|
-
framework?: string;
|
|
23
|
-
};
|
|
24
|
-
}): NativeServerHandlers;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Pure-JS RFC 6455 WebSocket protocol implementation.
|
|
28
|
-
*
|
|
29
|
-
* Provides frame encoding/decoding and handshake utilities for running
|
|
30
|
-
* a WebSocket server on react-native-tcp-socket without native crypto deps.
|
|
31
|
-
*/
|
|
32
|
-
declare const OPCODE_CONTINUATION = 0;
|
|
33
|
-
declare const OPCODE_TEXT = 1;
|
|
34
|
-
declare const OPCODE_BINARY = 2;
|
|
35
|
-
declare const OPCODE_CLOSE = 8;
|
|
36
|
-
declare const OPCODE_PING = 9;
|
|
37
|
-
declare const OPCODE_PONG = 10;
|
|
38
|
-
interface DecodedFrame {
|
|
39
|
-
opcode: number;
|
|
40
|
-
fin: boolean;
|
|
41
|
-
payload: Uint8Array;
|
|
42
|
-
masked: boolean;
|
|
43
|
-
}
|
|
44
|
-
interface DecodeResult {
|
|
45
|
-
frames: DecodedFrame[];
|
|
46
|
-
remainder: Uint8Array<any>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Compute the Sec-WebSocket-Accept value from the client's Sec-WebSocket-Key.
|
|
50
|
-
*/
|
|
51
|
-
declare function computeAcceptKey(clientKey: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Build the HTTP 101 Switching Protocols response for a WebSocket upgrade.
|
|
54
|
-
*/
|
|
55
|
-
declare function buildUpgradeResponse(clientKey: string): string;
|
|
56
|
-
/** Encode a text message as a WebSocket frame. */
|
|
57
|
-
declare function encodeTextFrame(text: string): Uint8Array;
|
|
58
|
-
/** Encode a PING frame with optional payload. */
|
|
59
|
-
declare function encodePingFrame(payload?: Uint8Array): Uint8Array;
|
|
60
|
-
/** Encode a PONG frame with the payload from the PING. */
|
|
61
|
-
declare function encodePongFrame(payload: Uint8Array): Uint8Array;
|
|
62
|
-
/** Encode a CLOSE frame with optional status code and reason. */
|
|
63
|
-
declare function encodeCloseFrame(code?: number, reason?: string): Uint8Array;
|
|
64
|
-
/**
|
|
65
|
-
* Decode one or more WebSocket frames from a byte buffer.
|
|
66
|
-
* Returns decoded frames and any unconsumed bytes (for partial frames).
|
|
67
|
-
*/
|
|
68
|
-
declare function decodeFrames(buffer: Uint8Array): DecodeResult;
|
|
69
|
-
/**
|
|
70
|
-
* Decode a text payload from a Uint8Array.
|
|
71
|
-
*/
|
|
72
|
-
declare function decodeTextPayload(payload: Uint8Array): string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* UI Bridge Native Design Review Handlers
|
|
76
|
-
*
|
|
77
|
-
* HTTP handlers for the 8 design review endpoints.
|
|
78
|
-
* Maps registered element styles to the web SDK's design data format.
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Design handler interface (subset of NativeServerHandlers)
|
|
83
|
-
*/
|
|
84
|
-
interface NativeDesignHandlers {
|
|
85
|
-
getElementStyles: (ctx: HandlerContext) => Promise<APIResponse<ElementDesignData>>;
|
|
86
|
-
getElementStateStyles: (ctx: HandlerContext) => Promise<APIResponse<{
|
|
87
|
-
elementId: string;
|
|
88
|
-
stateStyles: StateStyles[];
|
|
89
|
-
}>>;
|
|
90
|
-
getDesignSnapshot: (ctx: HandlerContext) => Promise<APIResponse<{
|
|
91
|
-
elements: ElementDesignData[];
|
|
92
|
-
timestamp: number;
|
|
93
|
-
}>>;
|
|
94
|
-
getResponsiveSnapshots: (ctx: HandlerContext) => Promise<APIResponse<ResponsiveSnapshot[]>>;
|
|
95
|
-
runDesignAudit: (ctx: HandlerContext) => Promise<APIResponse<unknown>>;
|
|
96
|
-
loadStyleGuide: (ctx: HandlerContext) => Promise<APIResponse<{
|
|
97
|
-
loaded: boolean;
|
|
98
|
-
}>>;
|
|
99
|
-
getStyleGuide: (ctx: HandlerContext) => Promise<APIResponse<unknown>>;
|
|
100
|
-
clearStyleGuide: (ctx: HandlerContext) => Promise<APIResponse<{
|
|
101
|
-
cleared: boolean;
|
|
102
|
-
}>>;
|
|
103
|
-
evaluateQuality: (ctx: HandlerContext) => Promise<APIResponse<unknown>>;
|
|
104
|
-
getQualityContexts: (ctx: HandlerContext) => Promise<APIResponse<Array<{
|
|
105
|
-
name: string;
|
|
106
|
-
description: string;
|
|
107
|
-
}>>>;
|
|
108
|
-
saveBaseline: (ctx: HandlerContext) => Promise<APIResponse<{
|
|
109
|
-
saved: boolean;
|
|
110
|
-
elementCount: number;
|
|
111
|
-
}>>;
|
|
112
|
-
diffBaseline: (ctx: HandlerContext) => Promise<APIResponse<unknown>>;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Create design review handlers.
|
|
116
|
-
*/
|
|
117
|
-
declare function createDesignHandlers(registry: NativeUIBridgeRegistry): NativeDesignHandlers;
|
|
118
|
-
|
|
119
|
-
export { APIResponse, type DecodeResult, type DecodedFrame, HandlerContext, type NativeDesignHandlers, NativeServerHandlers, OPCODE_BINARY, OPCODE_CLOSE, OPCODE_CONTINUATION, OPCODE_PING, OPCODE_PONG, OPCODE_TEXT, buildUpgradeResponse, computeAcceptKey, createDesignHandlers, createServerHandlers, decodeFrames, decodeTextPayload, encodeCloseFrame, encodePingFrame, encodePongFrame, encodeTextFrame };
|